/* =========================================================
   BESTXOUND AUTHENTICATION UI
   Login + Register
========================================================= */

:root {
    --auth-dark: #101820;
    --auth-dark-2: #17232d;
    --auth-accent: #c79a57;
    --auth-accent-dark: #a97d3d;
    --auth-bg: #f4f6f8;
    --auth-surface: #ffffff;
    --auth-border: #dfe4e8;
    --auth-border-soft: #edf0f2;
    --auth-text: #15191d;
    --auth-muted: #727a82;
    --auth-danger: #c0392b;
    --auth-success: #287b57;
    --auth-shadow: 0 28px 80px rgba(16, 24, 32, .12);
}

.auth-page {
    min-height: 100vh;
    background: var(--auth-bg);
    display: flex;
    align-items: stretch;
    overflow: hidden;
}

.auth-shell {
    width: 100%;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(390px, .85fr) minmax(520px, 1.15fr);
}

.auth-brand-panel {
    position: relative;
    overflow: hidden;
    padding: 55px;
    background:
        linear-gradient(135deg, rgba(16,24,32,.98), rgba(16,24,32,.86)),
        url('/rental/assets/images/hero.jpg') center/cover;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    isolation: isolate;
}

.auth-brand-panel::before,
.auth-brand-panel::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
}

.auth-brand-panel::before {
    width: 620px;
    height: 620px;
    right: -360px;
    top: -280px;
    border: 1px solid rgba(199,154,87,.18);
    box-shadow: 0 0 0 70px rgba(199,154,87,.025), 0 0 0 140px rgba(199,154,87,.018);
    animation: authFloat 12s ease-in-out infinite;
}

.auth-brand-panel::after {
    width: 420px;
    height: 420px;
    right: -180px;
    bottom: -150px;
    border: 1px solid rgba(199,154,87,.25);
    animation: authFloatReverse 14s ease-in-out infinite;
}

.auth-logo {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 13px;
    text-decoration: none;
    color: inherit;
    font-weight: 800;
    font-size: 20px;
    letter-spacing: -.5px;
    width: fit-content;
}

.auth-logo-mark {
    width: 43px;
    height: 43px;
    border: 1px solid rgba(199,154,87,.7);
    display: grid;
    place-items: center;
    color: var(--auth-accent);
    font-size: 12px;
    letter-spacing: 1px;
    transition: transform .35s ease, background .35s ease, box-shadow .35s ease;
}

.auth-logo:hover .auth-logo-mark {
    transform: rotate(-5deg) scale(1.06);
    background: rgba(199,154,87,.08);
    box-shadow: 0 10px 30px rgba(199,154,87,.12);
}

.auth-logo small {
    display: block;
    font-size: 8px;
    letter-spacing: 3px;
    opacity: .6;
    margin-top: 2px;
}

.auth-brand-content {
    position: relative;
    z-index: 2;
    max-width: 570px;
    animation: authReveal .8s cubic-bezier(.2,.8,.2,1) both;
}

.auth-kicker,
.auth-heading > span {
    color: var(--auth-accent);
    font-size: 11px;
    letter-spacing: 3px;
    font-weight: 800;
}

.auth-brand-content h1 {
    font-size: clamp(42px, 4vw, 68px);
    line-height: 1.02;
    letter-spacing: -3px;
    margin: 22px 0;
    font-weight: 700;
}

.auth-brand-content h1 span {
    display: block;
    color: var(--auth-accent);
}

.auth-brand-content p {
    max-width: 490px;
    color: rgba(255,255,255,.7);
    line-height: 1.8;
    font-size: 15px;
}

.auth-brand-footer {
    position: relative;
    z-index: 2;
    color: rgba(255,255,255,.4);
    font-size: 12px;
    letter-spacing: 1px;
}

.auth-form-panel {
    background: var(--auth-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    overflow-y: auto;
}

.auth-form-wrapper {
    width: min(100%, 480px);
    animation: authFormIn .65s cubic-bezier(.2,.8,.2,1) both;
}

.register-wrapper {
    width: min(100%, 620px);
}

.mobile-auth-logo {
    display: none;
}

.auth-heading {
    margin-bottom: 30px;
}

.auth-heading h2 {
    margin: 12px 0 8px;
    font-size: 34px;
    line-height: 1.12;
    letter-spacing: -1.5px;
    color: var(--auth-text);
}

.auth-heading p {
    margin: 0;
    color: var(--auth-muted);
    line-height: 1.7;
    font-size: 14px;
}

/* ---------------------------------------------------------
   Alerts
--------------------------------------------------------- */

.auth-alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 14px 16px;
    margin-bottom: 20px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    animation: authAlertIn .35s ease both;
}

.auth-alert[hidden] {
    display: none !important;
}

