/* ── Auth Modal Overlay ─────────────────────────────────────── */
.auth-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 20000;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.auth-modal-overlay.open {
    display: flex;
    animation: authFadeIn 0.2s ease;
}
@keyframes authFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Modal Box ──────────────────────────────────────────────── */
.auth-modal {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 20px;
    background: #111114;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 36px 32px 32px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
    animation: authSlideUp 0.22s ease;
}
@keyframes authSlideUp {
    from { transform: translateY(16px) scale(0.97); opacity: 0; }
    to   { transform: translateY(0) scale(1);       opacity: 1; }
}

/* Light theme */
[data-theme="light"] .auth-modal,
[data-theme="system"] .auth-modal {
    background: #f8f8f4;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.15);
}

/* ── Close button ───────────────────────────────────────────── */
.auth-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}
.auth-modal-close:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.08);
}
[data-theme="light"] .auth-modal-close,
[data-theme="system"] .auth-modal-close {
    color: rgba(0, 0, 0, 0.35);
}
[data-theme="light"] .auth-modal-close:hover,
[data-theme="system"] .auth-modal-close:hover {
    color: rgba(0, 0, 0, 0.7);
    background: rgba(0, 0, 0, 0.06);
}

/* ── Header ─────────────────────────────────────────────────── */
.auth-logo {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.25);
    margin-bottom: 20px;
    text-align: center;
}
[data-theme="light"] .auth-logo,
[data-theme="system"] .auth-logo {
    color: rgba(0, 0, 0, 0.25);
}

.auth-title {
    font-size: 22px;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
    margin: 0 0 6px;
    letter-spacing: -0.3px;
}
[data-theme="light"] .auth-title,
[data-theme="system"] .auth-title {
    color: #111111;
}

.auth-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.38);
    text-align: center;
    margin: 0 0 24px;
}
[data-theme="light"] .auth-subtitle,
[data-theme="system"] .auth-subtitle {
    color: rgba(0, 0, 0, 0.4);
}

/* ── Google Button ──────────────────────────────────────────── */
.auth-google-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px 16px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    color: #1a1a1a;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: background 0.18s, box-shadow 0.18s, transform 0.18s;
    margin-bottom: 18px;
}
.auth-google-btn:hover {
    background: #f5f5f5;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}
.auth-google-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}
.auth-google-btn svg { flex-shrink: 0; }

/* ── Divider ────────────────────────────────────────────────── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}
.auth-divider span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
    white-space: nowrap;
}
[data-theme="light"] .auth-divider::before,
[data-theme="system"] .auth-divider::before,
[data-theme="light"] .auth-divider::after,
[data-theme="system"] .auth-divider::after { background: rgba(0, 0, 0, 0.1); }
[data-theme="light"] .auth-divider span,
[data-theme="system"] .auth-divider span   { color: rgba(0, 0, 0, 0.3); }

/* ── Tabs ───────────────────────────────────────────────────── */
.auth-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 16px;
}
.auth-tab {
    flex: 1;
    padding: 7px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: rgba(255, 255, 255, 0.45);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.auth-tab.active {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-weight: 600;
}
[data-theme="light"] .auth-tabs,
[data-theme="system"] .auth-tabs  { background: rgba(0, 0, 0, 0.06); }
[data-theme="light"] .auth-tab,
[data-theme="system"] .auth-tab   { color: rgba(0, 0, 0, 0.45); }
[data-theme="light"] .auth-tab.active,
[data-theme="system"] .auth-tab.active {
    background: rgba(0, 0, 0, 0.1);
    color: #111111;
}

/* ── Inputs ─────────────────────────────────────────────────── */
.auth-input {
    width: 100%;
    padding: 11px 14px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #ffffff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
    box-sizing: border-box;
    margin-bottom: 10px;
    display: block;
    font-family: inherit;
}
.auth-input::placeholder       { color: rgba(255, 255, 255, 0.25); }
.auth-input:focus {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
}
/* Date input — fix calendar icon color */
.auth-input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1) opacity(0.4);
    cursor: pointer;
}
[data-theme="light"] .auth-input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="system"] .auth-input[type="date"]::-webkit-calendar-picker-indicator {
    filter: none;
    opacity: 0.5;
}
[data-theme="light"] .auth-input,
[data-theme="system"] .auth-input {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.12);
    color: #111111;
}
[data-theme="light"] .auth-input::placeholder,
[data-theme="system"] .auth-input::placeholder { color: rgba(0, 0, 0, 0.3); }
[data-theme="light"] .auth-input:focus,
[data-theme="system"] .auth-input:focus {
    border-color: rgba(0, 0, 0, 0.3);
    background: rgba(0, 0, 0, 0.07);
}

/* ── Error / success ────────────────────────────────────────── */
.auth-error {
    font-size: 13px;
    color: #ef5350;
    min-height: 18px;
    margin-bottom: 10px;
    text-align: center;
}

