*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-blur: 10px;
    --cyan: #06b6d4;
    --violet: #8b5cf6;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --danger: #ef4444;
    --radius: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Floating accent orbs */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
    pointer-events: none;
}

body::before {
    width: 400px;
    height: 400px;
    background: rgba(6, 182, 212, 0.15);
    top: -100px;
    right: -100px;
}

body::after {
    width: 350px;
    height: 350px;
    background: rgba(139, 92, 246, 0.12);
    bottom: -80px;
    left: -80px;
}

.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 580px;
    padding: 20px;
}

/* Glass card */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 40px;
}

/* Top bar */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
}

/* Hero logo */
.hero-logo {
    max-width: 320px;
    width: 100%;
    height: auto;
    margin-bottom: 16px;
}

@media (max-width: 600px) {
    .hero-logo {
        max-width: 280px;
    }
}

.topbar-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.topbar-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

/* Landing page */
.landing {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 48px 24px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    justify-content: center;
    gap: 0;
}

.hero {
    text-align: center;
    margin-bottom: 24px;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px;
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    font-size: 0.7rem;
    letter-spacing: 3px;
    margin-bottom: 12px;
    background: var(--glass-bg);
}

.hero-pill-word {
    color: var(--text-muted);
    transition: color 0.6s ease, text-shadow 0.6s ease;
}

.hero-pill-word.active {
    color: var(--cyan);
    text-shadow: 0 0 12px rgba(6, 182, 212, 0.5);
}

.hero-pill-dot {
    color: var(--text-muted);
}

.hero-title {
    font-size: 3.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.15;
    letter-spacing: -0.5px;
}

.hero-accent {
    background: linear-gradient(135deg, var(--cyan), var(--violet));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle-wrap {
    position: relative;
    height: 1.5em;
    max-width: 480px;
    margin: 0 auto;
}

.hero-subtitle {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
    opacity: 0;
    transition: opacity 0.6s ease;
    text-align: center;
}

.hero-subtitle.active {
    opacity: 1;
}

/* Action cards */
.action-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    width: 100%;
    margin-bottom: 24px;
}

.action-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 24px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.action-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.action-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.action-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

.action-cta {
    font-size: 0.9rem;
    color: var(--cyan);
    line-height: 1.5;
    margin-top: auto;
}

/* Trust bar */
.trust-bar {
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
}

.trust-item {
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

@media (max-width: 600px) {
    .action-cards {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .topbar {
        padding: 12px 16px;
    }

    .trust-bar {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
}

/* Page hero (send/receive pages) */
.page-hero {
    text-align: center;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.page-hero-icon {
    height: 48px;
    width: auto;
}

.page-hero-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

/* Logo */
.logo {
    text-align: center;
    margin-bottom: 12px;
}

/* Branding */
.brand {
    text-align: center;
    margin-bottom: 8px;
}

.brand h1 {
    font-family: 'Courier New', monospace;
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 4px;
    background: linear-gradient(135deg, var(--cyan), var(--violet));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-dots {
    letter-spacing: 2px;
}

.brand-fyi {
    font-size: 1.2rem;
    letter-spacing: 2px;
    opacity: 0.7;
}

.tagline {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    letter-spacing: 1px;
    margin-bottom: 36px;
}

/* Buttons */
.btn {
    display: block;
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: transparent;
    border: 1px solid var(--cyan);
    color: var(--cyan);
}

.btn-primary:hover {
    background: rgba(6, 182, 212, 0.1);
    box-shadow: 0 0 16px rgba(6, 182, 212, 0.2);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    border-color: var(--glass-border);
    color: var(--text-muted);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.btn + .btn {
    margin-top: 12px;
}

/* Textarea */
.secret-input {
    width: 100%;
    min-height: 140px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    resize: vertical;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    line-height: 1.5;
}

.secret-input:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.25);
}

.secret-input:read-only {
    cursor: default;
    color: var(--text-secondary);
}

.secret-input::placeholder {
    color: var(--text-muted);
}

/* Code length row */
.code-length-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

/* Code boxes */
.code-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.code-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.code-hint-digit {
    color: var(--cyan);
}

.code-hint-letter {
    color: var(--text-primary);
}

.code-boxes {
    display: flex;
    gap: 8px;
}

.code-box {
    width: 42px;
    height: 50px;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 1.3rem;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    text-transform: uppercase;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.code-box.is-digit {
    color: var(--cyan);
}

.code-box:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.4);
}

/* Code controls (spinner + refresh) */
.code-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.length-spinner {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 4px;
}

.length-spinner button {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.length-spinner button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.length-spinner .length-value {
    width: 28px;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    color: var(--text-primary);
}

.refresh-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.refresh-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--cyan);
    border-color: var(--cyan);
}

/* Section label */
.label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

/* Result area (receive page) */
.result-area {
    position: relative;
    margin-top: 20px;
}

.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.copy-btn.copied {
    color: var(--cyan);
    border-color: var(--cyan);
}

/* Loading spinner */
.spinner-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 40px 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

/* TTL progress bar */
.ttl-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}

.ttl-bar {
    height: 100%;
    width: 100%;
    border-radius: 3px;
    transition: width 1.5s linear, background-color 1.5s linear;
}

.ttl-label {
    text-align: center;
    font-size: 0.8rem;
    font-family: 'Courier New', monospace;
    color: var(--text-muted);
    margin: 8px 0 16px;
    letter-spacing: 0.5px;
}

/* Success state */
.success-message {
    text-align: center;
    padding: 30px 0;
}

.success-message .icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.success-message p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Error text */
.error-text {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 8px;
    text-align: center;
}

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

.mb-20 {
    margin-bottom: 20px;
}

/* Back link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    margin-bottom: 20px;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: var(--text-primary);
}

/* Text input */
.text-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 12px;
}

.text-input:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.25);
}

.text-input:read-only {
    color: var(--text-muted);
    cursor: default;
}

/* Select input */
.select-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='%2394a3b8'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.select-input:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.25);
}

/* Field row (inline input + button) */
.field-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin-bottom: 4px;
}

.field-row .text-input {
    margin-bottom: 0;
}

.btn-inline {
    padding: 12px 16px;
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-inline:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}

/* Field hint */
.field-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 12px;
}

/* Field value (read-only display) */
.field-value {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

/* Success text */
.success-text {
    color: var(--cyan);
    font-size: 0.85rem;
    margin-top: 8px;
    text-align: center;
}

/* Recovery code display */
.recovery-code-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
}

.recovery-code-display code {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    color: var(--cyan);
    letter-spacing: 2px;
}

.recovery-code-display .copy-btn {
    position: static;
}

/* Topbar links */
.topbar-links {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s ease;
}

.topbar-link:hover {
    color: var(--text-primary);
}

.topbar-link-cta {
    color: var(--cyan);
}

.topbar-link-cta:hover {
    color: var(--text-primary);
}

/* Pitch section (purchase page) */
.pitch-price {
    text-align: center;
    margin-bottom: 28px;
}

.pitch-amount {
    display: block;
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 6px;
}

.pitch-once {
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.pitch-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

@media (max-width: 500px) {
    .pitch-columns {
        grid-template-columns: 1fr;
    }
}

.pitch-section {
    margin-bottom: 0;
}

.pitch-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.pitch-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pitch-list li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.4;
}

.pitch-check {
    color: var(--cyan);
    font-weight: 700;
    flex-shrink: 0;
}

.pitch-list-soon li {
    color: var(--text-muted);
}

.pitch-soon-dot {
    color: var(--violet);
    flex-shrink: 0;
}

.pitch-fine {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 12px;
}
