:root {
    --mesh-gradient:
        radial-gradient(at 0% 0%, rgba(30, 144, 255, 0.95) 0, transparent 48%),
        radial-gradient(at 100% 0%, rgba(235, 96, 129, 0.86) 0, transparent 45%),
        radial-gradient(at 20% 100%, rgba(30, 144, 255, 0.34) 0, transparent 44%),
        linear-gradient(135deg, #eef7ff 0%, #fff1f5 100%);
    --glass-bg: rgba(255, 255, 255, 0.88);
    --glass-border: rgba(255, 255, 255, 0.2);
    --primary-color: #1E90FF;
    --accent-color: #EB6081;
    --text-main: #1e293b;
    --text-muted: #64748b;
}

body.auth-page {
    background: #eef7ff;
    background-image: var(--mesh-gradient);
    background-attachment: fixed;
    background-size: cover;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Public Sans", sans-serif;
    padding: 20px;
}

.auth-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 550px;
    padding: 40px;
    transition: all 0.3s ease;
}

.auth-card-lg {
    max-width: 720px;
    padding: 32px 40px;
}

.auth-card-lg .auth-subtitle {
    margin-bottom: 20px;
}

.auth-card:hover {
    box-shadow: 0 12px 48px 0 rgba(0, 0, 0, 0.15);
}

.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.auth-logo img {
    height: 32px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.auth-logo-text {
    font-size: 1.25rem;
}

.auth-title {
    color: var(--text-main);
    font-weight: 700;
    font-size: 1.75rem;
    margin-bottom: 8px;
    text-align: center;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 32px;
    text-align: center;
}

.form-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-main);
    margin-bottom: 8px;
}

.form-control {
    border-radius: 12px;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.2s ease;
}

.form-control:focus {
    border-width: 1px;
    padding: 12px 16px;
    box-shadow: none;
    border-color: var(--primary-color);
    background: #fff;
}

.auth-card .btn {
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 600;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.auth-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-link:hover {
    text-decoration: underline;
}

.input-group {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.5);
    transition: border-color 0.2s ease, background-color 0.2s ease;
    overflow: hidden;
}

.input-group:focus-within {
    border-color: var(--primary-color);
    background: #fff;
}

.input-group .form-control,
.input-group .input-group-text {
    border: none;
    background: transparent;
    padding: 12px 16px;
    border-radius: 0;
}

.input-group .form-control:focus {
    box-shadow: none;
    background: transparent;
}

.input-group-text {
    cursor: pointer;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .auth-card {
        padding: 30px 20px;
    }
}

/* ==========================================================================
   Split-Screen Modern Login Layout
   ========================================================================== */

body.auth-page-split {
    background: #f8fafc;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 2.5rem 1.5rem;
    color: #1e293b;
}

.auth-split-container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 4.5rem;
    align-items: center;
}

/* --- Left Hero Column --- */
.auth-hero-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1rem 0;
}

.auth-brand-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2.75rem;
    flex-wrap: wrap;
}

.auth-brand-group {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
}

.auth-brand-logo {
    height: 38px;
    width: auto;
    object-fit: contain;
}

.auth-brand-name {
    font-size: 1.65rem;
    font-weight: 700;
    color: #1e3a8a;
    letter-spacing: -0.02em;
    line-height: 1;
}

.auth-badge-welcome {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 1rem;
    background-color: #eff6ff;
    color: #2563eb;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.auth-hero-title {
    font-size: 3.25rem;
    font-weight: 800;
    line-height: 1.15;
    color: #0f172a;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
}

.auth-hero-title .gradient-text {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 55%, #db2777 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.auth-hero-subtitle {
    font-size: 1.0625rem;
    line-height: 1.65;
    color: #64748b;
    margin-bottom: 2.25rem;
    max-width: 480px;
}

.auth-feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.975rem;
    font-weight: 500;
    color: #334155;
}

.auth-feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #10b981;
    font-weight: bold;
    flex-shrink: 0;
}

/* --- Right Card Column --- */
.auth-form-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.auth-card-modern {
    background: #ffffff;
    border-radius: 24px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 20px 45px -15px rgba(15, 23, 42, 0.07), 0 0 1px 1px rgba(15, 23, 42, 0.04);
    padding: 2.75rem 2.5rem;
    width: 100%;
    max-width: 460px;
    box-sizing: border-box;
    animation: fadeInUp 0.5s ease-out forwards;
}

.auth-card-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
    margin-bottom: 0.4rem;
}

.auth-card-subtitle {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 1.75rem;
}

.form-label-modern {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.form-control-modern {
    width: 100%;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    background-color: #ffffff;
    padding: 0.8rem 1rem;
    font-size: 0.925rem;
    color: #0f172a;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.form-control-modern::placeholder {
    color: #94a3b8;
}

.form-control-modern:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    outline: none;
    background-color: #ffffff;
}

