/* ── Solid Shared Dashboard Styles ──
   Common components used across onboarding and waitlist reference pages.
   Page-specific styles remain inline in each HTML file. */

/* ── Reset & Base ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #ffffff;
    --text-primary: #0a0a0a;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --border: #e5e5e5;
    --hover: #f5f5f5;
    --status-amber: #D97706;
    --status-green: #16a34a;
    --destructive: #d4382c;
    --font-sans: 'Geist Sans', -apple-system, 'Segoe UI', 'Helvetica Neue', sans-serif;
    --font-mono: 'Geist Mono', 'SF Mono', 'Fira Mono', 'Menlo', monospace;
}

html, body { height: 100%; }

body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── State Navigator (dev tool) ── */
.nav {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.nav-row {
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav-label {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-tertiary);
    width: 52px;
    flex-shrink: 0;
}
.nav-btn {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
    background: none;
    border: 1px solid transparent;
    border-radius: 5px;
    padding: 3px 7px;
    cursor: pointer;
    transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.nav-btn:hover { color: var(--text-secondary); background: var(--hover); }
.nav-btn.active {
    color: var(--text-primary);
    border-color: var(--border);
    background: var(--hover);
    font-weight: 500;
}
.nav-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: 8px;
}
.nav-toggle input { accent-color: var(--text-primary); }
.nav-toggle label {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-tertiary);
    cursor: pointer;
}

/* ── Identity Bar ── */
.dash-identity {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}
.dash-user {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}
.dash-user-id {
    position: relative;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 400;
    color: var(--text-secondary);
    text-transform: uppercase;
    background: var(--hover);
    border-radius: 4px;
    padding: 3px 8px;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    transition: background 0.12s, color 0.12s;
}
.dash-user-id:hover {
    background: #ebebeb;
    color: var(--text-secondary);
}
.dash-user-id::after {
    content: 'Copied';
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 400;
    text-transform: none;
    color: var(--text-tertiary);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s, visibility 0.15s;
}
.dash-user-id.copied::after {
    opacity: 1;
    visibility: visible;
}
.dash-user-id code {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.02em;
}
.dash-logout {
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-tertiary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 0;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: var(--border);
    transition: color 0.12s;
}
.dash-logout:hover { color: var(--text-primary); }
.dash-logout:focus-visible { outline: none; color: var(--text-primary); }

/* ── Status Section ── */
.dash-status { margin-bottom: 48px; }
.dash-status-line {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 10px;
}
.dash-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}
.dash-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dash-status-dot.waiting {
    background: var(--status-amber);
    animation: status-pulse 2s ease-in-out infinite;
}
.dash-status-dot.active {
    background: var(--status-green);
}
.dash-status-text {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}
.dash-status-explain {
    font-family: var(--font-sans);
    font-size: 13px;
    line-height: 1.65;
    color: var(--text-secondary);
}
.dash-status-explain strong {
    color: var(--text-secondary);
    font-weight: 400;
}

@keyframes status-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.15; }
}

/* ── Dashboard Sections ── */
.dash-section { margin-bottom: 40px; }
.dash-section:last-child { margin-bottom: 0; }
.dash-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 16px;
}

.payment-prompt-label {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}
.dash-section-explain {
    font-family: var(--font-sans);
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-tertiary);
    margin-top: 10px;
}
.plan-note {
    font-family: var(--font-sans);
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-tertiary);
    margin-top: 10px;
}

/* ── Access Code ── */
.access-toggle {
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-tertiary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: var(--border);
    transition: color 0.12s, text-decoration-color 0.12s;
}
.access-toggle:hover { color: var(--text-secondary); text-decoration-color: var(--text-tertiary); }
.access-toggle:focus-visible { outline: none; color: var(--text-secondary); text-decoration-color: var(--text-tertiary); }
/* ── Input Row ── */
.input-row {
    display: flex;
    align-items: center;
    width: fit-content;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color 0.12s;
}
.input-row:hover { border-color: var(--text-tertiary); }
.input-row:focus-within { border-color: var(--text-tertiary); }
.input-row-field {
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-primary);
    background: transparent;
    border: none;
    padding: 10px 14px;
    outline: none;
}
.input-row-field::placeholder { color: var(--text-tertiary); }
.input-row-field:focus-visible { outline: none; }
.input-row-field:disabled { color: var(--text-tertiary); }
.input-row-code { letter-spacing: 0.12em; }
.input-row-action {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    padding: 9px 16px;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
    color: var(--text-primary);
    border: none;
    transition: background 0.12s;
    white-space: nowrap;
    flex-shrink: 0;
}
.input-row-action:hover { background: var(--hover); }
.input-row-action:focus-visible { outline: none; background: var(--hover); }
.input-row-action:disabled { color: var(--text-tertiary); cursor: default; }
.input-row-line {
    display: flex;
    align-items: center;
    gap: 14px;
}

