/*
 * Nachmi Design-Theme fuer die neuen Seiten des SaaS-Betriebs (Landingpage, Registrierung,
 * Super-Admin-Bereich). Bestehende Seiten der Schul-App binden diese Datei nicht ein.
 *
 * Inhalt: Design-Tokens, Schriften (lokal, keine Anfrage an Dritte), Grundstile und
 * Komponenten mit Praefix "n-", damit es keine Kollision mit Bootstrap gibt.
 * Schriften: Inter und Nunito, SIL Open Font License 1.1 (siehe fonts/OFL-*.txt).
 */

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url(fonts/inter-latin-wght-normal.woff2) format('woff2-variations'),
         url(fonts/inter-latin-wght-normal.woff2) format('woff2');
}

@font-face {
    font-family: 'Nunito';
    font-style: normal;
    font-display: swap;
    font-weight: 200 1000;
    src: url(fonts/nunito-latin-wght-normal.woff2) format('woff2-variations'),
         url(fonts/nunito-latin-wght-normal.woff2) format('woff2');
}

/* ---------- Design-Tokens ---------- */

:root {
    --color-primary: #F29A4A;
    --color-primary-dark: #D9772B;
    --color-primary-light: #FDE7D3;
    --color-secondary: #1F4E5F;
    --color-secondary-light: #DCE8EC;
    --color-success: #7FA88B;
    --color-warning: #E2B23C;
    --color-danger: #C9533F;
    --color-bg: #FFF9F2;
    --color-surface: #FFFFFF;
    --color-text: #1F4E5F;
    --color-text-muted: #5B6B73;
    --color-focus: rgba(242, 154, 74, 0.4);

    --font-heading: 'Nunito', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-pill: 999px;

    --shadow-sm: 0 4px 16px rgba(31, 78, 95, 0.08);
    --shadow-md: 0 8px 24px rgba(31, 78, 95, 0.12);

    --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
    --space-6: 24px; --space-8: 32px; --space-12: 48px; --space-16: 64px;

    --control-height: 44px;
    --content-width: 1120px;
}

/* ---------- Grundstile ---------- */

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--color-secondary);
    margin: 0 0 var(--space-4);
}

h1 { font-size: 2.5rem; font-weight: 800; line-height: 1.2; }
h2 { font-size: 2rem; font-weight: 700; line-height: 1.25; }
h3 { font-size: 1.5rem; font-weight: 700; line-height: 1.3; }
h4 { font-size: 1.25rem; font-weight: 700; line-height: 1.35; }

p {
    margin: 0 0 var(--space-4);
}

a {
    color: var(--color-secondary);
    text-underline-offset: 3px;
}

:focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 2px;
}

img, svg {
    max-width: 100%;
}

.n-small { font-size: 0.875rem; line-height: 1.5; }
.n-muted { color: var(--color-text-muted); }
.n-label {
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.n-tabular { font-variant-numeric: tabular-nums; }

/* ---------- Layout ---------- */

.n-container {
    width: 100%;
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

@media (min-width: 640px) {
    .n-container { padding: 0 var(--space-6); }
}

/* ---------- Logo ---------- */

.n-logo {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-secondary);
    text-decoration: none;
}

.n-logo__mark {
    width: 40px;
    height: 40px;
    flex: none;
}

.n-logo__word {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

/* ---------- Buttons ---------- */

.n-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: var(--control-height);
    padding: 0 var(--space-6);
    border: 1.5px solid transparent;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, box-shadow .15s ease, border-color .15s ease;
}

/* Petrol auf Apricot: weisser Text waere unter 18 px fett zu kontrastarm */
.n-btn--primary {
    background: var(--color-primary);
    color: var(--color-secondary);
}
.n-btn--primary:hover { background: var(--color-primary-dark); }

.n-btn--secondary {
    background: transparent;
    border-color: var(--color-secondary);
    color: var(--color-secondary);
}
.n-btn--secondary:hover { background: var(--color-secondary-light); }

.n-btn--ghost {
    background: transparent;
    color: var(--color-secondary);
}
.n-btn--ghost:hover { background: var(--color-secondary-light); }

/* ---------- Karten ---------- */

.n-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: var(--space-6);
}

.n-card--hero {
    border-radius: var(--radius-lg);
}

/* ---------- Badges ---------- */

.n-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-pill);
    background: var(--color-primary-light);
    color: var(--color-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.n-badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.n-badge--success::before { background: var(--color-success); }
.n-badge--warning::before { background: var(--color-warning); }
.n-badge--danger::before { background: var(--color-danger); }
.n-badge--primary::before { background: var(--color-primary); }

/* ---------- Formulare ---------- */

.n-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.n-field > label {
    font-weight: 600;
}

.n-input {
    min-height: var(--control-height);
    padding: 0 var(--space-3);
    border: 1.5px solid var(--color-secondary-light);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
}

.n-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-focus);
}

/* ---------- Tabellen ---------- */

.n-table {
    width: 100%;
    border-collapse: collapse;
}

.n-table th {
    background: var(--color-secondary-light);
    text-align: left;
    font-weight: 600;
}

.n-table th, .n-table td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-secondary-light);
}
