@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --purple:       #6366f1;
    --purple-light: #818cf8;
    --purple-bg:    #eef2ff;
    --green:        #22c55e;
    --green-bg:     #dcfce7;
    --text:         #111827;
    --text-muted:   #6b7280;
    --text-light:   #9ca3af;
    --surface:      #ffffff;
    --border:       #e5e7eb;
    --bg:           #f5f3ff;
    --radius:       16px;
    --shadow:       0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06);
    --shadow-hover: 0 8px 32px rgba(99,102,241,.15);
}

html { font-size: 16px; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: linear-gradient(160deg, #f0eeff 0%, #f8f7ff 40%, #eef6ff 100%);
    color: var(--text);
    min-height: 100vh;
}

/* ── Navbar ───────────────────────────────────────────────── */
.navbar {
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(229,231,235,.6);
    padding: 0 2.5rem;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Logo */
.navbar-brand {
    display: flex;
    align-items: center;
    gap: .5rem;
    text-decoration: none;
}

.navbar-logo-img {
    height: 32px;
    width: auto;
}

.navbar-logo-fallback {
    width: 32px; height: 32px;
    background: var(--purple);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 1rem;
}

.navbar-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.3px;
}

.navbar-name span { color: var(--purple); }

/* Nav links */
.navbar-menu {
    display: flex;
    align-items: center;
    gap: .25rem;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.navbar-link {
    padding: .4rem .875rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: .875rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: all .15s;
}

.navbar-link:hover, .navbar-link.active {
    color: var(--text);
    background: rgba(99,102,241,.08);
}

/* User area */
.navbar-user {
    display: flex;
    align-items: center;
    gap: .875rem;
}

.navbar-welcome {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: .35rem .875rem .35rem .5rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .8rem;
}

.navbar-welcome-emoji { font-size: .9rem; }

.navbar-welcome-text { color: var(--text-muted); }

.navbar-welcome-name {
    font-weight: 600;
    color: var(--purple);
}

.navbar-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple), var(--purple-light));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: .8rem;
    flex-shrink: 0;
}

.btn-logout {
    padding: .35rem .875rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    font-size: .8rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: none;
    transition: all .15s;
}

.btn-logout:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
    padding: 4rem 2rem 2.5rem;
    text-align: center;
    max-width: 680px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--text);
    letter-spacing: -.5px;
    margin-bottom: .875rem;
}

.hero h1 .c-purple { color: var(--purple); }
.hero h1 .c-green  { color: var(--green); }

.hero p {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.65;
    max-width: 480px;
    margin: 0 auto;
}

/* ── Cards Grid ───────────────────────────────────────────── */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    max-width: 860px;
    margin: 2.5rem auto 0;
    padding: 0 2rem;
}

.module-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    text-decoration: none;
    color: inherit;
    transition: all .2s;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: relative;
    overflow: hidden;
}

.module-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.module-card.core::before   { background: var(--purple); }
.module-card.capital::before { background: var(--green); }

.module-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: transparent;
}

/* Card header */
.card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.card-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem;
}

.module-card.core .card-icon    { background: var(--purple-bg); }
.module-card.capital .card-icon { background: var(--green-bg); }

.card-badge {
    font-size: .7rem;
    font-weight: 600;
    padding: .25rem .625rem;
    border-radius: 999px;
    letter-spacing: .2px;
}

.module-card.core .card-badge    { background: var(--purple-bg); color: var(--purple); }
.module-card.capital .card-badge { background: var(--green-bg);  color: #16a34a; }

/* Card body */
.card-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: .375rem;
}

.card-title span { color: var(--purple); }
.module-card.capital .card-title span { color: var(--green); }

