/* ── Shared Auth Styles ── */
/* Top-bar: back-home left, auth right */
.top-bar {
    position: relative; z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    max-width: 693px; margin: 0 auto; padding: 12px 20px;
}
.top-bar .back-home {
    position: relative; top: auto; left: auto;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.08); border-radius: 10px;
    color: var(--text-secondary); text-decoration: none;
    font-size: 0.82rem; font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1); font-family: inherit;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.top-bar .back-home:hover {
    border-color: #7c6cf0; color: #7c6cf0;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

/* ── Auth Buttons ── */
.nav-auth { display: flex; align-items: center; gap: 10px; position: relative; }
.nav-auth .btn {
    padding: 8px 20px; border-radius: 10px; border: none;
    font-size: 0.85rem; font-weight: 600; cursor: pointer;
    transition: 0.3s cubic-bezier(0.4,0,0.2,1); font-family: inherit;
}
.nav-auth .btn-outline {
    background: transparent; color: var(--text);
    border: 1px solid rgba(255,255,255,0.15);
}
.nav-auth .btn-outline:hover { border-color: #7c6cf0; color: #7c6cf0; }
.nav-auth .btn-primary {
    background: #7c6cf0; color: #fff;
    box-shadow: 0 4px 16px rgba(124,108,240,0.3);
}
.nav-auth .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(124,108,240,0.3); }
.nav-auth .btn-sm { padding: 6px 14px; font-size: 0.8rem; }

/* ── User Dropdown ── */
.nav-auth .user-toggle {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 14px 6px 6px; border-radius: 10px;
    background: #1a1a2e; border: 1px solid rgba(255,255,255,0.08);
    cursor: pointer; transition: 0.3s cubic-bezier(0.4,0,0.2,1); font-family: inherit;
    color: #f0f0f5;
}
.nav-auth .user-toggle:hover { border-color: #7c6cf0; }
.nav-auth .user-avatar {
    width: 30px; height: 30px; border-radius: 8px;
    background: #7c6cf0; display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.nav-auth .user-name { font-size: 0.85rem; font-weight: 500; }
.nav-auth .dropdown-arrow { font-size: 0.6rem; color: #6b6b8a; transition: 0.3s cubic-bezier(0.4,0,0.2,1); }
.nav-auth .user-toggle.open .dropdown-arrow { transform: rotate(180deg); }
.nav-auth .dropdown-menu {
    position: absolute; top: calc(100% + 6px); right: 0;
    background: #1a1a2e; border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px; padding: 6px; min-width: 200px;
    opacity: 0; visibility: hidden; transform: translateY(-4px);
    transition: 0.3s cubic-bezier(0.4,0,0.2,1); z-index: 200;
    box-shadow: 0 16px 48px rgba(0,0,0,0.4);
}
.nav-auth .dropdown-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-auth .dropdown-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 8px; cursor: pointer;
    transition: 0.3s cubic-bezier(0.4,0,0.2,1); font-size: 0.85rem;
    color: #9898b8; background: none; border: none;
    width: 100%; font-family: inherit; text-align: left;
}
.nav-auth .dropdown-item:hover { background: rgba(255,255,255,0.05); color: #f0f0f5; }
.nav-auth .dropdown-item .label { flex: 1; }
.nav-auth .dropdown-item .value { color: #f0f0f5; font-weight: 600; }
.nav-auth .dropdown-divider { height: 1px; background: rgba(255,255,255,0.06); margin: 4px 8px; }

/* ── Auth Modals ── */
.auth-modal {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden;
    transition: 0.3s cubic-bezier(0.4,0,0.2,1);
}
.auth-modal.open { opacity: 1; visibility: visible; }
.auth-modal .modal {
    background: #1a1a2e; border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px; padding: 32px; width: 90%; max-width: 400px;
    transform: scale(0.95);
    transition: 0.3s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}
.auth-modal.open .modal { transform: scale(1); }
.auth-modal .modal-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 4px; color: #f0f0f5; }
.auth-modal .modal-subtitle { color: #6b6b8a; font-size: 0.85rem; margin-bottom: 24px; }
.auth-modal .modal-header { position: relative; }
.auth-modal .modal-close {
    position: absolute; top: 16px; right: 16px;
    background: none; border: none; color: #6b6b8a;
    font-size: 1.4rem; cursor: pointer; padding: 4px; line-height: 1;
    font-family: inherit; transition: 0.2s;
}
.auth-modal .modal-close:hover { color: #f0f0f5; }
.auth-modal .form-group { margin-bottom: 16px; }
.auth-modal .form-group label {
    display: block; font-size: 0.8rem; font-weight: 500;
    color: #9898b8; margin-bottom: 6px;
}
.auth-modal .form-input {
    width: 100%; padding: 10px 14px; border-radius: 10px;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
    color: #f0f0f5; font-size: 0.9rem; font-family: inherit;
    transition: 0.3s cubic-bezier(0.4,0,0.2,1); outline: none;
}
.auth-modal .form-input:focus { border-color: #7c6cf0; box-shadow: 0 0 0 3px rgba(124,108,240,0.3); }
.auth-modal .form-input::placeholder { color: #6b6b8a; }
.auth-modal .form-error {
    color: #ef4444; font-size: 0.78rem; margin-top: 4px; display: none;
}
.auth-modal .form-submit {
    width: 100%; padding: 12px; border-radius: 12px; border: none;
    background: #7c6cf0; color: #fff; font-size: 0.95rem;
    font-weight: 600; cursor: pointer;
    transition: 0.3s cubic-bezier(0.4,0,0.2,1);
    font-family: inherit; margin-top: 8px;
}
.auth-modal .form-submit:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(124,108,240,0.3); }
.auth-modal .form-submit:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.auth-modal .form-footer {
    text-align: center; font-size: 0.82rem; color: #6b6b8a;
    margin-top: 16px;
}
.auth-modal .form-footer a { color: #7c6cf0; cursor: pointer; text-decoration: none; }
.auth-modal .form-footer a:hover { text-decoration: underline; }

/* ── Recharge ── */
.auth-modal .recharge-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.auth-modal .recharge-preset {
    padding: 14px; border-radius: 12px; text-align: center;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    cursor: pointer; transition: 0.3s cubic-bezier(0.4,0,0.2,1); font-family: inherit;
    color: #f0f0f5;
}
.auth-modal .recharge-preset:hover { border-color: #7c6cf0; background: rgba(124,108,240,0.1); }
.auth-modal .recharge-preset.selected { border-color: #7c6cf0; background: rgba(124,108,240,0.15); box-shadow: 0 0 0 2px rgba(124,108,240,0.3); }
.auth-modal .recharge-preset .amount { font-size: 1.2rem; font-weight: 700; }
.auth-modal .recharge-preset .amount .original { text-decoration: line-through; font-size: 0.75rem; font-weight: 400; opacity: 0.45; margin-right: 4px; }
.auth-modal .recharge-preset .unit { font-size: 0.75rem; color: #6b6b8a; margin-top: 2px; }
.auth-modal .recharge-preset .hint { font-size: 0.65rem; color: #6b6b8a; margin-top: 1px; opacity: 0.7; }

/* ── Social Login ── */
.social-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 16px 0; color: #6b6b8a; font-size: 0.78rem;
}
.social-divider::before,
.social-divider::after {
    content: ''; flex: 1; height: 1px;
    background: rgba(255,255,255,0.08);
}
.btn-google {
    width: 100%; display: flex; align-items: center; justify-content: center;
    gap: 10px; padding: 10px; border-radius: 12px;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    color: #f0f0f5; font-size: 0.85rem; font-weight: 500;
    cursor: pointer; transition: 0.3s cubic-bezier(0.4,0,0.2,1); font-family: inherit;
}
.btn-google:hover {
    background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}
.btn-google svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ── Toast ── */
.toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
    z-index: 2000; padding: 12px 24px; border-radius: 12px;
    font-size: 0.85rem; font-weight: 500; opacity: 0;
    transition: all 0.4s ease; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: rgba(52,211,153,0.15); color: #34d399; border: 1px solid rgba(52,211,153,0.2); }
.toast.error { background: rgba(239,68,68,0.15); color: #ef4444; border: 1px solid rgba(239,68,68,0.2); }

/* ── QR Payment (sub-service dynamic injection) ── */
.qr-wrapper { text-align: center; }
.qr-art {
    display: inline-block; background: #fff; color: #000;
    padding: 12px; border-radius: 12px;
    font-size: 0.45rem; line-height: 1.1;
    margin-bottom: 16px; user-select: all;
}
.qr-info { margin-bottom: 8px; }
.qr-amount { font-size: 1.2rem; font-weight: 700; color: #f0f0f5; }
.qr-address { font-size: 0.72rem; color: #6b6b8a; margin-top: 4px; font-family: monospace; }

.paid-wrapper { text-align: center; padding: 8px 0; }
.paid-icon {
    width: 56px; height: 56px; border-radius: 50%;
    background: rgba(52,211,153,0.12); color: #34d399;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; font-weight: 700; margin: 0 auto 12px;
}
.paid-text { color: #9898b8; font-size: 0.85rem; margin-bottom: 4px; }
.paid-amount { font-size: 1.5rem; font-weight: 700; color: #f0f0f5; margin-bottom: 16px; }

.back-link { font-size: 0.78rem; color: #6b6b8a; cursor: pointer; }
.back-link:hover { color: #7c6cf0; }
.form-submit-danger {
    width: 100%; padding: 12px; border-radius: 12px; border: none;
    font-size: 0.85rem; font-weight: 600; cursor: pointer;
    transition: 0.3s cubic-bezier(0.4,0,0.2,1); font-family: inherit; margin-top: 8px;
    background: rgba(239,68,68,0.1); color: #ef4444; border: 1px solid rgba(239,68,68,0.15);
}
.form-submit-danger:hover { background: rgba(239,68,68,0.2); transform: translateY(-1px); }

.timer-bar {
    height: 4px; background: rgba(255,255,255,0.06);
    border-radius: 2px; margin: 4px 0 4px; overflow: hidden;
}
.timer-bar-fill {
    height: 100%; background: #7c6cf0;
    border-radius: 2px; width: 0%;
}
.timer-text { font-size: 0.7rem; color: #6b6b8a; text-align: center; margin-bottom: 12px; }

/* ── Mobile ── */
@media (max-width: 600px) {
    .top-bar { padding: 10px 16px; }
    .top-bar .back-home { padding: 5px 10px; font-size: 0.78rem; }
    .nav-auth .btn { padding: 6px 14px; font-size: 0.78rem; }
    .nav-auth .btn-sm { padding: 5px 10px; font-size: 0.75rem; }
}

/* ── Ad Recharge Modal (pre-mode) ── */
.ad-display {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    height: 300px;
    overflow-y: auto;
    flex-shrink: 0;
    font-size: 0.85rem;
    line-height: 1.7;
    color: #f0f0f5;
    white-space: pre-wrap;
    font-family: inherit;
}
.ad-typewriter-cursor {
    display: inline-block;
    width: 2px;
    height: 1.1em;
    background: #7c6cf0;
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blink 0.8s step-end infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}
.ad-daily-counter {
    text-align: center;
    font-size: 0.78rem;
    color: #6b6b8a;
    margin-bottom: 12px;
}
.ad-daily-counter span {
    color: #f0f0f5;
    font-weight: 600;
}
.ad-success-icon {
    width: 48px; height: 48px; border-radius: 50%;
    background: rgba(52,211,153,0.12); color: #34d399;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; font-weight: 700; margin: 0 auto 12px;
}
.ad-success-amount {
    font-size: 1.3rem; font-weight: 700; color: #34d399; text-align: center; margin-bottom: 4px;
}
.ad-success-text {
    font-size: 0.82rem; color: #9898b8; text-align: center; margin-bottom: 16px;
}

/* ── Registration Banner ── */
.reg-banner {
    background: linear-gradient(135deg, rgba(124,108,240,0.18), rgba(224,123,224,0.12));
    border-bottom: 1px solid rgba(124,108,240,0.25);
    padding: 8px 16px;
    text-align: center;
}
.reg-banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}
.reg-banner-icon { font-size: 1rem; flex-shrink: 0; }
.reg-banner-text { font-size: 0.8rem; color: #f0f0f5; }
.reg-banner-text strong { color: #7c6cf0; }
.reg-banner-btn {
    padding: 5px 16px; border-radius: 8px; border: none;
    background: linear-gradient(135deg, #7c6cf0, #e07be0);
    color: #fff; font-size: 0.78rem; font-weight: 600;
    cursor: pointer; font-family: inherit; line-height: normal;
    transition: 0.3s ease; white-space: nowrap;
    display: inline-block; text-decoration: none;
}
.reg-banner-btn:hover {
    transform: translateY(-1px); box-shadow: 0 4px 16px rgba(124,108,240,0.3);
    background: linear-gradient(135deg, #7c6cf0, #e07be0);
    color: #fff;
}
.reg-banner-close {
    background: none; border: none; color: #6b6b8a;
    cursor: pointer; font-size: 1rem; padding: 2px; font-family: inherit;
    line-height: normal; display: inline-block;
}
.reg-banner-close:hover { color: #f0f0f5; background: none; }

/* ── Mini Nameme Ad Display (pre-mode) ── */
.ad-nameme {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}
.ad-nameme-header {
    font-size: 0.85rem; font-weight: 600; color: #7c6cf0;
    margin-bottom: 12px; padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ad-nameme-input-row {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.04);
    border-radius: 8px; margin-bottom: 8px;
}
.ad-nameme-label { font-size: 0.75rem; color: #9898b8; }
.ad-nameme-value { font-size: 0.9rem; font-weight: 600; color: #f0f0f5; }
.ad-nameme-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(124,108,240,0.3), transparent);
    margin: 12px 0;
}
.ad-nameme-results-label {
    font-size: 0.78rem; color: #9898b8; margin-bottom: 8px;
}
.ad-nameme-content {
    font-size: 0.9rem; line-height: 1.8;
    min-height: 60px;
    white-space: pre-wrap;
    color: #f0f0f5;
}
.ad-nameme-variant {
    padding: 4px 0;
}
.ad-nameme-variant .chinese {
    font-size: 1.1rem; font-weight: 700;
    background: linear-gradient(135deg, #7c6cf0, #e07be0);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.ad-nameme-variant .pinyin {
    font-size: 0.8rem; color: #9898b8; margin-left: 4px;
}
.ad-nameme-badge {
    font-size: 0.6rem; font-weight: 600;
    background: rgba(124,108,240,0.2); color: #7c6cf0;
    padding: 1px 6px; border-radius: 4px; margin-left: 6px;
    vertical-align: middle;
}

/* ── Checkbox (required for sub-service pages) ── */
.form-checkbox-group { margin-bottom: 12px; }
.auth-modal .checkbox-label {
    display: flex; align-items: flex-start; gap: 8px;
    cursor: pointer; font-size: 0.8rem; color: var(--text-secondary); line-height: 1.4;
    margin-bottom: 0;
}
.checkbox-label input[type="checkbox"] { display: none; }
.checkbox-mark {
    width: 18px; height: 18px; min-width: 18px; border-radius: 4px;
    border: 2px solid rgba(255,255,255,0.15); background: transparent;
    display: flex; align-items: center; justify-content: center;
    transition: 0.2s; margin-top: 1px;
}
.checkbox-label input:checked + .checkbox-mark {
    background: var(--accent); border-color: var(--accent);
}
.checkbox-label input:checked + .checkbox-mark::after {
    content: "✓"; color: #fff; font-size: 0.7rem; font-weight: 700;
}
.checkbox-label a { color: var(--accent); text-decoration: none; }
.checkbox-label a:hover { text-decoration: underline; }