.auth-alert-error,
.auth-alert.alert-danger {
    color: #8d2d23;
    background: #fff4f2;
    border: 1px solid #f2d0cb;
}

.auth-alert-success,
.auth-alert.alert-success {
    color: #216847;
    background: #effaf4;
    border: 1px solid #cbe8d8;
}

/* ---------------------------------------------------------
   Form layout
--------------------------------------------------------- */

.auth-form,
#loginForm,
#registerForm {
    display: flex;
    flex-direction: column;
    gap: 19px;
}

.auth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.auth-field label,
.auth-label-row label {
    font-size: 12px;
    font-weight: 750;
    color: #30363b;
    line-height: 1.4;
}

.auth-field label span {
    color: #9ca1a5;
    font-weight: 400;
    margin-left: 5px;
}

.auth-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.auth-label-row a,
.auth-create a,
.terms a {
    color: var(--auth-accent-dark);
    text-decoration: none;
    font-weight: 700;
    transition: color .2s ease;
}

.auth-label-row a:hover,
.auth-create a:hover,
.terms a:hover {
    color: var(--auth-dark);
}

/* ---------------------------------------------------------
   Inputs
--------------------------------------------------------- */

.auth-input,
.password-wrapper {
    position: relative;
}

.auth-input > i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca1a5;
    pointer-events: none;
    z-index: 2;
}

.auth-input input,
.auth-input select,
.password-wrapper input,
#loginForm input,
#registerForm input,
#registerForm select {
    width: 100%;
    height: 54px;
    border: 1px solid var(--auth-border);
    border-radius: 11px;
    background: #fff;
    padding: 0 15px;
    outline: none;
    font-size: 14px;
    color: var(--auth-text);
    transition: border-color .22s ease, box-shadow .22s ease, background .22s ease, transform .22s ease;
    box-sizing: border-box;
}

.auth-input input {
    padding-left: 45px;
    padding-right: 45px;
}

.password-wrapper input {
    padding-right: 50px;
}

.auth-input input::placeholder,
.password-wrapper input::placeholder,
#loginForm input::placeholder,
#registerForm input::placeholder {
    color: #aeb4b9;
}

.auth-input input:hover,
.auth-input select:hover,
.password-wrapper input:hover,
#loginForm input:hover,
#registerForm input:hover,
#registerForm select:hover {
    border-color: #cbd1d6;
}

.auth-input input:focus,
.auth-input select:focus,
.password-wrapper input:focus,
#loginForm input:focus,
#registerForm input:focus,
#registerForm select:focus {
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 4px rgba(199,154,87,.10), 0 8px 24px rgba(16,24,32,.04);
    background: #fff;
}

.auth-input select,
#registerForm select {
    appearance: none;
    cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, #8d9398 50%), linear-gradient(135deg, #8d9398 50%, transparent 50%);
    background-position: calc(100% - 18px) 23px, calc(100% - 13px) 23px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

/* Invalid state */

.auth-field.has-error input,
.auth-field.has-error select,
.auth-input input.is-invalid,
.password-wrapper input.is-invalid,
#loginForm input.is-invalid,
#registerForm input.is-invalid,
#registerForm select.is-invalid {
    border-color: #d96a5d;
    background: #fffafa;
    box-shadow: 0 0 0 4px rgba(192,57,43,.07);
}

.auth-field.has-error input:focus,
.auth-field.has-error select:focus,
.auth-input input.is-invalid:focus,
.password-wrapper input.is-invalid:focus {
    border-color: #c0392b;
    box-shadow: 0 0 0 4px rgba(192,57,43,.08);
}

.auth-field.has-success input,
.auth-field.has-success select {
    border-color: #62ad88;
}

.field-error {
    min-height: 0;
    color: var(--auth-danger);
    font-size: 11px;
    line-height: 1.4;
    display: block;
}

.field-error:not(:empty) {
    animation: authErrorIn .25s ease both;
}

/* ---------------------------------------------------------
   Password controls
--------------------------------------------------------- */

.password-toggle {
    position: absolute;
    right: 9px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #8d9398;
    cursor: pointer;
    padding: 0;
    display: grid;
    place-items: center;
    transition: color .2s ease, background .2s ease, transform .2s ease;
    z-index: 3;
}

.password-toggle:hover {
    color: var(--auth-dark);
    background: #f3f5f6;
}

.password-toggle:active {
    transform: translateY(-50%) scale(.94);
}

.password-toggle:focus-visible {
    outline: 2px solid var(--auth-accent);
    outline-offset: 2px;
}

.password-strength {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 20px;
    margin-top: -2px;
}

.strength-bars {
    display: flex;
    gap: 4px;
    flex: 1;
}

