/* ═══════════════════════════════════════════
   Shared Auth Pages – Split Layout System
   Used by Login, ForgotPassword, ResetPassword, VerifyOtp
   ═══════════════════════════════════════════ */

/* ── Container ── */
.auth-container {
    display: flex;
    height: 100vh;
    min-height: 100vh;
    background: var(--g-bg-card);
    overflow: hidden;
}

/* ── Left Panel: Form ── */
.auth-left {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    background: var(--g-bg-card);
    position: relative;
    z-index: 2;
    min-width: 0;
}

.auth-form-wrapper {
    width: 100%;
    max-width: 400px;
}

/* ── Heading ── */
.auth-heading {
    font-size: 1.45rem;
    font-weight: var(--g-fw-bold);
    margin-bottom: var(--g-space-6);
    background: var(--g-primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-subtitle {
    font-size: var(--g-fs-body);
    color: var(--g-text-muted);
    margin-bottom: var(--g-space-32);
}

/* ── Form Fields ── */
.auth-form-group {
    margin-bottom: var(--g-space-20);
}

.auth-field-label {
    display: block;
    font-size: var(--g-fs-xxs);
    font-weight: var(--g-fw-semibold);
    letter-spacing: 0.05em;
    color: var(--g-text-label);
    margin-bottom: var(--g-space-6);
    text-transform: uppercase;
}

.auth-field-input {
    width: 100%;
    padding: var(--g-space-12) 14px;
    font-size: var(--g-fs-body);
    color: var(--g-gray-800);
    background: var(--g-gray-50);
    border: 1px solid var(--g-border);
    border-radius: var(--g-radius-md);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.auth-field-input:focus {
    border-color: var(--g-focus-border);
    box-shadow: var(--g-focus-shadow);
    background: var(--g-bg-card);
}

.auth-field-input::placeholder {
    color: var(--g-text-muted);
}

/* ── Password Toggle ── */
.auth-password-wrapper {
    position: relative;
}

.auth-password-wrapper .auth-field-input {
    padding-right: 44px;
}

/* Hide Edge/IE built-in password reveal button */
.auth-field-input::-ms-reveal,
.auth-field-input::-ms-clear {
    display: none;
}

.auth-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--g-text-muted);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.auth-password-toggle:hover {
    color: var(--g-text-secondary);
}

.auth-password-toggle:focus-visible {
    outline: none;
    box-shadow: var(--g-focus-shadow);
    border-radius: var(--g-radius-xs);
}

/* ── Submit Button ── */
.auth-btn-submit {
    width: 100%;
    padding: 14px;
    font-size: var(--g-fs-body);
    font-weight: var(--g-fw-semibold);
    color: var(--g-bg-card);
    background: var(--g-primary-gradient);
    border: none;
    border-radius: var(--g-radius-lg);
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}

.auth-btn-submit:hover:not(:disabled) {
    opacity: 0.92;
}

.auth-btn-submit:active:not(:disabled) {
    transform: scale(0.99);
}

.auth-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-btn-submit:focus-visible {
    box-shadow: var(--g-focus-shadow);
}

/* ── Secondary Links ── */
.auth-link-wrapper {
    text-align: center;
    margin-top: var(--g-space-20);
}

.auth-link {
    font-size: var(--g-fs-body);
    color: var(--g-brand);
    text-decoration: none;
    font-weight: var(--g-fw-medium);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--g-space-4);
    transition: color 0.2s;
}

.auth-link:hover {
    text-decoration: underline;
    color: var(--g-brand);
}

.auth-link:focus-visible {
    outline: none;
    box-shadow: var(--g-focus-shadow);
    border-radius: var(--g-radius-xs);
}

/* ── Success State ── */
.auth-success-icon-wrap {
    text-align: -webkit-center;
    margin-bottom: 20px;
}

.auth-success-icon {
    font-size: 3.5rem;
    color: var(--g-brand);
}

.auth-text-center {
    text-align: center;
}

/* ── Remember Me ── */
.auth-remember-row {
    display: flex;
    align-items: center;
    gap: var(--g-space-8);
    margin-bottom: var(--g-space-24);
}

.auth-remember-label {
    font-size: var(--g-fs-body);
    color: var(--g-text-label);
    cursor: pointer;
}

.auth-toggle-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
    flex-shrink: 0;
}

.auth-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.auth-toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #ccc;
    border-radius: 22px;
    transition: background-color 0.3s;
}

.auth-toggle-slider::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
}

.auth-toggle-switch input:checked + .auth-toggle-slider {
    background-color: #f57c00;
}

.auth-toggle-switch input:checked + .auth-toggle-slider::before {
    transform: translateX(20px);
}

.auth-toggle-switch input:focus-visible + .auth-toggle-slider {
    outline: 2px solid var(--g-focus-border);
    outline-offset: 2px;
}

.auth-remember-checkbox {
    width: var(--g-space-16);
    height: var(--g-space-16);
    accent-color: var(--g-brand);
    cursor: pointer;
}

.auth-remember-checkbox:focus-visible {
    outline: 2px solid var(--g-focus-border);
    outline-offset: 2px;
}