/* ── Submit button ──────────────────────────────────────────── */
.auth-submit-btn {
    width: 100%;
    padding: 12px;
    background: #ffffff;
    border: none;
    border-radius: 10px;
    color: #000000;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: background 0.18s, transform 0.18s, box-shadow 0.18s;
    margin-bottom: 12px;
    font-family: inherit;
}
.auth-submit-btn:hover {
    background: #eeeeee;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(255, 255, 255, 0.12);
}
.auth-submit-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}
[data-theme="light"] .auth-submit-btn,
[data-theme="system"] .auth-submit-btn { background: #111111; color: #ffffff; }
[data-theme="light"] .auth-submit-btn:hover,
[data-theme="system"] .auth-submit-btn:hover { background: #2a2a2a; }

/* ── Forgot password ────────────────────────────────────────── */
.auth-forgot { text-align: center; }
.auth-forgot-link {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.35);
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    transition: color 0.15s;
    font-family: inherit;
}
.auth-forgot-link:hover { color: rgba(255, 255, 255, 0.65); }
[data-theme="light"] .auth-forgot-link,
[data-theme="system"] .auth-forgot-link   { color: rgba(0, 0, 0, 0.35); }
[data-theme="light"] .auth-forgot-link:hover,
[data-theme="system"] .auth-forgot-link:hover { color: rgba(0, 0, 0, 0.65); }

/* ── Privacy checkbox ───────────────────────────────────────── */
.auth-privacy-row {
    margin-bottom: 14px;
}
.auth-privacy-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.5;
}
.auth-privacy-check {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    min-width: 16px;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    margin-top: 1px;
    position: relative;
    transition: border-color 0.15s, background 0.15s;
}
.auth-privacy-check:checked {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.9);
}
.auth-privacy-check:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: 2px solid #111114;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}
[data-theme="light"] .auth-privacy-label,
[data-theme="system"] .auth-privacy-label { color: rgba(0, 0, 0, 0.5); }
[data-theme="light"] .auth-privacy-check,
[data-theme="system"] .auth-privacy-check { border-color: rgba(0, 0, 0, 0.25); }
[data-theme="light"] .auth-privacy-check:checked,
[data-theme="system"] .auth-privacy-check:checked {
    background: #111111;
    border-color: #111111;
}
[data-theme="light"] .auth-privacy-check:checked::after,
[data-theme="system"] .auth-privacy-check:checked::after { border-color: #ffffff; }
.auth-privacy-link {
    color: rgba(255, 255, 255, 0.65);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.auth-privacy-link:hover { color: #ffffff; }
[data-theme="light"] .auth-privacy-link,
[data-theme="system"] .auth-privacy-link { color: rgba(0, 0, 0, 0.6); }
[data-theme="light"] .auth-privacy-link:hover,
[data-theme="system"] .auth-privacy-link:hover { color: #000000; }

/* ── Daily limit modal ──────────────────────────────────────── */
.limit-modal {
    text-align: center;
    padding: 40px 32px 36px;
    max-width: 380px;
    background: #0d0d10;
    border-color: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}
.limit-modal::before {
    content: '';
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.18) 0%, transparent 70%);
    pointer-events: none;
}
[data-theme="light"] .limit-modal,
[data-theme="system"] .limit-modal {
    background: #f8f8f4;
    border-color: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .limit-modal::before,
[data-theme="system"] .limit-modal::before {
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
}

.limit-icon {
    font-size: 28px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #a78bfa, #f0abfc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.limit-bar-wrap {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 8px;
}
[data-theme="light"] .limit-bar-wrap,
[data-theme="system"] .limit-bar-wrap { background: rgba(0, 0, 0, 0.08); }
.limit-bar-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #7c3aed, #a855f7, #e879f9);
    border-radius: 99px;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}
.limit-bar-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
    margin-bottom: 20px;
    letter-spacing: 0.3px;
}
[data-theme="light"] .limit-bar-label,
[data-theme="system"] .limit-bar-label { color: rgba(0, 0, 0, 0.4); }

.limit-reset-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    padding: 10px 16px;
}
[data-theme="light"] .limit-reset-row,
[data-theme="system"] .limit-reset-row {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}
.limit-reset-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.3px;
}
[data-theme="light"] .limit-reset-label,
[data-theme="system"] .limit-reset-label { color: rgba(0, 0, 0, 0.4); }
.limit-reset-value {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
}
[data-theme="light"] .limit-reset-value,
[data-theme="system"] .limit-reset-value { color: #111111; }

.limit-upgrade-btn {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #e879f9 100%);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: opacity 0.18s, transform 0.18s, box-shadow 0.18s;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}
.limit-upgrade-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 8px 28px rgba(139, 92, 246, 0.55);
}
.limit-upgrade-btn:active { transform: translateY(0); }
.limit-upgrade-icon {
    font-size: 12px;
    opacity: 0.85;
}

.limit-dismiss-btn {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 4px;
}

/* ── Profile label ──────────────────────────────────────────── */
.auth-field-label {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 5px;
    display: block;
}
[data-theme="light"] .auth-field-label,
[data-theme="system"] .auth-field-label { color: rgba(0, 0, 0, 0.4); }

/* ── Settings panel user row ────────────────────────────────── */
.settings-user-name-row {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    padding: 4px 0 8px;
    letter-spacing: 0.1px;
}
[data-theme="light"] .settings-user-name-row,
[data-theme="system"] .settings-user-name-row { color: rgba(0, 0, 0, 0.8); }

.settings-signout-btn {
    width: 100%;
    text-align: center;
}

@media (max-width: 480px) {
    .auth-modal { padding: 28px 20px 24px; margin: 16px; }
}
