:root {
    --bg: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --surface-hover: #f8fafc;
    --accent: #0f172a;
    --accent-hover: #1e293b;
    --error-bg: #fef2f2;
    --error-text: #991b1b;
    --error-border: #fecaca;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

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

.container.narrow {
    max-width: 640px;
}

/* ---------- Hero (landing) ---------- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.hero-inner {
    max-width: 560px;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin: 0 0 24px;
    letter-spacing: -0.025em;
    font-weight: 600;
}

.tagline {
    font-size: 1.125rem;
    color: var(--muted);
    margin-bottom: 40px;
}

.cta-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: 1px solid var(--accent);
    border-radius: 6px;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    font-family: inherit;
    line-height: 1.4;
}

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

.btn-secondary { background: transparent; color: var(--accent); }
.btn-secondary:hover { background: var(--surface-hover); }

.btn-block { width: 100%; }

.btn-link {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    padding: 0;
    text-decoration: underline;
}
.btn-link:hover { color: var(--text); }

.inline-form { display: inline; margin: 0; }

/* ---------- Pages ---------- */
.page { padding: 48px 0; }

.back-link {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 24px;
    display: inline-block;
}
.back-link:hover { color: var(--text); }

h1 {
    font-size: 2rem;
    margin: 0 0 24px;
    letter-spacing: -0.015em;
    font-weight: 600;
}

.email-link {
    color: var(--accent);
    font-size: 1.125rem;
}

/* ---------- Login ---------- */
.login-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 48px 24px;
}

.form { display: flex; flex-direction: column; gap: 16px; }
.form label { display: flex; flex-direction: column; gap: 6px; }
.form label span { font-size: 0.875rem; color: var(--muted); }

.form input {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
}
.form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

.form button { margin-top: 8px; }

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    border: 1px solid transparent;
}
.alert-error {
    background: var(--error-bg);
    color: var(--error-text);
    border-color: var(--error-border);
}

/* ---------- Hub ---------- */
.hub-header {
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    background: #fff;
}

.hub-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--muted);
}

.user-email { color: var(--text); }

.badge {
    background: var(--accent);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.app-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    background: #fff;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.app-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.app-card h3 { margin: 0; font-size: 1.125rem; font-weight: 600; }
.app-card p { margin: 0; color: var(--muted); font-size: 0.9rem; flex: 1; }

.app-link {
    color: var(--accent);
    font-size: 0.875rem;
    margin-top: 8px;
}

.muted { color: var(--muted); }

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
    .hero h1 { font-size: 2.25rem; }
    .cta-row { flex-direction: column; }
    .cta-row .btn { width: 100%; }
    .user-info { gap: 8px; font-size: 0.85rem; }
}
