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

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
}

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

.container { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }

/* Navbar */
.navbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar .container { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.25rem; font-weight: 700; color: var(--primary); text-decoration: none; }
.nav-links { display: flex; gap: 1.25rem; align-items: center; }
.nav-links a { text-decoration: none; color: var(--text-muted); font-size: 0.9rem; }
.nav-links a:hover { color: var(--primary); }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.75rem 2rem; font-size: 1.05rem; }
.btn-block { display: block; width: 100%; }

/* Hero */
.hero { text-align: center; padding: 4rem 0 3rem; }
.hero h1 { font-size: 2.5rem; margin-bottom: 1rem; }
.hero p { color: var(--text-muted); font-size: 1.1rem; max-width: 500px; margin: 0 auto 2rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; }

/* Features */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; padding: 2rem 0 4rem; }
.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
}
.feature-card h3 { margin-bottom: 0.5rem; color: var(--primary); }
.feature-card p { color: var(--text-muted); font-size: 0.9rem; }

/* Auth Form */
.auth-form {
    max-width: 400px;
    margin: 3rem auto;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 2rem;
}
.auth-form h2 { margin-bottom: 1.5rem; text-align: center; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.3rem; font-size: 0.85rem; font-weight: 500; }
.form-group input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.4rem;
    font-size: 0.9rem;
}
.form-group input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(79,70,229,0.15); }
.auth-link { text-align: center; margin-top: 1rem; font-size: 0.85rem; color: var(--text-muted); }
.auth-link a { color: var(--primary); }

/* Alerts */
.alert { padding: 0.75rem 1rem; border-radius: 0.5rem; margin-bottom: 1rem; font-size: 0.9rem; }
.alert-error { background: #fef2f2; color: var(--error); border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.alert-info { background: #eff6ff; color: var(--info); border: 1px solid #bfdbfe; }

/* Plans */
.section-title { text-align: center; margin: 2rem 0; }
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; padding-bottom: 3rem; }
.plan-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    position: relative;
}
.plan-featured { border-color: var(--primary); box-shadow: 0 4px 12px rgba(79,70,229,0.15); }
.plan-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    padding: 0.2rem 1rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}
.plan-card h3 { margin-bottom: 1rem; }
.plan-price { margin-bottom: 1.5rem; }
.plan-price .price { font-size: 2rem; font-weight: 700; color: var(--primary); }
.plan-price .period { color: var(--text-muted); font-size: 0.85rem; }
.plan-features { list-style: none; margin-bottom: 1.5rem; text-align: left; }
.plan-features li { padding: 0.4rem 0; font-size: 0.9rem; color: var(--text-muted); }
.plan-features li::before { content: "\2713 "; color: var(--success); font-weight: bold; margin-right: 0.3rem; }

/* Dashboard */
main { flex: 1; padding: 1.5rem 0; }
.sub-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.sub-active { border-left: 4px solid var(--success); }
.sub-pending { border-left: 4px solid var(--warning); }
.sub-expired { border-left: 4px solid var(--text-muted); }
.sub-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.status-badge { padding: 0.2rem 0.6rem; border-radius: 1rem; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }
.status-active { background: #f0fdf4; color: #16a34a; }
.status-pending { background: #fffbeb; color: #d97706; }
.status-expired { background: #f1f5f9; color: var(--text-muted); }
.sub-details { margin-bottom: 1rem; }
.detail-row { display: flex; justify-content: space-between; padding: 0.3rem 0; font-size: 0.9rem; }
.progress-bar { background: var(--border); border-radius: 0.25rem; height: 6px; margin-top: 0.5rem; }
.progress-fill { background: var(--primary); height: 100%; border-radius: 0.25rem; transition: width 0.3s; }
.sub-links { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.sub-links h4 { margin-bottom: 0.5rem; }
.link-hint { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.link-group { margin-bottom: 0.75rem; }
.link-group label { font-size: 0.8rem; font-weight: 600; display: block; margin-bottom: 0.25rem; }
.link-box { display: flex; gap: 0.5rem; }
.link-box input { flex: 1; padding: 0.4rem 0.6rem; border: 1px solid var(--border); border-radius: 0.4rem; font-size: 0.8rem; font-family: monospace; }
.pending-msg, .expired-msg { color: var(--text-muted); font-size: 0.9rem; padding: 0.5rem 0; }
.empty-state { text-align: center; padding: 3rem 0; color: var(--text-muted); }

/* Admin */
.admin-section { margin-bottom: 2rem; }
.admin-section h3 { margin-bottom: 1rem; }
.admin-table { width: 100%; border-collapse: collapse; background: var(--card-bg); border-radius: 0.5rem; overflow: hidden; border: 1px solid var(--border); }
.admin-table th, .admin-table td { padding: 0.6rem 0.75rem; text-align: left; font-size: 0.85rem; border-bottom: 1px solid var(--border); }
.admin-table th { background: #f8fafc; font-weight: 600; }
.uuid-cell { font-family: monospace; font-size: 0.8rem; }

/* Footer */
.footer { text-align: center; padding: 1.5rem 0; color: var(--text-muted); font-size: 0.8rem; border-top: 1px solid var(--border); margin-top: auto; }

@media (max-width: 640px) {
    .hero h1 { font-size: 1.75rem; }
    .hero-actions { flex-direction: column; align-items: center; }
    .nav-links { gap: 0.75rem; }
    .nav-links a { font-size: 0.8rem; }
    .admin-table { font-size: 0.75rem; }
}

/* Language switch */
.lang-switch {
    border: 1px solid rgba(255,255,255,0.4);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    text-decoration: none;
}
.lang-switch:hover {
    border-color: #fff;
    background: rgba(255,255,255,0.1);
}

/* Legal page */
.legal-page { max-width: 700px; margin: 2rem auto; }
.legal-table { width: 100%; border-collapse: collapse; margin-top: 1.5rem; }
.legal-table th, .legal-table td { padding: 0.75rem 1rem; border: 1px solid #ddd; text-align: left; }
.legal-table th { background: #f5f5f5; width: 30%; font-weight: 600; }
