/* ==========================================================================
   Account — Login / Register split-layout + Quick-Login panel
   ========================================================================== */

/* ===== SPLIT LAYOUT ===== */
.acc-split {
    display: grid;
    grid-template-columns: 1fr minmax(480px, 1fr);
    min-height: 100vh;
    position: relative;
}

.acc-home-logo {
    position: absolute;
    top: 24px;
    left: 32px;
    z-index: 10;
    text-decoration: none;
    transition: opacity .2s;
}

.acc-home-logo:hover { opacity: .8; }
.acc-home-logo img { height: 28px; }

.acc-brand {
    background: var(--color-dark-bg, #050210);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px 48px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.acc-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 30%, rgba(135,80,210,.3) 0%, transparent 55%),
        radial-gradient(ellipse at 20% 70%, rgba(105,65,198,.15) 0%, transparent 50%);
    pointer-events: none;
}

.acc-brand-content {
    position: relative;
    z-index: 1;
    max-width: 380px;
}

.acc-brand-title {
    font-family: var(--font-heading);
    font-size: clamp(28px, 3vw, 38px);
    font-weight: 900;
    letter-spacing: -.03em;
    color: #fff;
    margin: 0 0 16px;
    line-height: 1.15;
}

.acc-brand-title em {
    font-style: normal;
    background: linear-gradient(135deg, #FF6B81, #FCD34D);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.acc-brand-desc {
    font-size: 15px;
    color: rgba(255,255,255,.45);
    line-height: 1.6;
    margin: 0 0 40px;
}

.acc-brand-stats {
    display: flex;
    gap: 32px;
    justify-content: center;
}

.acc-brand-stat {
    text-align: center;
}

.acc-brand-stat-num {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    display: block;
}

.acc-brand-stat-label {
    font-size: 12px;
    color: rgba(255,255,255,.35);
    margin-top: 4px;
    display: block;
}

/* ===== FORM SIDE ===== */
.acc-form-side {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 48px;
    background: #fff;
}

.acc-form {
    width: 100%;
    max-width: 400px;
}

.acc-form-title {
    font-family: var(--font-heading);
    font-size: clamp(24px, 2.5vw, 32px);
    font-weight: 800;
    color: var(--color-text, #101828);
    letter-spacing: -.03em;
    margin: 0 0 8px;
}

.acc-form-subtitle {
    font-size: 15px;
    color: var(--color-text-light, #667085);
    margin: 0 0 32px;
}

.acc-form-context {
    display: inline-block;
    padding: 8px 14px;
    background: rgba(127, 86, 217, .06);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-primary, #7F56D9);
    margin-bottom: 24px;
}

/* ===== PARTICLES ===== */
.acc-brand-particles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* ===== PAGE ENTRANCE ANIMATIONS ===== */
.acc-form-side .acc-form {
    animation: accFormSlide .6s cubic-bezier(.16,1,.3,1) both;
}

@keyframes accFormSlide {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

.acc-brand-content {
    animation: accBrandFade .8s cubic-bezier(.16,1,.3,1) both;
    animation-delay: .15s;
}

@keyframes accBrandFade {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Staggered field entrance */
.acc-field { animation: accFieldIn .5s cubic-bezier(.16,1,.3,1) both; }
.acc-field:nth-child(1) { animation-delay: .1s; }
.acc-field:nth-child(2) { animation-delay: .18s; }
.acc-field:nth-child(3) { animation-delay: .26s; }

.acc-btn { animation: accFieldIn .5s cubic-bezier(.16,1,.3,1) both; animation-delay: .3s; }
.acc-divider { animation: accFieldIn .5s cubic-bezier(.16,1,.3,1) both; animation-delay: .35s; }
.acc-footer { animation: accFieldIn .5s cubic-bezier(.16,1,.3,1) both; animation-delay: .4s; }

@keyframes accFieldIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Input focus animation */
.acc-input {
    transition: border-color .2s, box-shadow .2s, transform .15s;
}

.acc-input:focus {
    transform: translateY(-1px);
}

/* Button press effect */
.acc-btn-primary:active:not(.loading) {
    transform: translateY(1px) scale(.98);
    box-shadow: 0 2px 8px rgba(244, 63, 94, .2);
}

/* Button loading state */
.acc-btn.loading {
    pointer-events: none;
    opacity: .8;
    position: relative;
    color: transparent !important;
}

.acc-btn.loading::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin: -9px 0 0 -9px;
    border: 2.5px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: accSpin .6s linear infinite;
}

@keyframes accSpin {
    to { transform: rotate(360deg); }
}

/* ===== CENTERED LAYOUT ANIMATIONS ===== */
.acc-centered .acc-form {
    animation: accFormSlide .6s cubic-bezier(.16,1,.3,1) both;
}

.acc-success-icon {
    animation: accIconBounce .6s cubic-bezier(.16,1,.3,1) both;
    animation-delay: .1s;
}

@keyframes accIconBounce {
    from { opacity: 0; transform: scale(.5); }
    60% { transform: scale(1.1); }
    to { opacity: 1; transform: scale(1); }
}

/* ===== FORM SUBMIT LOADING — auto-applied via [data-loading] ===== */
/* JS: form submit → btn.classList.add('loading'). Reset on pageshow for bfcache. */

/* ===== FORM ELEMENTS ===== */
.acc-field {
    margin-bottom: 20px;
}

.acc-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text, #101828);
    margin-bottom: 6px;
}

.acc-input-wrap {
    position: relative;
}

.acc-input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--gray-300, #D0D5DD);
    border-radius: 12px;
    font-size: 15px;
    color: var(--color-text, #101828);
    background: #fff;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.acc-input:focus {
    border-color: var(--color-primary, #7F56D9);
    box-shadow: 0 0 0 3px rgba(127, 86, 217, .1);
}

.acc-input::placeholder {
    color: var(--gray-400, #98A2B3);
}

.acc-pw-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-light, #667085);
    cursor: pointer;
    padding: 2px 4px;
}

.acc-pw-toggle:hover {
    color: var(--color-text, #101828);
}

.acc-input-pw {
    padding-right: 64px;
}

/* ===== REMEMBER + FORGOT ROW ===== */
.acc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.acc-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--color-text, #101828);
    cursor: pointer;
}

.acc-remember input {
    width: 16px;
    height: 16px;
    accent-color: var(--color-primary, #7F56D9);
}

.acc-forgot {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-primary, #7F56D9);
    text-decoration: none;
}

.acc-forgot:hover {
    text-decoration: underline;
}

/* ===== CTA BUTTON ===== */
.acc-btn {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all .3s cubic-bezier(.23,1,.32,1);
    text-align: center;
    display: block;
}

.acc-btn-primary {
    background: linear-gradient(135deg, var(--color-accent-light, #FF8A9E) 0%, var(--color-accent, #F43F5E) 50%, var(--color-accent-dark, #E11D48) 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(244, 63, 94, .25);
}

.acc-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(244, 63, 94, .35);
}

.acc-btn-primary:disabled {
    opacity: .6;
    transform: none;
    cursor: not-allowed;
}

/* ===== FOOTER LINK ===== */
.acc-footer {
    text-align: center;
    margin-top: 28px;
    font-size: 14px;
    color: var(--color-text-light, #667085);
}

.acc-footer a {
    color: var(--color-primary, #7F56D9);
    font-weight: 600;
    text-decoration: none;
}

.acc-footer a:hover {
    text-decoration: underline;
}

/* ===== DIVIDER ===== */
.acc-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--gray-400, #98A2B3);
    font-size: 13px;
}

.acc-divider::before,
.acc-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--gray-200, #EAECF0);
}

/* ===== ERROR ===== */
.acc-error {
    padding: 10px 14px;
    background: #FEF3F2;
    border: 1px solid #FECDCA;
    border-radius: 10px;
    font-size: 13px;
    color: #B42318;
    margin-bottom: 20px;
    display: none;
}

.acc-error.show {
    display: block;
}

/* ===== CENTERED LAYOUT (forgot password, confirmations) ===== */
.acc-centered {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    background: #fff;
}

.acc-centered-logo {
    position: absolute;
    top: 24px;
    left: 32px;
    text-decoration: none;
    transition: opacity .2s;
}

.acc-centered-logo:hover { opacity: .8; }
.acc-centered-logo img { height: 28px; }

.acc-centered .acc-form {
    max-width: 400px;
    width: 100%;
}

.acc-success-icon {
    margin-bottom: 20px;
}

/* ===== RESPONSIVE ===== */

/* Prevent horizontal overflow on all screen sizes */
.acc-split {
    overflow-x: hidden;
}

.acc-form-side {
    overflow: hidden;
}

@media (max-width: 1024px) {
    .acc-split {
        grid-template-columns: 1fr;
    }

    .acc-brand {
        padding: 72px 24px 36px;
    }

    .acc-brand-title { font-size: 24px; }
    .acc-brand-desc { margin-bottom: 20px; font-size: 14px; }
    .acc-brand-stats { gap: 24px; }
    .acc-brand-stat-num { font-size: 20px; }

    .acc-form-side {
        padding: 32px 24px 48px;
    }

    .acc-form {
        max-width: 440px;
    }
}

@media (max-width: 480px) {
    .acc-home-logo {
        top: 16px;
        left: 20px;
    }

    .acc-home-logo img { height: 24px; }

    .acc-brand {
        padding: 56px 20px 28px;
    }

    .acc-brand-title { font-size: 22px; }
    .acc-brand-desc { font-size: 13px; margin-bottom: 16px; }

    .acc-form-side {
        padding: 24px 20px 40px;
    }

    .acc-form-title { font-size: 22px; }
    .acc-form-subtitle { font-size: 14px; margin-bottom: 24px; }

    .acc-input {
        padding: 11px 14px;
        font-size: 14px;
        border-radius: 10px;
    }

    .acc-btn {
        padding: 13px 20px;
        font-size: 14px;
        border-radius: 10px;
    }

    .acc-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .acc-remember { font-size: 13px; }
    .acc-forgot { font-size: 12px; }
    .acc-footer { font-size: 13px; }
}

@media (max-width: 360px) {
    .acc-brand {
        padding: 48px 16px 24px;
    }

    .acc-brand-title { font-size: 20px; }
    .acc-brand-desc { font-size: 12px; line-height: 1.5; }

    .acc-form-side {
        padding: 20px 16px 32px;
    }

    .acc-form-title { font-size: 20px; }

    .acc-input {
        padding: 10px 12px;
        font-size: 14px;
    }

    .acc-input-pw {
        padding-right: 56px;
    }

    .acc-pw-toggle { font-size: 12px; right: 10px; }
}

/* ==========================================================================
   Quick-Login Slide-in Panel
   ========================================================================== */
.acc-login-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s, visibility .3s;
}

.acc-login-overlay.open {
    opacity: 1;
    visibility: visible;
}

.acc-login-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 400px;
    max-width: 90vw;
    background: #fff;
    z-index: 10001;
    transform: translateX(100%);
    transition: transform .35s cubic-bezier(.23,1,.32,1);
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 40px rgba(0,0,0,.1);
}

.acc-login-panel.open {
    transform: translateX(0);
}

.acc-login-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200, #EAECF0);
}

.acc-login-header h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 800;
    color: var(--color-text, #101828);
    margin: 0;
}

.acc-login-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100, #F2F4F7);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: var(--color-text-light, #667085);
    font-size: 18px;
    transition: background .15s;
}

.acc-login-close:hover {
    background: var(--gray-200, #EAECF0);
}

.acc-login-body {
    flex: 1;
    padding: 28px 24px;
    overflow-y: auto;
}

.acc-login-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--gray-200, #EAECF0);
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.acc-login-footer a {
    color: var(--color-primary, #7F56D9);
    font-weight: 600;
    text-decoration: none;
}

.acc-login-footer a:hover {
    text-decoration: underline;
}
