/* ==========================================================================
   Innsbruck icemagic – Schulanmeldung
   Design-Tokens angelehnt an coupona.io (Inter, #4258ff, #2e333d, #ffb70f)
   ========================================================================== */

:root {
    --c-link: #4258ff;
    --c-link-dark: #2942ff;
    --c-link-soft: #f5f6ff;
    --c-link-border: #dfe3ff;

    --c-dark: #2e333d;
    --c-text: #404654;
    --c-text-weak: #6b7280;
    --c-text-strong: #2e333d;

    --c-bg: #f7f8fa;
    --c-surface: #ffffff;
    --c-border: #e5e7eb;
    --c-border-strong: #d6d9e0;
    --c-muted: #f3f4f6;

    --c-gold: #ffb70f;
    --c-gold-soft: #fffaf0;
    --c-gold-border: #ffe2a8;

    --c-success: #48c78e;
    --c-success-soft: #effaf3;
    --c-success-border: #b8ecd3;
    --c-danger: #f14668;
    --c-danger-soft: #feecf0;
    --c-danger-border: #ffc9d5;

    --radius: 6px;
    --radius-lg: 10px;
    --shadow-sm: 0 1px 2px rgba(46, 51, 61, .06);
    --shadow: 0 4px 16px rgba(46, 51, 61, .08);
    --shadow-lg: 0 12px 32px rgba(46, 51, 61, .12);

    --font: Inter, "SF Pro", "Segoe UI", Roboto, Oxygen, Ubuntu, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.55;
    color: var(--c-text);
    background: var(--c-bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { color: var(--c-text-strong); font-weight: 700; letter-spacing: -.01em; margin: 0; }
h1 { font-size: 2rem; line-height: 1.2; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }
a { color: var(--c-link); text-decoration: none; }
a:hover { text-decoration: underline; }

[x-cloak] { display: none !important; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.container--narrow { max-width: 760px; }

/* --- Kopfzeile ---------------------------------------------------------- */

.site-header {
    background: var(--c-dark);
    color: #fff;
    padding: 18px 0;
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-header__brand { display: flex; flex-direction: column; }
.site-header__title { font-size: 1.15rem; font-weight: 700; color: #fff; letter-spacing: -.02em; }
.site-header__sub { font-size: .8rem; font-weight: 600; color: var(--c-gold); letter-spacing: .02em; }
.site-header__meta { font-size: .85rem; color: #c9ccd4; }
.site-header__meta a { color: #fff; }

/* --- Hero --------------------------------------------------------------- */

.hero { background: linear-gradient(180deg, #fff 0%, var(--c-bg) 100%); border-bottom: 1px solid var(--c-border); padding: 40px 0 32px; }
.hero__eyebrow {
    display: inline-block; font-size: .75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .08em; color: var(--c-link); background: var(--c-link-soft);
    border: 1px solid var(--c-link-border); border-radius: 999px; padding: 4px 12px; margin-bottom: 14px;
}
.hero__lead { font-size: 1.05rem; max-width: 62ch; margin-top: 12px; color: var(--c-text); }
.hero__facts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.fact {
    display: inline-flex; align-items: center; gap: 8px; background: var(--c-surface);
    border: 1px solid var(--c-border); border-radius: var(--radius); padding: 8px 14px;
    font-size: .88rem; font-weight: 600; color: var(--c-text-strong); box-shadow: var(--shadow-sm);
}
.fact svg { width: 16px; height: 16px; color: var(--c-link); flex: none; }

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

main { padding: 32px 0 64px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
/* Seitenspalte über die volle Höhe, damit die Zusammenfassung beim Scrollen mitläuft */
.layout > aside { align-self: stretch; }
@media (max-width: 900px) { .layout { grid-template-columns: minmax(0, 1fr); } }

.card {
    background: var(--c-surface); border: 1px solid var(--c-border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 20px; }
.card__header { padding: 20px 24px 0; }
.card__body { padding: 20px 24px 24px; }
.card__title { display: flex; align-items: center; gap: 10px; }

.step-badge {
    flex: none; width: 26px; height: 26px; border-radius: 999px; background: var(--c-link);
    color: #fff; font-size: .8rem; font-weight: 700; display: inline-flex;
    align-items: center; justify-content: center;
}
.step-badge--done { background: var(--c-success); }
.step-badge--idle { background: var(--c-border-strong); color: #fff; }

.hint { font-size: .87rem; color: var(--c-text-weak); margin-top: 6px; }

/* --- Platzauswahl ------------------------------------------------------- */

.locations { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.location {
    text-align: left; background: var(--c-surface); border: 1.5px solid var(--c-border);
    border-radius: var(--radius-lg); padding: 16px 18px; cursor: pointer; font: inherit;
    color: inherit; transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
}
.location:hover { border-color: var(--c-border-strong); box-shadow: var(--shadow-sm); }
.location.is-active { border-color: var(--c-link); background: var(--c-link-soft); box-shadow: 0 0 0 3px rgba(66, 88, 255, .12); }
.location__name { display: block; font-weight: 700; color: var(--c-text-strong); font-size: 1.05rem; }
.location__addr { display: block; font-size: .85rem; color: var(--c-text-weak); margin-top: 2px; }
.location__cap { display: block; font-size: .82rem; color: var(--c-link); font-weight: 600; margin-top: 10px; }

/* --- Kalender ----------------------------------------------------------- */

/* Gruppengröße + Filter über dem Kalender */
.finder {
    display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px 24px; align-items: start;
    background: var(--c-link-soft); border: 1px solid var(--c-link-border);
    border-radius: var(--radius-lg); padding: 16px 18px; margin-bottom: 20px;
}
.finder .field__help { color: #5560b8; }
.finder__toggle { grid-column: 1 / -1; }
@media (max-width: 640px) { .finder { grid-template-columns: minmax(0, 1fr); } }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer;
    background: var(--c-surface); border: 1px solid var(--c-border-strong);
    color: var(--c-text); border-radius: 999px; padding: 8px 14px;
    transition: border-color .12s ease, background .12s ease, color .12s ease;
}
.chip:hover { border-color: var(--c-link); }
.chip.is-active { background: var(--c-link); border-color: var(--c-link); color: #f5f6ff; }

.calendar__nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.calendar__month { font-weight: 700; color: var(--c-text-strong); font-size: 1.05rem; }
.calendar__weeks { display: flex; flex-direction: column; gap: 10px; }

.day {
    display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 14px; align-items: start;
    border: 1px solid var(--c-border); border-radius: var(--radius-lg); padding: 14px; background: var(--c-surface);
}
.day.is-blocked { background: var(--c-muted); border-style: dashed; align-items: center; }
.day__date { display: flex; align-items: baseline; gap: 8px; padding-top: 6px; }
.day.is-blocked .day__date { padding-top: 0; }
.day__weekday { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--c-text-weak); }
.day__number { font-size: 1.2rem; font-weight: 700; color: var(--c-text-strong); line-height: 1; font-variant-numeric: tabular-nums; }
.day__blocked { font-size: .85rem; color: var(--c-text-weak); font-style: italic; }

/* Eine Zeile je Stunde, darin die Plätze nebeneinander */
.hours { display: flex; flex-direction: column; gap: 8px; }
.hour { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 12px; align-items: center; }
.hour__time { font-weight: 700; font-size: .88rem; color: var(--c-text-strong); font-variant-numeric: tabular-nums; }
.hour__options { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 8px; }

.place {
    display: flex; align-items: center; gap: 10px; text-align: left; font: inherit; cursor: pointer;
    background: var(--c-surface); border: 1.5px solid var(--c-border); border-radius: var(--radius);
    padding: 7px 10px; transition: border-color .12s ease, background .12s ease, box-shadow .12s ease;
}
.place:hover:not(:disabled) { border-color: var(--c-link); box-shadow: var(--shadow-sm); }
.place.is-active { border-color: var(--c-link); background: var(--c-link-soft); box-shadow: 0 0 0 3px rgba(66, 88, 255, .12); }
.place:disabled { cursor: not-allowed; background: var(--c-muted); border-color: var(--c-border); }

.place__free {
    flex: none; min-width: 42px; height: 38px; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1rem; font-variant-numeric: tabular-nums;
}
.place__body { display: flex; flex-direction: column; min-width: 0; }
.place__name { font-weight: 600; font-size: .9rem; color: var(--c-text-strong); }
.place__caption { font-size: .77rem; color: var(--c-text-weak); }

.place--free .place__free { background: var(--c-success-soft); color: #196b45; border: 1px solid var(--c-success-border); }
.place--free .place__caption { color: #196b45; font-weight: 600; }
.place--tight .place__free { background: var(--c-gold-soft); color: #7a5300; border: 1px solid var(--c-gold-border); }
.place--tight .place__caption { color: #a06b00; font-weight: 600; }
.place--blocked .place__free { background: var(--c-muted); color: var(--c-text-weak); border: 1px solid var(--c-border); }
.place--blocked .place__name { color: var(--c-text-weak); }

@media (max-width: 620px) {
    .day { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .day__date { padding-top: 0; }
    .hour { grid-template-columns: minmax(0, 1fr); gap: 6px; }
    .hour__time {
        font-size: .8rem; text-transform: uppercase; letter-spacing: .05em;
        color: var(--c-text-weak); padding-top: 6px;
    }
    .hour + .hour { border-top: 1px solid var(--c-border); padding-top: 4px; }
    .calendar__nav { flex-wrap: wrap; }
    .calendar__month { order: -1; width: 100%; text-align: center; }
    .calendar__nav .btn { flex: 1 1 0; }
    .card__header, .card__body { padding-left: 16px; padding-right: 16px; }
}

.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .82rem; color: var(--c-text-weak); margin-top: 16px; }
.legend__item { display: inline-flex; align-items: center; gap: 6px; }
.legend__dot { width: 10px; height: 10px; border-radius: 3px; }

/* --- Formular ----------------------------------------------------------- */

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid > .field--full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }

.field label, .label { display: block; font-size: .85rem; font-weight: 600; color: var(--c-text-strong); margin-bottom: 5px; }
.field .req { color: var(--c-danger); }

.input, .textarea, .select select {
    width: 100%; font: inherit; color: var(--c-text); background: var(--c-surface);
    border: 1px solid var(--c-border-strong); border-radius: var(--radius);
    padding: 9px 12px; transition: border-color .12s ease, box-shadow .12s ease;
}
.input:focus, .textarea:focus, .select select:focus {
    outline: none; border-color: var(--c-link); box-shadow: 0 0 0 3px rgba(66, 88, 255, .12);
}
.input.is-invalid, .textarea.is-invalid { border-color: var(--c-danger); box-shadow: 0 0 0 3px rgba(241, 70, 104, .1); }
.textarea { min-height: 96px; resize: vertical; }
.field__error { font-size: .82rem; color: var(--c-danger); margin-top: 5px; font-weight: 500; }
.field__help { font-size: .8rem; color: var(--c-text-weak); margin-top: 5px; }

.checkbox { display: flex; align-items: flex-start; gap: 10px; font-size: .9rem; }
.checkbox input { margin-top: 4px; width: 16px; height: 16px; accent-color: var(--c-link); flex: none; }

.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

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

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font: inherit; font-weight: 600; cursor: pointer; border-radius: var(--radius);
    padding: 10px 18px; border: 1px solid transparent; transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.btn--primary { background: var(--c-link); color: #f5f6ff; }
.btn--primary:hover:not(:disabled) { background: var(--c-link-dark); text-decoration: none; }
.btn--light { background: var(--c-muted); color: var(--c-text-strong); }
.btn--light:hover:not(:disabled) { background: #e8eaee; text-decoration: none; }
.btn--ghost { background: transparent; color: var(--c-link); border-color: var(--c-border-strong); }
.btn--ghost:hover:not(:disabled) { border-color: var(--c-link); text-decoration: none; }
.btn--sm { padding: 6px 12px; font-size: .85rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--block { width: 100%; }

.btn .spinner {
    width: 15px; height: 15px; border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff; border-radius: 999px; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Zusammenfassung ---------------------------------------------------- */

.summary { position: sticky; top: 20px; }
.summary__row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--c-border); font-size: .9rem; }
.summary__row:last-child { border-bottom: none; }
.summary__label { color: var(--c-text-weak); }
.summary__value { font-weight: 600; color: var(--c-text-strong); text-align: right; }
.summary__empty { color: var(--c-text-weak); font-size: .9rem; }

/* --- Meldungen ---------------------------------------------------------- */

.notice { border-radius: var(--radius); padding: 13px 16px; font-size: .9rem; border: 1px solid transparent; }
.notice--error { background: var(--c-danger-soft); border-color: var(--c-danger-border); color: #8b1c36; }
.notice--success { background: var(--c-success-soft); border-color: var(--c-success-border); color: #196b45; }
.notice--info { background: var(--c-link-soft); border-color: var(--c-link-border); color: #2b3ba8; }
.notice--warning { background: var(--c-gold-soft); border-color: var(--c-gold-border); color: #7a5300; }
.notice + .notice, .notice + .form-grid, .notice + .locations { margin-top: 16px; }

.loading { display: flex; align-items: center; gap: 10px; color: var(--c-text-weak); font-size: .9rem; padding: 12px 0; }
.loading .spinner { border-color: var(--c-border-strong); border-top-color: var(--c-link); }

/* --- Erfolgsansicht ----------------------------------------------------- */

.success__icon {
    width: 56px; height: 56px; border-radius: 999px; background: var(--c-success-soft);
    border: 1px solid var(--c-success-border); display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.success__icon svg { width: 28px; height: 28px; color: var(--c-success); }
.reference {
    display: inline-block; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 1.15rem; font-weight: 700; letter-spacing: .06em; color: var(--c-text-strong);
    background: var(--c-muted); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 8px 14px;
}
.detail-list { margin: 0; padding: 0; list-style: none; }
.detail-list li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--c-border); font-size: .93rem; }
.detail-list li:last-child { border-bottom: none; }
.detail-list dt, .detail-list .k { color: var(--c-text-weak); }
.detail-list .v { font-weight: 600; color: var(--c-text-strong); text-align: right; }

/* --- Fußzeile ----------------------------------------------------------- */

.site-footer { border-top: 1px solid var(--c-border); background: var(--c-surface); padding: 24px 0; font-size: .85rem; color: var(--c-text-weak); }
.site-footer__inner { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }

/* --- Utilities ---------------------------------------------------------- */

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.text-weak { color: var(--c-text-weak); }
.text-sm { font-size: .87rem; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

/* --- Personenzählung im Formular ---------------------------------------- */

.headcount {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px;
    font-size: .88rem; padding: 10px 14px; border-radius: var(--radius);
    background: var(--c-success-soft); border: 1px solid var(--c-success-border); color: #196b45;
}
.headcount strong { font-size: 1rem; }
.headcount--over { background: var(--c-danger-soft); border-color: var(--c-danger-border); color: #8b1c36; }

/* --- Schlittschuh-Hinweis ------------------------------------------------ */

.skates {
    font-size: .87rem; line-height: 1.5; padding: 12px 14px; border-radius: var(--radius);
    background: var(--c-gold-soft); border: 1px solid var(--c-gold-border); color: #5c4000;
}
.skates strong { display: block; color: var(--c-text-strong); margin-bottom: 2px; }
.skates p { margin: 0; }