.password-input-wrapper {
    position: relative;
    width: 100%;
}

.password-input-wrapper .form-control-modern {
    padding-right: 2.75rem;
}

.btn-toggle-pw {
    position: absolute;
    right: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.btn-toggle-pw:hover {
    color: #475569;
}

.btn-toggle-pw:focus {
    outline: none;
}

.auth-options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

.remember-checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.remember-checkbox-group input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 4px;
    border: 1.5px solid #cbd5e1;
    cursor: pointer;
    accent-color: #2563eb;
    margin: 0;
}

.remember-checkbox-group label {
    font-size: 0.875rem;
    color: #475569;
    cursor: pointer;
    margin: 0;
}

.auth-forgot-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: #2563eb;
    text-decoration: none;
    transition: color 0.15s ease;
}

.auth-forgot-link:hover {
    text-decoration: underline;
    color: #1d4ed8;
}

.btn-login-modern {
    width: 100%;
    padding: 0.875rem 1.25rem;
    background-color: #2563eb;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn-login-modern:hover {
    background-color: #1d4ed8;
}

.btn-login-modern:active {
    transform: scale(0.99);
}

.auth-register-prompt {
    text-align: center;
    margin-top: 1.75rem;
    font-size: 0.875rem;
    color: #64748b;
}

.auth-register-link {
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
    margin-left: 0.25rem;
}

.auth-register-link:hover {
    text-decoration: underline;
}

.auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 1.75rem;
    font-size: 0.875rem;
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.auth-back-link:hover {
    color: #0f172a;
}

/* Alerts */
.auth-alert {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-alert-danger {
    background-color: #fef2f2;
    border: 1px solid #fee2e2;
    color: #991b1b;
}

.auth-alert-success {
    background-color: #f0fdf4;
    border: 1px solid #dcfce7;
    color: #166534;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .auth-split-container {
        grid-template-columns: 1fr;
        gap: 3rem;
        max-width: 480px;
    }

    .auth-hero-title {
        font-size: 2.5rem;
    }

    .auth-card-modern {
        padding: 2.25rem 1.75rem;
    }
}

@media (max-width: 575.98px) {
    body.auth-page-split {
        padding: 1.5rem 1rem;
    }

    .auth-brand-row {
        margin-bottom: 1.75rem;
    }

    .auth-hero-title {
        font-size: 2rem;
    }

    .auth-card-modern {
        padding: 2rem 1.25rem;
        border-radius: 20px;
    }
}

/* --- Register Form Specific Styles --- */
.auth-split-container-register {
    max-width: 1180px;
    grid-template-columns: 1fr 1.05fr;
    gap: 3.5rem;
}

.auth-card-register {
    max-width: 530px;
    padding: 2.25rem 2.25rem;
}

.auth-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.875rem;
}

.auth-location-box {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 0.875rem 1rem 1rem;
    margin-bottom: 1.1rem;
    background: #fafbfc;
}

.auth-location-legend {
    font-size: 0.825rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.65rem;
    display: block;
}

.auth-location-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
}

.form-select-modern {
    width: 100%;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background-color: #ffffff;
    padding: 0.55rem 1.6rem 0.55rem 0.65rem;
    font-size: 0.8rem;
    color: #0f172a;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 10px 8px;
    box-sizing: border-box;
}

.form-select-modern:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
    background-color: #ffffff;
}

.form-select-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.35rem;
}

.terms-checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    margin-top: 1.1rem;
    margin-bottom: 1.25rem;
    user-select: none;
}

.terms-checkbox-group input[type="checkbox"] {
    width: 1.05rem;
    height: 1.05rem;
    border-radius: 4px;
    border: 1.5px solid #cbd5e1;
    cursor: pointer;
    accent-color: #2563eb;
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.terms-checkbox-group label {
    font-size: 0.775rem;
    color: #64748b;
    line-height: 1.45;
    cursor: pointer;
    margin: 0;
}

@media (max-width: 991.98px) {
    .auth-split-container-register {
        grid-template-columns: 1fr;
        max-width: 520px;
    }
}

@media (max-width: 575.98px) {
    .auth-location-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    .auth-form-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

/* ==========================================================================
   Forgot Password Modal/Card Layout
   ========================================================================== */

body.auth-page-forgot {
    background: #f8fafc;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 2.5rem 1.5rem;
    color: #1e293b;
}

.auth-modal-card {
    background: #ffffff;
    border-radius: 24px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 20px 45px -15px rgba(15, 23, 42, 0.08), 0 0 1px 1px rgba(15, 23, 42, 0.04);
    width: 100%;
    max-width: 490px;
    padding: 2.25rem 2.25rem;
    box-sizing: border-box;
    animation: fadeInUp 0.4s ease-out forwards;
}

.auth-modal-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.auth-pill-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    background-color: #eff6ff;
    border-radius: 9999px;
    font-size: 0.725rem;
    font-weight: 700;
    color: #2563eb;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.auth-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #10b981;
    display: inline-block;
}

.auth-btn-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #f1f5f9;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.auth-btn-close:hover {
    background-color: #e2e8f0;
    color: #0f172a;
}

