/* Design-System für die Teilnehmerseiten. Mobile-first, weil hier so gut wie
   niemand am Desktop sitzt — jede Seite wird per QR-Code auf dem Handy geöffnet. */

/* Selbst gehostet statt von einem Font-CDN geladen: bleibt auch bei
   schlechtem Schul-WLAN zuverlässig und schickt keine Daten an Dritte.
   Nur für den Code auf dem Post-it — bewusst kein generisches "cursive",
   das je nach Gerät kaum lesbar sein kann. Patrick Hand ist eine
   Handschrift-Schriftart, die gezielt auf gute Lesbarkeit setzt (SIL Open
   Font License, Patrick Wagesreiter). */
@font-face {
    font-family: "Patrick Hand";
    src: url("/fonts/PatrickHand-Regular.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --color-primary: #1e40af;
    --color-primary-hover: #1e3a8a;
    --color-primary-light: #eff6ff;
    --color-success: #16a34a;
    --color-success-hover: #15803d;
    --color-success-light: #f0fdf4;
    --color-danger: #dc2626;
    --color-danger-hover: #b91c1c;
    --color-warning: #b45309;
    --color-warning-light: #fffbeb;
    --color-warning-border: #fde68a;
    --color-text: #0f172a;
    --color-text-muted: #64748b;
    --color-border: #e2e8f0;
    --color-bg: #f1f5f9;
    --color-card: #ffffff;
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 28px rgba(15, 23, 42, 0.08);
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
}

/* Zentrierte Karte, max. 480px — bequem einhändig auf dem Handy zu bedienen. */
.page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 32px 16px;
}

.card {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 32px 24px;
    width: 100%;
    max-width: 440px;
    height: fit-content;
    text-align: center;
}

img.logo {
    max-width: 110px;
    height: auto;
    margin-bottom: 8px;
}

h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 12px 0 4px;
}

.subtitle {
    color: var(--color-text-muted);
    font-size: 15px;
    margin: 0 0 24px;
}

p {
    color: var(--color-text);
    font-size: 16px;
    line-height: 1.5;
    margin: 16px 0;
}

.hint-text {
    color: var(--color-text-muted);
    font-size: 14px;
}

/* Formulare */

form {
    margin-top: 8px;
    text-align: left;
}

label {
    display: block;
    color: var(--color-text);
    font-size: 14px;
    font-weight: 600;
    margin: 16px 0 6px;
}

input[type=text],
input[type=password] {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-family: inherit;
    background: var(--color-card);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type=text]:focus,
input[type=password]:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.member-field-hidden {
    display: none;
}

/* Knöpfe — gemeinsame Basis über .btn, individuelle Farbe über Modifier-Klasse.
   IDs bleiben zusätzlich stehen, weil JS (registerScript.js, questionScript.js)
   sie zum Ansteuern der Elemente braucht, nicht zum Stylen. */
.btn {
    display: inline-block;
    width: 100%;
    padding: 13px 20px;
    margin-top: 10px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.05s ease;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

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

.btn-success {
    background: var(--color-success);
    color: white;
}

.btn-success:hover {
    background: var(--color-success-hover);
}

.btn-warning {
    background: var(--color-warning-light);
    color: var(--color-warning);
    border: 1.5px solid var(--color-warning-border);
}

.btn-warning:hover {
    background: var(--color-warning-border);
}

.btn-secondary {
    background: var(--color-bg);
    color: var(--color-text);
    border: 1.5px solid var(--color-border);
}

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

.btn:disabled {
    background: var(--color-border);
    color: var(--color-text-muted);
    cursor: default;
    transform: none;
}

/* Der Timer auf der Postenseite — bewusst gross und monospace, damit sich die
   Ziffern beim Hochzählen nicht seitlich verschieben. */
#timer {
    font-size: 32px;
    font-weight: 700;
    font-family: "SF Mono", "Cascadia Code", Consolas, monospace;
    color: var(--color-primary);
    margin: 4px 0 20px;
}

.progress-label {
    color: var(--color-text-muted);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: -8px 0 20px;
}

.success-heading {
    color: var(--color-success);
}

.signed-in-as {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-top: 4px;
}

.signed-in-as a {
    color: var(--color-primary);
    text-decoration: none;
}

.signed-in-as a:hover {
    text-decoration: underline;
}

/* Der Tipp steht erst hier, wenn er angefordert (und bezahlt) wurde. */
#hint_label {
    background: var(--color-warning-light);
    border: 1px solid var(--color-warning-border);
    color: var(--color-warning);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 15px;
    text-align: left;
}

.result-message {
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 600;
    text-align: left;
}

.result-success {
    background: var(--color-success-light);
    color: var(--color-success-hover);
}

.result-error {
    background: #fef2f2;
    color: var(--color-danger-hover);
}

.links {
    font-size: 15px;
    margin-top: 24px;
}

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

.links a:hover {
    text-decoration: underline;
}

/* Der Anmeldecode — bewusst als Post-it inszeniert: leicht schief, wie
   hingeklebt, damit er als "das Ding, das ich mir merken muss" auffällt.
   Modern umgesetzt heisst hier: flache Farbe statt Papier-Gradient, weicher
   Schatten statt Rahmen — die Schräglage bleibt, das trägt den Wiedererkennungswert. */
.code-display {
    background: #fef3a4;
    border-radius: 3px 14px 3px 14px;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.08);
    padding: 22px 20px;
    margin: 28px auto;
    max-width: 220px;
    transform: rotate(-2deg);
}

.code-display p {
    font-family: "Patrick Hand", "Segoe Print", "Bradley Hand", cursive;
    font-size: 3.2em;
    font-weight: normal;
    letter-spacing: 0.06em;
    color: #78350f;
    margin: 0;
    line-height: 1;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    font-size: 15px;
}

th, td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

th {
    color: var(--color-text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
}

@media (max-width: 480px) {
    .page {
        padding: 16px 12px;
    }

    .card {
        padding: 28px 18px;
        border-radius: var(--radius-md);
    }
}
