/* Shared shell for the `main` and `portal` layouts.
 * Design tokens + chrome (reset, body, header, language switch, alerts,
 * footer) that were previously duplicated in main.css and portal.css.
 * The `landing` layout has its own palette and is intentionally NOT based
 * on this file. Each layout links base.css first, then its own overrides.
 *
 * Token set is the portal superset; main only consumes a subset (the extra
 * tokens are harmless when unused). */
:root {
    --primary: #1e3a8a;
    --primary-dark: #1e2a6a;
    --primary-soft: #eef2ff;
    --text: #1f2937;
    --muted: #6b7280;
    --bg: #f3f4f6;
    --card: #ffffff;
    --border: #e5e7eb;
    --success: #047857;
    --success-bg: #d1fae5;
    --warning: #b45309;
    --warning-bg: #fef3c7;
    --error: #b91c1c;
    --error-bg: #fee2e2;
    --info: #1d4ed8;
    --info-bg: #dbeafe;
    --locked: #9ca3af;
    --locked-bg: #f3f4f6;
}
* { box-sizing: border-box; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: var(--primary);
    color: #fff;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px 16px;
    flex-wrap: wrap;
}
header a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
}
header a:hover { text-decoration: underline; }
header .brand { font-weight: 700; font-size: 18px; }
header .brand small { display: block; font-weight: 400; font-size: 12px; opacity: 0.85; }
header nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.lang-switch {
    display: inline-flex;
    background: rgba(255,255,255,0.12);
    border-radius: 999px;
    padding: 3px;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}
.lang-switch a {
    margin: 0;
    padding: 5px 12px;
    border-radius: 999px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    letter-spacing: 0.5px;
}
.lang-switch a.active { background: #fff; color: var(--primary); }
.lang-switch a:hover:not(.active) { color: #fff; text-decoration: none; }

.alert {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    border: 1px solid transparent;
}
.alert-success { background: var(--success-bg); color: var(--success); border-color: var(--success); }
.alert-error   { background: var(--error-bg);   color: var(--error);   border-color: var(--error); }
.alert-info    { background: var(--info-bg);    color: var(--info);    border-color: rgba(29,78,216,0.4); }

footer {
    text-align: center;
    padding: 16px;
    font-size: 12px;
    color: var(--muted);
}

/* --- Mobile (shared header chrome for the main + portal layouts) ---------
   On narrow screens the brand and nav each take their own full-width row so
   the sign-in / register links and the EN/FR switch never collide or wrap
   into a broken pile. */
@media (max-width: 600px) {
    header {
        padding: 12px 16px;
        gap: 10px 14px;
    }
    header .brand { flex: 1 1 100%; font-size: 16px; }
    header nav {
        width: 100%;
        gap: 12px 14px;
        row-gap: 10px;
    }
    /* Push the language switch to the end of the nav row. */
    header nav .lang-switch { margin-left: auto; }
}