.auth-modal-title {
    font-size: 1.65rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.auth-modal-subtitle {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.55;
    margin-bottom: 1.5rem;
}

.auth-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1.5rem;
    margin-bottom: 1.25rem;
}

.auth-info-box {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 0.875rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.auth-info-badge-blue {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    background-color: #eff6ff;
    color: #2563eb;
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.auth-info-badge-amber {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    background-color: #fef3c7;
    color: #b45309;
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.auth-info-text {
    font-size: 0.775rem;
    color: #64748b;
    line-height: 1.45;
    margin: 0;
}

.auth-info-text strong {
    color: #1e293b;
}

.auth-cs-card {
    background-color: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 16px;
    padding: 0.875rem 1.15rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.auth-cs-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #065f46;
    margin-bottom: 0.2rem;
}

.auth-cs-desc {
    font-size: 0.775rem;
    color: #047857;
    line-height: 1.4;
    margin: 0;
}

.auth-cs-btn {
    background-color: #059669;
    color: #ffffff;
    font-size: 0.825rem;
    font-weight: 600;
    padding: 0.55rem 1rem;
    border-radius: 10px;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.auth-cs-btn:hover {
    background-color: #047857;
    color: #ffffff;
}

@media (max-width: 575.98px) {
    .auth-modal-card {
        padding: 1.75rem 1.25rem;
        border-radius: 20px;
    }

    .auth-info-grid {
        grid-template-columns: 1fr;
    }

    .auth-cs-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .auth-cs-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   Language Switch (shared by all auth pages)
   ========================================================================== */

.auth-locale-switch {
    position: fixed;
    top: 1.25rem;
    right: 1.5rem;
    z-index: 1030;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.35rem 0.3rem 0.75rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    box-shadow: 0 8px 24px -12px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.auth-locale-icon {
    color: #64748b;
    flex-shrink: 0;
}

.auth-locale-track {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #f1f5f9;
    border-radius: 9999px;
    padding: 0.2rem;
}

.auth-locale-thumb {
    position: absolute;
    top: 0.2rem;
    bottom: 0.2rem;
    left: 0.2rem;
    width: calc(50% - 0.2rem);
    background: #2563eb;
    border-radius: 9999px;
    box-shadow: 0 4px 10px -4px rgba(37, 99, 235, 0.6);
    transition: transform 0.25s ease;
}

.auth-locale-track[data-active="en"] .auth-locale-thumb {
    transform: translateX(100%);
}

.auth-locale-option {
    position: relative;
    z-index: 1;
    min-width: 2.5rem;
    padding: 0.3rem 0.7rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #475569;
    text-decoration: none;
    border-radius: 9999px;
    transition: color 0.2s ease;
}

.auth-locale-option:hover {
    color: #1e293b;
}

.auth-locale-option.is-active,
.auth-locale-option.is-active:hover {
    color: #ffffff;
    pointer-events: none;
}

.auth-locale-option:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

/* ==========================================================================
   Shared Tidy-ups
   ========================================================================== */

.auth-field {
    margin-bottom: 1.25rem;
}

.auth-field-tight {
    margin-bottom: 1rem;
}

.auth-card-register .auth-field {
    margin-bottom: 0.875rem;
}

.auth-alert {
    align-items: flex-start;
    line-height: 1.5;
}

.auth-alert svg {
    margin-top: 0.1rem;
}

.auth-options-row {
    flex-wrap: wrap;
    gap: 0.5rem;
}

.auth-page-forgot .auth-back-link {
    margin-top: 1.5rem;
}

@media (max-width: 991.98px) {
    body.auth-page-split,
    body.auth-page-forgot {
        padding-top: 5rem;
    }

    .auth-split-container {
        gap: 1.75rem;
    }

    /* Keep the form above the fold on tablets and phones. */
    .auth-hero-section {
        padding: 0;
        text-align: center;
        align-items: center;
    }

    .auth-brand-row {
        justify-content: center;
        margin-bottom: 1.25rem;
    }

    .auth-hero-title {
        margin-bottom: 0.75rem;
    }

    .auth-hero-subtitle {
        margin-bottom: 0;
    }

    .auth-feature-list {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .auth-locale-switch {
        top: 1rem;
        right: 1rem;
    }

    .auth-hero-title {
        font-size: 1.75rem;
    }

    .auth-hero-subtitle {
        font-size: 0.95rem;
    }
}

.auth-brand-logo-sm {
    height: 32px;
}

.auth-brand-name-sm {
    font-size: 1.35rem;
}

.auth-card-title,
.auth-modal-title {
    line-height: 1.25;
}