/* ── Resend OTP ── */
.auth-resend-wrapper {
    text-align: center;
    margin-top: var(--g-space-20);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--g-space-6);
}

.auth-resend-text {
    font-size: var(--g-fs-body);
    color: var(--g-text-muted);
}

.auth-resend-link {
    font-size: var(--g-fs-body);
    color: var(--g-brand);
    font-weight: var(--g-fw-semibold);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

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

.auth-resend-link:focus-visible {
    outline: none;
    box-shadow: var(--g-focus-shadow);
    border-radius: var(--g-radius-xs);
}

/* ── Right Panel: Branding ── */
.auth-right {
    flex: 1.3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--g-primary-gradient);
    border-radius: 24px 0 0 24px;
    padding: 48px 40px;
    position: relative;
    z-index: 1;
    overflow: hidden;
    margin-left: -24px;
    padding-left: 64px;
}

.auth-right::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.12) 0%, transparent 60%);
    pointer-events: none;
}

.auth-brand-content {
    text-align: center;
    position: relative;
    z-index: 1;
    max-width: 900px;
}

.auth-brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--g-space-32);
}

.auth-brand-logo-img {
    max-width: 440px;
    height: auto;
}

.auth-brand-tagline {
    font-size: 1.25rem;
    font-weight: var(--g-fw-bold);
    color: var(--g-bg-card);
    margin-bottom: var(--g-space-16);
    line-height: 1.4;
}

.auth-brand-description {
    font-size: var(--g-fs-xs);
    color: rgba(255, 255, 255, 0.88);
    line-height: var(--g-lh-relaxed);
    margin: 0;
}

/* ── Error Alert ── */
.auth-alert {
    border-radius: var(--g-radius-md);
    font-size: var(--g-fs-body);
    margin-bottom: var(--g-space-20);
    padding: var(--g-space-12) var(--g-space-16);
    background: var(--g-error-bg);
    color: var(--g-error-text);
    border: 1px solid var(--g-error-border);
}

.auth-success {
    border-radius: var(--g-radius-md);
    font-size: 0.85rem;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* ── Responsive: Tablet ── */
@media (max-width: 768px) {
    .auth-container {
        flex-direction: column;
    }

    .auth-right {
        display: none;
    }

    .auth-left {
        padding: 16px 24px 12px 24px;
    }

    .auth-brand-tagline {
        font-size: 1rem;
    }

    .auth-brand-description {
        font-size: 0.8rem;
    }
}

/* ── Responsive: Mobile ── */
@media (max-width: 640px) {
    .auth-heading {
        font-size: 1.25rem;
        margin-bottom: 4px;
    }

    .auth-subtitle {
        font-size: 0.75rem;
        margin-bottom: 20px;
    }

    .auth-left {
        padding: 12px 16px 8px 16px;
    }

    .auth-right {
        padding: 20px 16px;
        min-height: 150px;
    }

    .auth-field-label {
        font-size: 0.65rem;
        margin-bottom: 4px;
    }

    .auth-field-input {
        padding: 10px 12px;
        font-size: 0.8rem;
    }

    .auth-form-group {
        margin-bottom: 14px;
    }

    .auth-btn-submit {
        padding: 10px;
        font-size: 0.85rem;
    }

    .auth-remember-row {
        margin-bottom: 16px;
    }

    .auth-remember-label {
        font-size: 0.78rem;
    }

    .auth-resend-wrapper {
        margin-top: 14px;
    }

    .auth-resend-text,
    .auth-resend-link {
        font-size: 0.78rem;
    }

    .auth-link-wrapper {
        margin-top: 14px;
    }

    .auth-link {
        font-size: 0.78rem;
    }

    .auth-brand-logo {
        margin-bottom: 16px;
    }

    .auth-brand-logo-img {
        max-width: 180px;
    }

    .auth-brand-tagline {
        font-size: 0.85rem;
        margin-bottom: 10px;
    }

    .auth-brand-description {
        font-size: 0.7rem;
        line-height: 1.5;
    }
}

/* ── Responsive: Small Mobile ── */
@media (max-width: 400px) {
    .auth-left {
        padding: 8px 12px 6px 12px;
    }

    .auth-right {
        padding: 16px 12px;
        min-height: 120px;
    }

    .auth-brand-logo-img {
        max-width: min(160px, 60vw);
    }

    .auth-heading {
        font-size: 1.1rem;
    }

    .auth-subtitle {
        font-size: 0.7rem;
        margin-bottom: 16px;
    }
}

/* ── Password Strength Rules ── */
.pwd-rules {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pwd-rules li {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--g-text-muted, #94a3b8);
    transition: color 0.2s ease;
}

.pwd-rules li::before {
    content: '○';
    font-size: 0.625rem;
    flex-shrink: 0;
}

.pwd-rules li.pwd-pass {
    color: var(--g-success, #10b981);
}

.pwd-rules li.pwd-pass::before {
    content: '✓';
    font-weight: 700;
}

.pwd-rules li.pwd-fail {
    color: var(--g-error, #ef4444);
}

.pwd-rules li.pwd-fail::before {
    content: '✗';
    font-weight: 700;
}
