/* ── Utilities ───────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Account modal overlay ───────────────────────────────────────────────── */
.account-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 11000;
    background: rgba(10, 14, 30, 0.78);
    display: grid;
    place-items: center;
    padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}
.account-modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.account-modal {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: calc(var(--radius) + 6px);
    max-width: 440px;
    width: 100%;
    max-height: min(90vh, 720px);
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(10, 14, 30, 0.35);
    display: flex;
    flex-direction: column;
    transform: translateY(16px) scale(0.97);
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}
.account-modal-overlay.is-open .account-modal {
    transform: translateY(0) scale(1);
}

.account-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 20px 20px 16px;
    border-bottom: 1.5px solid var(--border);
    background: linear-gradient(135deg, rgba(255, 203, 5, 0.08), rgba(42, 117, 187, 0.06));
}
.account-modal-brand {
    display: flex;
    gap: 14px;
    align-items: center;
    min-width: 0;
}
.account-modal-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--yellow), #f5a623);
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(255, 203, 5, 0.35);
}
.account-modal-head h3 {
    font-family: var(--font-display);
    font-size: 1.45rem;
    color: var(--blue);
    margin: 0;
    line-height: 1.1;
    letter-spacing: 0.5px;
}
body.dark .account-modal-head h3 { color: #93c5fd; }
.account-modal-sub {
    margin: 4px 0 0;
    font-size: 0.84rem;
    color: var(--text-2);
    line-height: 1.4;
}

.account-modal-close {
    border: none;
    background: var(--surface2);
    width: 38px;
    height: 38px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--text-2);
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s, transform 0.15s;
}
.account-modal-close:hover {
    background: rgba(239, 68, 68, 0.12);
    color: var(--red);
}
.account-modal-close:active { transform: scale(0.94); }

.account-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

#accountAlert {
    margin-bottom: 14px;
    font-size: 0.88rem;
    padding: 11px 14px;
}
#accountAlert.hidden { display: none !important; }

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.account-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin-bottom: 20px;
    padding: 4px;
    background: var(--surface2);
    border-radius: 12px;
    border: 1.5px solid var(--border);
}
.account-tab {
    border: none;
    background: transparent;
    border-radius: 9px;
    padding: 10px 14px;
    font: inherit;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text-2);
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.account-tab:hover:not(.active) {
    color: var(--text);
    background: rgba(42, 117, 187, 0.06);
}
.account-tab.active {
    background: var(--surface);
    color: var(--blue);
    box-shadow: 0 2px 8px rgba(42, 117, 187, 0.12);
}
body.dark .account-tab.active { color: #93c5fd; }

/* ── Panes ───────────────────────────────────────────────────────────────── */
.account-pane { animation: account-fade-in 0.2s ease; }
@keyframes account-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.account-form .field { margin-bottom: 14px; }
.account-form .field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-2);
    margin-bottom: 6px;
}
.account-form .field input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font: inherit;
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.account-form .field input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(42, 117, 187, 0.15);
}

.account-pass-wrap {
    position: relative;
}
.account-pass-wrap input { padding-right: 44px; }
.account-pass-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px 6px;
    opacity: 0.55;
    line-height: 1;
}
.account-pass-toggle:hover { opacity: 1; }

.account-submit {
    width: 100%;
    margin-top: 6px;
    padding: 13px 18px;
    font-size: 0.95rem;
    position: relative;
}
.account-submit.is-loading {
    color: transparent !important;
    pointer-events: none;
}
.account-submit.is-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: account-spin 0.7s linear infinite;
}
@keyframes account-spin { to { transform: rotate(360deg); } }

.account-switch-hint {
    margin-top: 14px;
    text-align: center;
    font-size: 0.84rem;
    color: var(--text-2);
}
.account-switch-hint button {
    border: none;
    background: none;
    font: inherit;
    font-weight: 800;
    color: var(--blue);
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}
body.dark .account-switch-hint button { color: #93c5fd; }

/* ── Profile view ────────────────────────────────────────────────────────── */
.account-profile-card {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(42, 117, 187, 0.06), rgba(255, 203, 5, 0.05));
    margin-bottom: 18px;
}
.account-profile-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 1rem;
    flex-shrink: 0;
}
.account-profile-meta strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 2px;
}
.account-profile-meta span {
    font-size: 0.82rem;
    color: var(--text-2);
}

.account-section-title {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-2);
    margin-bottom: 10px;
}

.account-order-item {
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 8px;
    background: var(--surface2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.account-order-item strong { font-size: 0.9rem; }
.account-order-meta {
    font-size: 0.78rem;
    color: var(--text-2);
    margin-top: 3px;
}
.account-order-price {
    font-weight: 900;
    color: var(--red);
    font-size: 0.95rem;
    white-space: nowrap;
}

.account-empty {
    color: var(--text-2);
    text-align: center;
    padding: 20px 12px;
    font-size: 0.9rem;
    border: 1.5px dashed var(--border);
    border-radius: 10px;
}

.account-logout-btn {
    width: 100%;
    margin-top: 18px;
}

@media (max-width: 480px) {
    .account-modal-head { padding: 16px 16px 14px; }
    .account-modal-body { padding: 16px; }
    .account-modal-icon { width: 42px; height: 42px; font-size: 1.2rem; }
}
.account-forgot-row { text-align: center; margin: 4px 0 0; }
.account-forgot-link {
    background: none; border: none; padding: 0;
    color: var(--blue); font-size: 0.88rem; font-weight: 600;
    cursor: pointer; text-decoration: underline;
}
body.dark .account-forgot-link { color: #93c5fd; }
.account-forgot-desc { font-size: 0.9rem; color: var(--text-2); margin-bottom: 14px; line-height: 1.5; }