.strength-bars span {
    height: 4px;
    background: #e5e8ea;
    flex: 1;
    border-radius: 999px;
    transition: background .25s ease, transform .25s ease;
}

.strength-bars span.active {
    background: var(--auth-accent);
    transform: scaleY(1.35);
}

.password-strength small {
    color: #92989d;
    font-size: 10px;
    white-space: nowrap;
    min-width: 55px;
    text-align: right;
}

.password-strength.is-weak .strength-bars span.active { background: #d96a5d; }
.password-strength.is-medium .strength-bars span.active { background: #c79a57; }
.password-strength.is-strong .strength-bars span.active { background: #4f9b75; }

/* ---------------------------------------------------------
   Remember / terms
--------------------------------------------------------- */

.auth-checkbox,
.remember-option {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 12px;
    color: #62686d;
    line-height: 1.6;
    cursor: pointer;
    width: fit-content;
}

.auth-checkbox input,
.remember-option input {
    width: 16px !important;
    height: 16px !important;
    margin: 0;
    accent-color: var(--auth-accent-dark);
    cursor: pointer;
}

/* ---------------------------------------------------------
   Submit button
--------------------------------------------------------- */

.auth-submit {
    position: relative;
    width: 100%;
    min-height: 56px;
    border: 0;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--auth-dark), #1c2933);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-weight: 800;
    cursor: pointer;
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}

.auth-submit::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 25%, rgba(255,255,255,.13) 48%, transparent 70%);
    transform: translateX(-120%);
    transition: transform .7s ease;
}

.auth-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--auth-accent-dark), var(--auth-accent));
    transform: translateY(-2px);
    box-shadow: 0 16px 35px rgba(16,24,32,.18);
}

.auth-submit:hover:not(:disabled)::before {
    transform: translateX(120%);
}

.auth-submit:active:not(:disabled) {
    transform: translateY(0);
}

.auth-submit:disabled {
    cursor: wait;
    opacity: .82;
}

.auth-submit.loading {
    pointer-events: none;
}

.button-loader {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

.auth-submit.loading .button-text,
.auth-submit.loading > i {
    display: none;
}

.auth-submit.loading .button-loader {
    display: inline-flex;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: authSpin .7s linear infinite;
}

/* Legacy three-dot loader */
.button-loader span:not(.spinner) {
    width: 5px;
    height: 5px;
    background: #fff;
    border-radius: 50%;
    animation: authPulse .8s infinite alternate;
}

/* ---------------------------------------------------------
   Footer / divider
--------------------------------------------------------- */

.auth-divider {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #a1a6aa;
    font-size: 10px;
    letter-spacing: 2px;
    margin: 28px 0 20px;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: #e7e9eb;
}

.auth-create {
    text-align: center;
    color: #73797e;
    font-size: 13px;
}

/* ---------------------------------------------------------
   Animations
--------------------------------------------------------- */

.auth-form-wrapper > * {
    animation: authItemIn .55s cubic-bezier(.2,.8,.2,1) both;
}

.auth-form-wrapper > *:nth-child(2) { animation-delay: .05s; }
.auth-form-wrapper > *:nth-child(3) { animation-delay: .10s; }
.auth-form-wrapper > *:nth-child(4) { animation-delay: .15s; }

.auth-field.shake {
    animation: authShake .38s ease;
}

@keyframes authReveal {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes authFormIn {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes authItemIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes authAlertIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes authErrorIn {
    from { opacity: 0; transform: translateY(-3px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes authShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-3px); }
}

@keyframes authSpin {
    to { transform: rotate(360deg); }
}

@keyframes authPulse {
    from { opacity: .25; transform: translateY(2px); }
    to { opacity: 1; transform: translateY(-2px); }
}

@keyframes authFloat {
    0%, 100% { transform: translate3d(0,0,0) rotate(0deg); }
    50% { transform: translate3d(-12px,14px,0) rotate(2deg); }
}

@keyframes authFloatReverse {
    0%, 100% { transform: translate3d(0,0,0); }
    50% { transform: translate3d(15px,-12px,0); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (max-width: 900px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-brand-panel {
        display: none;
    }

    .auth-form-panel {
        padding: 35px 22px;
        min-height: 100vh;
    }

    .mobile-auth-logo {
        display: block;
        margin-bottom: 45px;
    }

    .mobile-auth-logo .auth-logo {
        color: var(--auth-dark);
    }
}

@media (max-width: 600px) {
    .auth-form-panel {
        padding: 28px 18px;
        align-items: flex-start;
    }

    .auth-form-wrapper {
        margin: auto 0;
    }

    .auth-heading h2 {
        font-size: 28px;
    }

    .auth-grid {
        grid-template-columns: 1fr;
        gap: 19px;
    }

    .auth-heading {
        margin-bottom: 25px;
    }
}
