/* ── AItoWP — Global Styles ────────────────────────────────────────────── */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #334155;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --border: #334155;
    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;
    --radius: 12px;
    --radius-sm: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary-light);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ── Layout ──────────────────────────────────────────────────────────────── */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-sm {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Navbar ──────────────────────────────────────────────────────────────── */

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
}

.navbar .logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
}

.navbar .logo span {
    color: var(--primary);
}

.navbar nav {
    display: flex;
    gap: 16px;
    align-items: center;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    text-decoration: none;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary-light);
    text-decoration: none;
}

.btn-sm {
    padding: 6px 16px;
    font-size: 0.85rem;
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Forms ────────────────────────────────────────────────────────────────── */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

/* ── Cards ────────────────────────────────────────────────────────────────── */

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

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */

.hero {
    text-align: center;
    padding: 100px 0 60px;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -1px;
}

.hero h1 span {
    background: linear-gradient(135deg, var(--primary), #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 40px;
}

.hero-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── Steps ────────────────────────────────────────────────────────────────── */

.steps {
    padding: 80px 0;
}

.steps h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 60px;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.step {
    text-align: center;
    padding: 32px;
}

.step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    margin: 0 auto 16px;
}

.step h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.step p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ── Pricing ─────────────────────────────────────────────────────────────── */

.pricing {
    padding: 80px 0;
}

.pricing h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 16px;
}

.pricing .subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 48px;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 960px;
    margin: 0 auto;
}

.price-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    position: relative;
    transition: border-color 0.2s;
}

.price-card.featured {
    border-color: var(--primary);
}

.price-card.featured::before {
    content: "Most Popular";
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.price-card h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.price-card .price {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 16px 0;
}

.price-card .price small {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-muted);
}

.price-card .features {
    list-style: none;
    margin: 24px 0;
    text-align: left;
}

.price-card .features li {
    padding: 8px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.price-card .features li::before {
    content: "\2713";
    color: var(--success);
    margin-right: 8px;
    font-weight: 700;
}

/* ── Site list ───────────────────────────────────────────────────────────── */

.site-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.site-item .site-info h4 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.site-item .site-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.site-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.endpoint-url {
    background: var(--bg);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--primary-light);
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    border: 1px solid var(--border);
}

.endpoint-url:hover {
    border-color: var(--primary);
}

/* ── Badges ──────────────────────────────────────────────────────────────── */

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-free {
    background: rgba(100, 116, 139, 0.2);
    color: var(--text-muted);
}

.badge-pro {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-light);
}

.badge-agency {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
}

/* ── Referral section ────────────────────────────────────────────────────── */

.referral-link-box {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.referral-link-box input {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--primary-light);
    font-family: monospace;
    font-size: 0.9rem;
}

/* ── Modal ────────────────────────────────────────────────────────────────── */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    width: 90%;
    max-width: 500px;
}

.modal h3 {
    margin-bottom: 24px;
    font-size: 1.2rem;
}

/* ── Toast ────────────────────────────────────────────────────────────────── */

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 200;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    background: var(--success);
    color: white;
}

.toast-error {
    background: var(--error);
    color: white;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

.footer {
    text-align: center;
    padding: 40px 0;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.85rem;
}

/* ── Auth page ───────────────────────────────────────────────────────────── */

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 40px;
}

.auth-card h1 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.auth-card .subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.auth-card .switch-link {
    text-align: center;
    margin-top: 24px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.error-msg {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 16px;
    display: none;
}

/* ── Dashboard layout ────────────────────────────────────────────────────── */

.dashboard {
    padding: 40px 0;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.dashboard-header h1 {
    font-size: 1.8rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.dashboard-grid .card:first-child {
    grid-column: 1 / -1;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.2rem;
    }

    .steps-grid,
    .pricing-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .site-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .navbar nav {
        gap: 8px;
    }
}
