/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #7c3aed;
    --primary-light: #a78bfa;
    --primary-dark: #5b21b6;
    --accent: #a855f7;
    --bg: #ffffff;
    --bg-card: #ffffff;
    --bg-muted: #f4f4f5;
    --bg-input: #fafafa;
    --fg: #18181b;
    --fg-muted: #71717a;
    --border: #d4d4d8;
    --border-light: #e4e4e7;
    --destructive: #ef4444;
    --destructive-light: #fef2f2;
    --success: #22c55e;
    --success-light: #f0fdf4;
    --gradient: linear-gradient(135deg, var(--primary), var(--accent));
    --radius: 0.75rem;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
}

html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--fg);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ===== UTILITIES ===== */
.container { max-width: 1280px; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 640px) { .container { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .container { padding: 0 2rem; } }

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-bg {
    background: var(--gradient);
    color: white;
}

.text-muted { color: var(--fg-muted); }
.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 768px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (min-width: 769px) and (max-width: 1023px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }
.mb-16 { margin-bottom: 4rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mt-12 { margin-top: 3rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.w-full { width: 100%; }
.max-w-md { max-width: 28rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.hidden { display: none; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.4;
}
.btn:hover { opacity: 0.9; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
    background: var(--gradient);
    color: white;
}
.btn-primary:hover { box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3); }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--fg);
}
.btn-outline:hover { background: var(--bg-muted); }

.btn-ghost {
    background: transparent;
    color: var(--fg-muted);
    border: none;
}
.btn-ghost:hover { color: var(--fg); background: var(--bg-muted); }

.btn-danger {
    background: var(--destructive);
    color: white;
}
.btn-danger:hover { background: #dc2626; }

.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.75rem 1.75rem; font-size: 1rem; }
.btn-icon { padding: 0.5rem; width: 2.25rem; height: 2.25rem; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 1.25rem; }
.form-label {
    display: block;
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.375rem;
    color: var(--fg);
}
.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    background: var(--bg);
    color: var(--fg);
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    height: 2.75rem;
}
.form-input::placeholder { color: var(--fg-muted); }
.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.form-checkbox {
    width: 1rem;
    height: 1rem;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-error {
    padding: 0.875rem 1rem;
    background: var(--destructive-light);
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    color: var(--destructive);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

.form-help {
    font-size: 0.75rem;
    color: var(--fg-muted);
    margin-top: 0.25rem;
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow-lg); }
.card-body { padding: 1.5rem; }

/* ===== MESSAGES / TOASTS ===== */
.messages {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.message {
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    max-width: 24rem;
}
.message-success { background: var(--success-light); color: #166534; border: 1px solid #bbf7d0; }
.message-error { background: var(--destructive-light); color: #991b1b; border: 1px solid #fecaca; }
.message-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ===== HEADER ===== */
.header {
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-card);
    position: sticky;
    top: 0;
    z-index: 50;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}
.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.logo-icon {
    background: var(--gradient);
    padding: 0.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.logo-icon svg { width: 1.5rem; height: 1.5rem; color: white; }
.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.nav-links { display: flex; align-items: center; gap: 1rem; }

/* ===== HERO ===== */
.hero { padding: 5rem 0 4rem; }
@media (min-width: 768px) { .hero { padding: 7rem 0 5rem; } }
.hero-grid {
    display: grid;
    gap: 3rem;
    align-items: center;
}
@media (min-width: 768px) { .hero-grid { grid-template-columns: 1fr 1fr; } }

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1rem;
}
.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}
@media (min-width: 768px) { .hero h1 { font-size: 3.75rem; } }
.hero-desc {
    font-size: 1.25rem;
    color: var(--fg-muted);
    line-height: 1.7;
    margin-bottom: 2rem;
}
.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
}
.hero-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}
.hero-stat-label { font-size: 0.875rem; color: var(--fg-muted); }

/* Hero visual */
.hero-visual { position: relative; }
.hero-visual-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(168,85,247,0.15));
    border-radius: 1.5rem;
    filter: blur(40px);
}
.hero-visual-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 1.5rem;
    padding: 2rem;
}
.hero-qr-preview {
    background: linear-gradient(135deg, rgba(124,58,237,0.08), rgba(168,85,247,0.08));
    border-radius: 0.75rem;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    margin-bottom: 1rem;
}
.hero-qr-preview svg { width: 5rem; height: 5rem; color: var(--primary); margin-bottom: 1rem; }
.hero-skeleton { display: flex; flex-direction: column; gap: 0.5rem; }
.hero-skeleton span {
    height: 0.75rem;
    background: var(--bg-muted);
    border-radius: 9999px;
}
.hero-skeleton span:nth-child(1) { width: 75%; }
.hero-skeleton span:nth-child(2) { width: 100%; }
.hero-skeleton span:nth-child(3) { width: 80%; }

/* ===== SECTIONS ===== */
.section { padding: 5rem 0; }
.section-alt {
    background: var(--bg-card);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}
.section-title {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 1rem;
}
.section-subtitle {
    font-size: 1.25rem;
    color: var(--fg-muted);
    max-width: 40rem;
    margin: 0 auto;
}

/* Feature cards */
.feature-card {
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: box-shadow 0.2s;
}
.feature-card:hover { box-shadow: var(--shadow-lg); }
.feature-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    background: rgba(124, 58, 237, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}
.feature-icon svg { width: 1.5rem; height: 1.5rem; color: var(--primary); }
.feature-card h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.5rem; }
.feature-card p { color: var(--fg-muted); font-size: 0.9375rem; }