.access-feedback {
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity 0.15s;
    white-space: nowrap;
}
.access-feedback.visible { opacity: 1; }

/* ── Tier Grid ── */
.dash-tiers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
.dash-tier {
    background: var(--bg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: background 0.12s, box-shadow 0.12s;
}
.dash-tier:first-child { border-radius: 11px 0 0 11px; }
.dash-tier:last-child { border-radius: 0 11px 11px 0; }
.dash-tier:hover { background: var(--hover); }
.dash-tier:focus-visible { outline: none; background: var(--hover); }
.dash-tier.active { box-shadow: inset 0 0 0 2px var(--text-primary); }
.dash-tier-name {
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 10px;
}
.dash-tier-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
}
.dash-tier-amount {
    font-family: var(--font-sans);
    font-size: 26px;
    font-weight: 500;
    letter-spacing: 0.01em;
}
.dash-tier-original {
    font-family: var(--font-sans);
    font-size: 22px;
    font-weight: 400;
    color: var(--text-tertiary);
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
    order: -1;
}
.dash-tier-period {
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-tertiary);
}
.dash-tier-discount-label {
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 2px;
    margin-bottom: 6px;
}
.dash-tier-savings {
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}
.dash-tier-savings:empty {
    display: none;
}

/* Toggle-select status label */
.dash-tier-status {
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-tertiary);
    text-align: center;
    margin-top: auto;
    padding-top: 16px;
    opacity: 0;
    transition: opacity 0.12s, color 0.12s;
}
.dash-tier.active .dash-tier-status {
    opacity: 1;
    color: var(--text-primary);
    font-weight: 500;
}
.dash-tier-status .remove-link {
    color: var(--text-tertiary);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: var(--border);
    cursor: pointer;
    font-weight: 400;
}
.dash-tier-status .remove-link:hover {
    color: var(--text-primary);
    text-decoration-color: var(--text-tertiary);
}

.dash-tier-check { vertical-align: -2px; }
.dash-tier-check.draw polyline {
    stroke-dasharray: 14;
    stroke-dashoffset: 14;
    animation: checkDraw 0.2s ease forwards;
}
@keyframes checkDraw { to { stroke-dashoffset: 0; } }

/* ── Payment Row ── */
.payment-add {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: var(--border);
    transition: color 0.12s, text-decoration-color 0.12s;
}
.payment-add:hover { text-decoration-color: var(--text-tertiary); }
.payment-add:focus-visible { outline: none; text-decoration-color: var(--text-tertiary); }
.payment-row {
    display: flex;
    align-items: center;
    font-family: var(--font-sans);
    font-size: 14px;
}
.payment-text {
    color: var(--text-secondary);
}
.payment-action {
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-tertiary);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: var(--border);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 0 0 12px;
    transition: color 0.12s, text-decoration-color 0.12s;
}
.payment-action:hover { color: var(--text-secondary); text-decoration-color: var(--text-tertiary); }
.payment-action:focus-visible { outline: none; color: var(--text-secondary); text-decoration-color: var(--text-tertiary); }

