/* ==========================================================================
   Auth Pages — Login, Sign Up, OTP Verification, Forgot/Reset Password
   Uses site CSS vars: --primary-color (dark), --secondary-color (gold)
   ========================================================================== */

/* ── Wrapper: full-width split layout ── */
.auth-wrapper {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    background: rgba(0, 0, 0, 0.02);
    position: relative;
}

/* ── Card ── */
.auth-section {
    width: 100%;
    max-width: 480px;
    background: #ffffff;
    border-radius: 20px;
    padding: 48px 40px 40px;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.04),
        0 8px 32px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

/* ── Typography ── */
.auth-title {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--primary-color, #212129);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.auth-subtitle {
    font-size: 0.95rem;
    color: rgba(var(--primary-color-rgb, 33, 33, 41), 0.6);
    margin-bottom: 28px;
    line-height: 1.5;
}

/* ── Icon circle (OTP, forgot, reset pages) ── */
.auth-section .rounded-circle {
    width: 64px;
    height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(var(--secondary-color-rgb, 152, 126, 77), 0.08), rgba(var(--secondary-color-rgb, 152, 126, 77), 0.15)) !important;
    color: var(--secondary-color, #987e4d) !important;
    font-size: 1.4rem !important;
}

/* ── Form elements ── */
.auth-section .form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color, #212129);
    margin-bottom: 8px;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

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

