/* mytesla.io — Developer-forward dark theme */

:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #111128;
    --bg-card: #161633;
    --bg-input: #1a1a3a;
    --text-primary: #e8e8f0;
    --text-secondary: #9898b0;
    --text-muted: #606080;
    --accent: #00d4ff;
    --accent-hover: #00b8e0;
    --accent-dim: rgba(0, 212, 255, 0.1);
    --danger: #ff4466;
    --danger-dim: rgba(255, 68, 102, 0.1);
    --success: #00cc88;
    --success-dim: rgba(0, 204, 136, 0.1);
    --warning: #ffaa00;
    --border: #252550;
    --radius: 8px;
    --radius-lg: 12px;
    --max-width: 800px;
    --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Nav --- */

nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 26, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
}

nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 24px;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.nav-links a:hover { color: var(--text-primary); }

/* --- Hero --- */

.hero {
    text-align: center;
    padding: 80px 0 48px;
}

.hero h1 {
    font-size: 42px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
}

.hero .subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.hero .subtitle strong {
    color: var(--accent);
}

.btn-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* --- Buttons --- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: #000;
}

.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

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

.btn-secondary:hover { border-color: var(--text-secondary); }

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-sm { padding: 8px 16px; font-size: 14px; }

/* --- Key Generator Section --- */

.keygen-section {
    padding: 64px 0;
}

.keygen-section h2 {
    text-align: center;
    font-size: 28px;
    margin-bottom: 32px;
}

.keygen-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
}

#generate-btn {
    font-size: 18px;
    padding: 16px 32px;
}

/* Progress */

.progress-container {
    margin: 24px 0;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-input);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), #7c3aed);
    transition: width 0.3s ease;
}

#progress-text {
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 14px;
}

/* Key Results */

.key-result { margin-top: 24px; text-align: left; }

.key-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

.key-card.private-key {
    border-color: var(--danger);
    background: var(--danger-dim);
}

.key-card h3 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.key-card.private-key h3 { color: var(--danger); }
.key-card.public-key h3 { color: var(--accent); }

.key-warning {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--danger);
    font-size: 13px;
    margin-bottom: 12px;
}

.key-pem {
    width: 100%;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.5;
    resize: none;
    min-height: 80px;
}

.key-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* --- Hosting CTA --- */

.hosting-cta {
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-top: 32px;
}

.hosting-cta h3 {
    font-size: 22px;
    margin-bottom: 8px;
}

.hosting-cta .price {
    color: var(--accent);
    font-size: 28px;
    font-weight: 800;
}

.hosting-cta .price-period {
    color: var(--text-secondary);
    font-size: 16px;
}

.name-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 20px 0 8px;
}

.name-prefix {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 14px;
}

.name-input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 14px;
}

.name-input:focus { outline: none; border-color: var(--accent); }

.name-status {
    font-size: 13px;
    margin-bottom: 16px;
    min-height: 20px;
}

.name-status.available { color: var(--success); }
.name-status.taken { color: var(--danger); }
.name-status.checking { color: var(--text-muted); }
.name-status.error { color: var(--warning); }

/* Plan Selector */

.plan-selector {
    display: flex;
    gap: 12px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.plan-option {
    flex: 1;
    min-width: 120px;
}

.plan-option input[type="radio"] { display: none; }

.plan-option label {
    display: block;
    padding: 16px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.plan-option input:checked + label {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.plan-option label:hover { border-color: var(--text-muted); }

.plan-name {
    font-weight: 600;
    font-size: 14px;
    display: block;
}

.plan-price {
    color: var(--accent);
    font-weight: 700;
    font-size: 18px;
    display: block;
    margin: 4px 0;
}

.plan-note {
    color: var(--text-muted);
    font-size: 12px;
    display: block;
}

.plan-badge {
    display: inline-block;
    background: var(--accent);
    color: #000;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

/* --- How It Works --- */

.how-it-works {
    padding: 64px 0;
}

.how-it-works h2 {
    text-align: center;
    font-size: 28px;
    margin-bottom: 40px;
}

.steps {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.step {
    flex: 1;
    min-width: 200px;
    text-align: center;
    padding: 24px;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--accent-dim);
    color: var(--accent);
    border-radius: 50%;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
}

.step h3 { font-size: 16px; margin-bottom: 8px; }
.step p { color: var(--text-secondary); font-size: 14px; }

/* --- Why Section --- */

.why-section {
    padding: 64px 0;
}

.why-section h2 {
    text-align: center;
    font-size: 28px;
    margin-bottom: 16px;
}

.why-section .lead {
    text-align: center;
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 32px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.why-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
}

.why-card h3 { font-size: 16px; margin-bottom: 8px; }
.why-card p { color: var(--text-secondary); font-size: 14px; }

.why-card code {
    background: var(--bg-input);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--accent);
}

/* --- Pricing Section --- */

.pricing-section {
    padding: 64px 0;
}

.pricing-section h2 {
    text-align: center;
    font-size: 28px;
    margin-bottom: 40px;
}

.pricing-cards {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.pricing-card {
    flex: 1;
    min-width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    position: relative;
}

.pricing-card.featured {
    border-color: var(--accent);
    transform: scale(1.02);
}

.pricing-card .badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #000;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 16px;
    border-radius: 20px;
}

.pricing-card h3 { font-size: 18px; margin-bottom: 8px; }

.pricing-card .price {
    font-size: 36px;
    font-weight: 800;
    color: var(--accent);
}

.pricing-card .period {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 16px;
    display: block;
}

.pricing-card ul {
    list-style: none;
    text-align: left;
    margin: 16px 0;
}

.pricing-card li {
    padding: 6px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.pricing-card li::before {
    content: '\2713';
    color: var(--success);
    margin-right: 8px;
}

/* --- FAQ --- */

.faq-section {
    padding: 64px 0;
}

.faq-section h2 {
    text-align: center;
    font-size: 28px;
    margin-bottom: 32px;
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    overflow: hidden;
}

.faq-question {
    padding: 16px 20px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.faq-question:hover { background: var(--bg-secondary); }

.faq-question::after {
    content: '+';
    font-size: 20px;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.faq-item.open .faq-question::after {
    content: '-';
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.open .faq-answer {
    max-height: 500px;
}

.faq-answer-inner {
    padding: 0 20px 16px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
}

/* --- Final CTA --- */

.final-cta {
    text-align: center;
    padding: 80px 0;
    border-top: 1px solid var(--border);
}

.final-cta h2 {
    font-size: 32px;
    margin-bottom: 16px;
}

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

/* --- Footer --- */

footer {
    padding: 32px 0;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

footer a:hover { color: var(--text-primary); }

/* --- Error --- */

.error-message {
    background: var(--danger-dim);
    border: 1px solid var(--danger);
    border-radius: var(--radius);
    padding: 12px 16px;
    color: var(--danger);
    margin: 16px 0;
    font-size: 14px;
}

/* --- Utilities --- */

.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }

/* --- Responsive --- */

@media (max-width: 640px) {
    .hero h1 { font-size: 28px; }
    .steps { flex-direction: column; }
    .pricing-cards { flex-direction: column; }
    .pricing-card.featured { transform: none; }
    .plan-selector { flex-direction: column; }
    .nav-links { gap: 16px; }
}