/* ── Phone Prefix ── */
.phone-prefix {
    position: relative;
}
.phone-prefix-trigger {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-right: 1px solid var(--border);
    padding: 8px 6px 8px 10px;
    cursor: pointer;
    transition: color 0.12s;
}
.phone-prefix-trigger:hover { color: var(--text-primary); }
.phone-prefix-trigger:focus-visible { outline: none; color: var(--text-primary); }
.phone-prefix-chevron {
    color: var(--text-tertiary);
    flex-shrink: 0;
}
.phone-prefix-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: -7px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    z-index: 10;
    min-width: 200px;
    max-height: 280px;
    overflow-y: auto;
}
.phone-prefix-dropdown.open { display: block; }
.phone-prefix-option {
    display: flex;
    align-items: center;
    width: 100%;
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-primary);
    background: none;
    border: none;
    padding: 8px 10px;
    border-radius: 7px;
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
    transition: background 0.12s;
}
.phone-prefix-option:hover { background: var(--hover); }
.phone-prefix-option.selected { font-weight: 500; }
.phone-prefix-option-code {
    color: var(--text-tertiary);
    margin-left: auto;
    padding-left: 16px;
    font-family: var(--font-mono);
    font-size: 12px;
}

/* ── Phone Verification ── */
.phone-code-status {
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-tertiary);
    white-space: nowrap;
}
.phone-resend {
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-tertiary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: var(--border);
    transition: color 0.12s, text-decoration-color 0.12s;
}
.phone-resend:hover { color: var(--text-secondary); text-decoration-color: var(--text-tertiary); }
.phone-code-sep {
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-tertiary);
}
.phone-verified {
    display: flex;
    align-items: center;
    font-family: var(--font-sans);
    font-size: 14px;
}
.phone-verified-number { color: var(--text-secondary); }
.phone-verified-change {
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-tertiary);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: var(--border);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 0 0 12px;
    transition: color 0.12s, text-decoration-color 0.12s;
}
.phone-verified-change:hover { color: var(--text-secondary); text-decoration-color: var(--text-tertiary); }
.phone-verified-change:focus-visible { outline: none; color: var(--text-secondary); text-decoration-color: var(--text-tertiary); }

/* ── Confirmation Card ── */
.confirmation-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 28px;
}
.confirmation-header {
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}
.confirmation-check { vertical-align: -2px; margin-right: 1px; }
.confirmation-check.draw polyline {
    stroke-dasharray: 14;
    stroke-dashoffset: 14;
    animation: checkDraw 0.2s ease forwards 0.1s;
}
.confirmation-row {
    display: flex;
    align-items: center;
    font-family: var(--font-sans);
    font-size: 14px;
    padding: 8px 12px;
    margin-left: -12px;
    margin-right: -12px;
    border-radius: 8px;
    transition: background 0.12s;
}
.confirmation-row:hover { background: var(--hover); }
.confirmation-row:has(:focus-visible) { background: var(--hover); }
.confirmation-row + .confirmation-row { margin-top: 2px; }
.confirmation-label {
    font-family: var(--font-sans);
    color: var(--text-tertiary);
    font-size: 13px;
}
.confirmation-value {
    color: var(--text-primary);
    font-weight: 500;
    margin-left: auto;
}
.confirmation-detail {
    font-weight: 400;
    font-size: 13px;
    color: var(--text-tertiary);
    margin-left: 2px;
}
.confirmation-action {
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-tertiary);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: var(--border);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 0 0 16px;
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    opacity: 0;
    transition: max-width 0.1s ease 0.1s, opacity 0.1s ease 0.1s, color 0.12s, text-decoration-color 0.12s;
}
.confirmation-row:hover .confirmation-action {
    max-width: 80px;
    opacity: 1;
    transition: max-width 0.12s ease 0.15s, opacity 0.12s ease 0.15s, color 0.12s, text-decoration-color 0.12s;
}
.confirmation-action:hover { color: var(--text-primary); text-decoration-color: var(--text-tertiary); }
.confirmation-action:focus-visible { outline: none; color: var(--text-primary); text-decoration-color: var(--text-tertiary); max-width: 80px; opacity: 1; }

/* ── Responsive ── */
@media (max-width: 767px) {
    .dash-tiers { grid-template-columns: 1fr; }
    .dash-tier:first-child { border-radius: 11px 11px 0 0; }
    .dash-tier:last-child { border-radius: 0 0 11px 11px; }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
    .dash-user-id,
    .payment-action,
    .phone-verified-change,
    .confirmation-row,
    .confirmation-action,
    .confirmation-row:hover .confirmation-action { transition: none; }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #ccc; }

/* ── Visually Hidden ── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