/* Steps */
.step-number {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}
.step h3 { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.75rem; }
.step p { color: var(--fg-muted); }

/* Pricing */
.pricing-card {
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 2rem;
}
.pricing-card.featured {
    border: 2px solid var(--primary);
    position: relative;
}
.pricing-badge {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--gradient);
    color: white;
    padding: 0.25rem 1rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 600;
}
.pricing-name { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem; }
.pricing-desc { color: var(--fg-muted); margin-bottom: 1.5rem; }
.pricing-price { font-size: 2.5rem; font-weight: 800; margin-bottom: 1.5rem; }
.pricing-price span { font-size: 1.125rem; font-weight: 400; color: var(--fg-muted); }
.pricing-features { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }
.pricing-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9375rem;
}
.pricing-features .check { color: var(--primary); flex-shrink: 0; }

/* CTA */
.cta { padding: 5rem 0; text-align: center; }
.cta h2 { font-size: 2.25rem; font-weight: 800; margin-bottom: 1.5rem; }
.cta p { font-size: 1.25rem; color: var(--fg-muted); max-width: 40rem; margin: 0 auto 2rem; }

/* ===== FOOTER ===== */
.footer {
    border-top: 1px solid var(--border-light);
    background: var(--bg-card);
    padding: 3rem 0;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-brand p { font-size: 0.875rem; color: var(--fg-muted); margin-top: 1rem; }
.footer-col h4 { font-weight: 600; margin-bottom: 1rem; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.footer-col a { font-size: 0.875rem; color: var(--fg-muted); transition: color 0.2s; }
.footer-col a:hover { color: var(--fg); }
.footer-bottom {
    border-top: 1px solid var(--border-light);
    padding-top: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}
.footer-bottom p { font-size: 0.875rem; color: var(--fg-muted); }
.footer-bottom-links { display: flex; gap: 1.5rem; }
.footer-bottom-links a { font-size: 0.875rem; color: var(--fg-muted); transition: color 0.2s; }
.footer-bottom-links a:hover { color: var(--fg); }

/* ===== AUTH PAGES ===== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(124,58,237,0.08), transparent, rgba(168,85,247,0.08));
}
.auth-container { width: 100%; max-width: 28rem; }
.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-header h1 { font-size: 1.875rem; font-weight: 700; margin-bottom: 0.5rem; }
.auth-header p { color: var(--fg-muted); }
.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
}
.auth-divider {
    position: relative;
    padding: 0.75rem 0;
    text-align: center;
}
.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-light);
}
.auth-divider span {
    position: relative;
    background: var(--bg-card);
    padding: 0 0.75rem;
    font-size: 0.875rem;
    color: var(--fg-muted);
}
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--fg-muted);
}

/* ===== DASHBOARD ===== */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}
.dashboard-header h1 { font-size: 2.25rem; font-weight: 800; margin-bottom: 0.25rem; }
.dashboard-header p { color: var(--fg-muted); }

/* QR Card */
.qr-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.qr-card:hover { box-shadow: var(--shadow-lg); }
.qr-card-preview {
    background: linear-gradient(135deg, rgba(124,58,237,0.04), rgba(168,85,247,0.04));
    border-bottom: 1px solid var(--border-light);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
}
.qr-card-preview img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 0.5rem;
}
.qr-card-body { padding: 1.25rem; }
.qr-card-title { font-weight: 600; font-size: 1.0625rem; margin-bottom: 0.5rem; }
.qr-card-url {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.qr-card-url input {
    flex: 1;
    padding: 0.375rem 0.625rem;
    background: var(--bg-muted);
    border: 1px solid var(--border-light);
    border-radius: 0.375rem;
    font-size: 0.75rem;
    color: var(--fg-muted);
}
.qr-card-meta {
    font-size: 0.75rem;
    color: var(--fg-muted);
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
}
.qr-card-actions {
    display: flex;
    gap: 0.5rem;
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: var(--bg-card);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    text-align: center;
}
.empty-state-icon {
    width: 4rem;
    height: 4rem;
    background: rgba(124, 58, 237, 0.1);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}
.empty-state-icon svg { width: 2rem; height: 2rem; color: var(--primary); }
.empty-state h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.5rem; }
.empty-state p { color: var(--fg-muted); margin-bottom: 1.5rem; }

/* ===== QR FORM PAGE ===== */
.form-page {
    min-height: 100vh;
    background: var(--bg);
}
.form-page-inner {
    max-width: 36rem;
    margin: 0 auto;
    padding: 2rem 1rem;
}
.form-page-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}
.form-page-header {
    margin-bottom: 1.5rem;
}
.form-page-header h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.25rem; }
.form-page-header p { color: var(--fg-muted); font-size: 0.9375rem; }

/* ===== DELETE CONFIRM ===== */
.delete-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--bg);
}
.delete-card {
    max-width: 28rem;
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    text-align: center;
}
.delete-card h1 { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5rem; }
.delete-card p { color: var(--fg-muted); font-size: 0.9375rem; margin-bottom: 1.5rem; }

/* ===== SVG ICONS INLINE ===== */
.icon { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }
.icon-sm { width: 1rem; height: 1rem; }
.icon-lg { width: 1.5rem; height: 1.5rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    .hero h1 { font-size: 2.25rem; }
    .hero-grid { gap: 2rem; }
    .section-title { font-size: 1.75rem; }
    .hero-stats { grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
    .hero-stat-value { font-size: 1.25rem; }
    .footer-grid { grid-template-columns: 1fr; }
    .dashboard-header { flex-direction: column; align-items: flex-start; }
}
