@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

:root {
    --bg: #f0f4f8;
    --white: #ffffff;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --primary-border: #bfdbfe;
    --text: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.10);
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

/* ── Navbar ── */
.navbar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}
.nav-inner {
    max-width: 1060px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-brand {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.3px;
}
.nav-brand span { color: var(--primary); }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all .18s;
}
.nav-links a:hover { color: var(--text); background: var(--bg); }
.nav-badge {
    font-size: 12px;
    background: var(--primary-light);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    border: 1px solid var(--primary-border);
}
.btn-primary {
    background: var(--primary) !important;
    color: #fff !important;
    padding: 7px 16px !important;
    border-radius: var(--radius-sm) !important;
    font-weight: 600 !important;
}
.btn-primary:hover { background: var(--primary-dark) !important; color: #fff !important; }
.btn-logout { color: #ef4444 !important; }
.btn-logout:hover { background: #fef2f2 !important; color: #dc2626 !important; }

/* ── Main layout ── */
.main-content {
    max-width: 1060px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}

/* ── Cards ── */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
}
.card-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text);
    letter-spacing: -0.2px;
}

/* ── Forms ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
input, select, textarea {
    padding: 10px 13px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: #fafbfc;
    transition: all .18s;
    width: 100%;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
input::placeholder, textarea::placeholder { color: var(--text-light); }
textarea { resize: vertical; min-height: 85px; }
select { cursor: pointer; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all .18s;
    text-decoration: none;
    letter-spacing: -0.1px;
}
.btn-blue {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 1px 3px rgba(37,99,235,0.3);
}
.btn-blue:hover { background: var(--primary-dark); box-shadow: 0 3px 8px rgba(37,99,235,0.35); transform: translateY(-1px); }
.btn-blue:active { transform: translateY(0); }
.btn-outline {
    background: var(--white);
    color: var(--text);
    border: 1.5px solid var(--border-strong);
}
.btn-outline:hover { background: var(--bg); border-color: var(--primary); color: var(--primary); }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn-lg { padding: 13px 28px; font-size: 15px; border-radius: var(--radius); }

/* ── Alerts ── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid transparent;
}
.alert-error { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.alert-success { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.alert-info { background: var(--primary-light); color: #1d4ed8; border-color: var(--primary-border); }

/* ── Output box ── */
.output-box {
    background: #f8fafc;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    font-size: 13.5px;
    line-height: 2;
    white-space: pre-wrap;
    color: var(--text);
    font-family: 'Georgia', serif;
}

/* ── Page header ── */
.page-header { margin-bottom: 2rem; }
.page-header h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text);
}
.page-header p { font-size: 15px; color: var(--text-muted); margin-top: 5px; }

/* ── Table ── */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 1.5px solid var(--border);
    background: #fafbfc;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.table td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: #fafbfc; }

/* ── Badge ── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.badge-free { background: #f1f5f9; color: #64748b; }
.badge-basic { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.badge-pro { background: #faf5ff; color: #7c3aed; border: 1px solid #e9d5ff; }

/* ── Pricing ── */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.pricing-card {
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    text-align: center;
    transition: box-shadow .2s, transform .2s;
}
.pricing-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.pricing-card.featured {
    border-color: var(--primary);
    border-width: 2px;
    box-shadow: 0 0 0 4px rgba(37,99,235,0.08);
}
.pricing-name { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: .75rem; }
.pricing-price { font-size: 32px; font-weight: 800; color: var(--text); margin: .5rem 0; letter-spacing: -1px; }
.pricing-price span { font-size: 14px; font-weight: 500; color: var(--text-muted); letter-spacing: 0; }
.pricing-cases { font-size: 13px; color: var(--text-muted); margin-bottom: 1.5rem; background: var(--bg); padding: 5px 12px; border-radius: 20px; display: inline-block; }

/* ── Auth ── */
.auth-wrap { max-width: 420px; margin: 4rem auto; }
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo span { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.auth-logo span b { color: var(--primary); }

/* ── Hero (homepage) ── */
.hero {
    text-align: center;
    padding: 5rem 1rem 4rem;
}
.hero-badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid var(--primary-border);
    margin-bottom: 1.5rem;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.hero h1 {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1.15;
    margin-bottom: 1.25rem;
    color: var(--text);
}
.hero h1 span { color: var(--primary); }
.hero p {
    font-size: 17px;
    color: var(--text-muted);
    max-width: 480px;
    margin: 0 auto 2.5rem;
    line-height: 1.7;
}
.hero-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-top: 4rem; }
.feature-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    text-align: center;
    box-shadow: var(--shadow);
}
.feature-icon {
    width: 52px;
    height: 52px;
    background: var(--primary-light);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 22px;
}
.feature-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.feature-card p { font-size: 13.5px; color: var(--text-muted); line-height: 1.6; }

/* ── Spinner ── */
.spinner {
    display: inline-block;
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Footer ── */
.footer {
    text-align: center;
    padding: 2rem;
    font-size: 13px;
    color: var(--text-light);
    border-top: 1px solid var(--border);
    margin-top: 4rem;
}

/* ── Divider ── */
.divider { height: 1px; background: var(--border); margin: 1.5rem 0; }

/* ── Stats cards ── */
.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow);
}
.stat-value { font-size: 28px; font-weight: 800; color: var(--primary); letter-spacing: -1px; }
.stat-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 3px; }

@media (max-width: 680px) {
    .form-grid { grid-template-columns: 1fr; }
    .pricing-grid { grid-template-columns: 1fr; }
    .features-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 28px; }
    .nav-links a span { display: none; }
}