.auth-section .form-control {
    height: 50px;
    padding: 12px 42px 12px 16px;
    border: 1.5px solid rgba(var(--primary-color-rgb, 33, 33, 41), 0.15);
    border-radius: 12px;
    font-size: 0.95rem;
    color: var(--primary-color, #212129);
    background: rgba(var(--primary-color-rgb, 33, 33, 41), 0.02);
    transition: all 0.25s ease;
}

.auth-section .form-control::placeholder {
    color: rgba(var(--primary-color-rgb, 33, 33, 41), 0.5);
}

.auth-section .form-control:hover {
    border-color: rgba(var(--primary-color-rgb, 33, 33, 41), 0.25);
    background: #fff;
}

.auth-section .form-control:focus {
    border-color: var(--secondary-color, #987e4d);
    box-shadow: 0 0 0 4px rgba(var(--secondary-color-rgb, 152, 126, 77), 0.1);
    background: #fff;
    outline: none;
}

.auth-section .form-control.no-icon {
    padding-right: 16px;
}

/* ── Icons inside inputs ── */
.auth-section .input-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(var(--primary-color-rgb, 33, 33, 41), 0.5);
    font-size: 0.85rem;
    pointer-events: none;
    transition: color 0.2s;
}

.auth-section .form-control:focus ~ .input-icon {
    color: var(--secondary-color, #987e4d);
}

.auth-section .toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(var(--primary-color-rgb, 33, 33, 41), 0.5);
    cursor: pointer;
    font-size: 0.95rem;
    z-index: 2;
    transition: color 0.2s;
}

.auth-section .toggle-password:hover {
    color: var(--secondary-color, #987e4d);
}

/* Profile page password eye icons - need position relative on parent */
.dashboard-bg .form-group {
    position: relative;
}

#icon_dash_oldPassword,
#icon_dash_newPassword,
#icon_dash_confirmPassword {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(var(--primary-color-rgb, 33, 33, 41), 0.5);
    cursor: pointer;
    font-size: 0.95rem;
    z-index: 2;
    transition: color 0.2s;
}

#icon_dash_oldPassword:hover,
#icon_dash_newPassword:hover,
#icon_dash_onfirmPassword:hover {
    color: var(--secondary-color, #987e4d);
}

/* ── Error messages ── */
.auth-field-error {
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 6px;
    min-height: 0;
    font-weight: 500;
}

/* ── Checkbox ── */
.auth-section .form-check-input {
    border-color: rgba(var(--primary-color-rgb, 33, 33, 41), 0.2);
    border-radius: 4px;
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.auth-section .form-check-input:checked {
    background-color: var(--secondary-color, #987e4d);
    border-color: var(--secondary-color, #987e4d);
}

.auth-section .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(var(--secondary-color-rgb, 152, 126, 77), 0.15);
    border-color: var(--secondary-color, #987e4d);
}

.auth-section .form-check-label {
    font-size: 0.9rem;
    color: rgba(var(--primary-color-rgb, 33, 33, 41), 0.65);
    padding-left: 4px;
}

/* ── Primary action button ── */
.auth-section .btn-primary {
    width: 100%;
    height: 52px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: var(--secondary-color, #987e4d);
    border: none;
    color: #fff;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(var(--secondary-color-rgb, 152, 126, 77), 0.25);
}

.auth-section .btn-primary:hover,
.auth-section .btn-primary:focus {
    background: var(--secondary-color, #987e4d);
    filter: brightness(1.08);
    box-shadow: 0 4px 16px rgba(var(--secondary-color-rgb, 152, 126, 77), 0.35);
    transform: translateY(-1px);
}

.auth-section .btn-primary:active {
    transform: translateY(0);
    filter: brightness(0.95);
    box-shadow: 0 2px 6px rgba(var(--secondary-color-rgb, 152, 126, 77), 0.2);
}

.auth-section .btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ── Forgot password link ── */
.forgot-link {
    color: var(--secondary-color, #987e4d);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: var(--primary-color, #212129);
    text-decoration: none;
}

/* ── Divider "OR" ── */
.auth-section .divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 28px 0;
    color: rgba(var(--primary-color-rgb, 33, 33, 41), 0.5);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-section .divider::before,
.auth-section .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(var(--primary-color-rgb, 33, 33, 41), 0.1);
}

.auth-section .divider::before {
    margin-right: 16px;
}

.auth-section .divider::after {
    margin-left: 16px;
}

/* ── Social login ── */
.social-login {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

/* Google Sign-In button wrapper */
.social-login .google-signin-btn {
    width: 100%;
    display: flex;
    justify-content: center;
}

.social-login .google-signin-btn > div {
    width: 100% !important;
}

/* Facebook button */
.social-login .fb-login-button {
    width: 100%;
}

.social-login .fb-login-button > span {
    width: 100% !important;
}

.social-login .fb-login-button iframe {
    width: 100% !important;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 48px;
    border: 1.5px solid rgba(var(--primary-color-rgb, 33, 33, 41), 0.15);
    border-radius: 12px;
    background: rgba(var(--primary-color-rgb, 33, 33, 41), 0.02);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary-color, #212129);
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
}

.btn-social:hover {
    background: #fff;
    border-color: rgba(var(--primary-color-rgb, 33, 33, 41), 0.25);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.btn-google i { color: #ea4335; }
.btn-facebook i { color: #1877f2; }

/* ── OTP inputs ── */
.otp-inputs {
    gap: 12px;
}

.otp-input {
    width: 52px !important;
    height: 58px !important;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color, #212129);
    border: 2px solid rgba(var(--primary-color-rgb, 33, 33, 41), 0.15);
    border-radius: 12px;
    text-align: center;
    padding: 0 !important;
    background: rgba(var(--primary-color-rgb, 33, 33, 41), 0.02);
    transition: all 0.25s ease;
}

.otp-input:hover {
    border-color: rgba(var(--primary-color-rgb, 33, 33, 41), 0.25);
}

.otp-input:focus {
    border-color: var(--secondary-color, #987e4d);
    box-shadow: 0 0 0 4px rgba(var(--secondary-color-rgb, 152, 126, 77), 0.1);
    background: #fff;
    outline: none;
}

/* Filled state */
.otp-input:not(:placeholder-shown),
.otp-input:not([value=""]) {
    border-color: var(--secondary-color, #987e4d);
    background: #fff;
}

/* ── Alert boxes ── */
.auth-section .alert {
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    margin-bottom: 20px;
}

.auth-section .alert-success {
    background: rgba(22, 163, 74, 0.08);
    color: rgba(22, 101, 52, 0.9);
}

.auth-section .alert-danger {
    background: rgba(220, 53, 69, 0.08);
    color: rgba(153, 27, 27, 0.9);
}

/* ── Links ── */
.auth-section a {
    color: var(--secondary-color, #987e4d);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}

.auth-section a:hover {
    color: var(--primary-color, #212129);
}

/* ── Custom country selector ── */
.country-selector {
    position: relative;
    flex-shrink: 0;
}

.country-selector__trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 50px;
    padding: 0 10px 0 14px;
    border: 1.5px solid rgba(var(--primary-color-rgb, 33, 33, 41), 0.15);
    border-right: none;
    border-radius: 12px 0 0 12px;
    background: rgba(var(--primary-color-rgb, 33, 33, 41), 0.03);
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.country-selector__trigger:hover {
    background: rgba(var(--primary-color-rgb, 33, 33, 41), 0.06);
}

.country-selector__flag {
    width: 24px;
    height: 18px;
    object-fit: contain;
    border-radius: 2px;
}

.country-selector__code {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary-color, #212129);
}

.country-selector__arrow {
    font-size: 0.65rem;
    color: rgba(var(--primary-color-rgb, 33, 33, 41), 0.5);
    margin-left: 2px;
}

/* Phone input joined to selector */
.country-phone-input.form-control {
    border-radius: 0 12px 12px 0 !important;
    border-left: none !important;
    flex: 1;
    min-width: 0;
}

.country-phone-input.form-control:focus {
    border-color: var(--secondary-color, #987e4d);
    box-shadow: 0 0 0 4px rgba(var(--secondary-color-rgb, 152, 126, 77), 0.1);
}

/* When phone input is focused, also highlight the selector border */
.country-phone-input.form-control:focus ~ .country-selector__trigger,
.country-selector__trigger:focus-within {
    border-color: var(--secondary-color, #987e4d);
}

/* Dropdown */
.country-selector__dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 280px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.08);
    z-index: 100;
    overflow: hidden;
}

.country-selector__search {
    width: 100%;
    padding: 10px 14px;
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    font-size: 0.9rem;
    outline: none;
    background: rgba(0, 0, 0, 0.02);
}

.country-selector__search::placeholder {
    color: rgba(var(--primary-color-rgb, 33, 33, 41), 0.4);
}

.country-selector__list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    max-height: 220px;
    overflow-y: auto;
}

.country-selector__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 0.88rem;
    color: var(--primary-color, #212129);
}

.country-selector__item:hover {
    background: rgba(var(--secondary-color-rgb, 152, 126, 77), 0.08);
}

.country-selector__item img {
    width: 24px;
    height: 18px;
    object-fit: contain;
    border-radius: 2px;
    flex-shrink: 0;
}

.country-selector__item-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .auth-wrapper {
        padding: 32px 12px;
        min-height: calc(100vh - 160px);
    }

    .auth-section {
        max-width: 100%;
        padding: 36px 24px 32px;
        border-radius: 16px;
    }

    .auth-section::before {
        left: 24px;
        right: 24px;
    }

    .auth-title {
        font-size: 1.6rem;
    }
}

@media (max-width: 480px) {
    .auth-wrapper {
        padding: 20px 0;
        background: #fff;
    }

    .auth-wrapper::before {
        display: none;
    }

    .auth-section {
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 24px 20px;
    }

    .auth-section::before {
        display: none;
    }

    .auth-title {
        font-size: 1.4rem;
    }

    .country-selector__trigger {
        height: 48px;
        padding: 0 8px 0 10px;
    }

    .country-selector__code {
        font-size: 0.82rem;
    }

    .country-selector__dropdown {
        width: 250px;
    }

    .auth-subtitle {
        font-size: 0.9rem;
    }

    .auth-section .form-control {
        height: 48px;
        font-size: 0.9rem;
    }

    .auth-section .btn-primary {
        height: 48px;
    }

    .otp-input {
        width: 44px !important;
        height: 50px !important;
        font-size: 1.25rem;
        border-radius: 10px;
    }

    .otp-inputs {
        gap: 8px;
    }

    .auth-section .form-label {
        font-size: 0.8rem;
    }
}

/* ── Small phones (< 360px) ── */
@media (max-width: 360px) {
    .otp-input {
        width: 38px !important;
        height: 44px !important;
        font-size: 1.1rem;
    }

    .otp-inputs {
        gap: 6px;
    }
}