.card-desc {
    font-size: .875rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Features list */
.card-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.card-features li {
    display: flex;
    align-items: center;
    gap: .625rem;
    font-size: .85rem;
    color: var(--text-muted);
}

.card-features li svg {
    flex-shrink: 0;
    width: 16px; height: 16px;
}

.module-card.core .card-features li svg    { color: var(--purple); }
.module-card.capital .card-features li svg { color: var(--green); }

/* Card CTA */
.card-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.card-cta-text {
    font-size: .875rem;
    font-weight: 600;
    text-decoration: none;
}

.module-card.core .card-cta-text    { color: var(--purple); }
.module-card.capital .card-cta-text { color: var(--green); }

.card-cta-btn {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: transform .15s;
}

.module-card.core .card-cta-btn    { background: var(--purple-bg); color: var(--purple); }
.module-card.capital .card-cta-btn { background: var(--green-bg);  color: var(--green); }

.module-card:hover .card-cta-btn { transform: translateX(3px); }

/* ── Features Bar ─────────────────────────────────────────── */
.features-bar {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    max-width: 860px;
    margin: 3rem auto 0;
    padding: 1.75rem 2rem;
    background: rgba(255,255,255,.7);
    border: 1px solid rgba(229,231,235,.8);
    border-radius: var(--radius);
    margin-left: 2rem;
    margin-right: 2rem;
}

@media (min-width: 900px) {
    .features-bar { margin-left: auto; margin-right: auto; }
}

.feature-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex: 1;
    min-width: 160px;
}

.feature-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: var(--purple-bg);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.feature-text strong {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text);
}

.feature-text span {
    font-size: .78rem;
    color: var(--text-muted);
}

/* ── Footer ───────────────────────────────────────────────── */
.hub-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    font-size: .78rem;
    margin-top: 2rem;
}

/* ── Login Page ───────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 40px rgba(99,102,241,.12);
    border: 1px solid rgba(229,231,235,.6);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo-img {
    height: 36px;
    width: auto;
    margin: 0 auto .75rem;
    display: block;
}

.login-logo-icon {
    width: 48px; height: 48px;
    background: var(--purple);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; font-weight: 800; color: #fff;
    margin: 0 auto .75rem;
}

.login-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.3px;
}

.login-logo h1 span { color: var(--purple); }

.login-logo p {
    font-size: .85rem;
    color: var(--text-muted);
    margin-top: .25rem;
}

.form-group { margin-bottom: 1.125rem; }

.form-label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: .375rem;
}

.form-input {
    width: 100%;
    padding: .7rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: .9rem;
    font-family: 'Inter', sans-serif;
    color: var(--text);
    background: #fafafa;
    outline: none;
    transition: all .15s;
}

.form-input:focus {
    border-color: var(--purple);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}

.btn-primary {
    width: 100%;
    padding: .8rem;
    background: var(--purple);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: .95rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all .15s;
    margin-top: .375rem;
}

.btn-primary:hover {
    background: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99,102,241,.35);
}

.alert {
    padding: .75rem 1rem;
    border-radius: 10px;
    font-size: .85rem;
    margin-bottom: 1.125rem;
}

.alert-error   { background: #fef2f2; border: 1px solid #fca5a5; color: #dc2626; }
.alert-success { background: #f0fdf4; border: 1px solid #86efac; color: #16a34a; }

.login-divider {
    text-align: center;
    margin: 1.25rem 0 1rem;
    font-size: .78rem;
    color: var(--text-light);
    position: relative;
}

.login-divider::before, .login-divider::after {
    content: '';
    position: absolute;
    top: 50%; width: 38%; height: 1px;
    background: var(--border);
}

.login-divider::before { left: 0; }
.login-divider::after  { right: 0; }

.login-modules {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .625rem;
}

.login-module-btn {
    padding: .6rem;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    text-align: center;
    text-decoration: none;
    font-size: .8rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: all .15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
}

.login-module-btn:hover {
    border-color: var(--purple);
    color: var(--purple);
    background: var(--purple-bg);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
    .navbar { padding: 0 1rem; }
    .navbar-menu { display: none; }
    .hero { padding: 2.5rem 1rem 1.5rem; }
    .hero h1 { font-size: 2rem; }
    .modules-grid { padding: 0 1rem; grid-template-columns: 1fr; }
    .features-bar { margin: 2rem 1rem 0; gap: 1.25rem; }
    .navbar-welcome-text { display: none; }
}
