/* ================================================================
   ILRC Mitgliedantrag – Custom Styles
   Breakpoints (Bootstrap 5):
     xs  < 576px   → kleines Smartphone
     sm  ≥ 576px   → großes Smartphone
     md  ≥ 768px   → kleines Tablet
     lg  ≥ 992px   → großes Tablet
     xl  ≥ 1200px  → Desktop normal
     xxl ≥ 1400px  → Desktop groß / Ultrawide
   ================================================================ */

/* ---- CSS-Variablen ------------------------------------------------ */
:root {
    --ilrc-green:       #5a8a00;
    --ilrc-green-light: #94D13A;
    --ilrc-dark:        #1a1a1a;
    --ilrc-bg:          #f0f3f7;
    --card-radius:      .6rem;
    --card-shadow:      0 2px 16px rgba(0,0,0,.09);
}

/* ---- Basis --------------------------------------------------------- */
html { scroll-behavior: smooth; }

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background-color: var(--ilrc-bg);
    font-size: 1rem;
    line-height: 1.55;
}

/* Seitenhintergrund auf sehr breiten Screens etwas strukturieren */
@media (min-width: 1600px) {
    body {
        background:
            radial-gradient(ellipse at 10% 20%, rgba(90,138,0,.07) 0%, transparent 60%),
            radial-gradient(ellipse at 90% 80%, rgba(90,138,0,.06) 0%, transparent 60%),
            var(--ilrc-bg);
    }
}

/* ---- Seiten-Container ---------------------------------------------- */
/* Zentriert, begrenzt auf 960 px; auf Smartphones volle Breite */
.ilrc-page {
    width: 100%;
    max-width: 960px;
    margin-inline: auto;
    padding: 1rem 0.75rem 2rem;
}

@media (min-width: 576px)  { .ilrc-page { padding-inline: 1rem; } }
@media (min-width: 768px)  { .ilrc-page { padding-block: 1.5rem 3rem;  padding-inline: 1.25rem; } }
@media (min-width: 992px)  { .ilrc-page { padding-block: 1.75rem 3.5rem; } }
@media (min-width: 1200px) { .ilrc-page { padding-block: 2rem 4rem; } }
@media (min-width: 1400px) { .ilrc-page { max-width: 1000px; } }

/* ================================================================
   HEADER
   ================================================================ */

.ilrc-header {
    border-radius: var(--card-radius) var(--card-radius) 0 0;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

/* ---- Bild-Bereich (weißer Hintergrund für die Bilder) ------------- */
.header-brand-row {
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 3px solid var(--ilrc-green);
}

/* Textblock zwischen Logo und Wappen (nur md+) */
.header-center {
    flex: 1;
    text-align: center;
    display: none; /* auf mobil ausgeblendet */
}
@media (min-width: 768px) {
    .header-center { display: block; }
}
.header-center h1 {
    font-size: clamp(1rem, 2vw, 1.35rem);
    font-weight: 800;
    color: var(--ilrc-dark);
    margin: 0 0 .15rem;
    letter-spacing: -.5px;
}
.header-center p {
    font-size: clamp(.7rem, 1.1vw, .85rem);
    color: var(--ilrc-green);
    font-weight: 600;
    margin: 0;
}

/* ---- Logo ---------------------------------------------------------- */
.header-logo-img {
    height: 60px;
    width: auto;
    object-fit: contain;
    display: block;
}

/* ---- Wappen -------------------------------------------------------- */
.header-wappen-img {
    height: 70px;
    width: auto;
    object-fit: contain;
    display: block;
}

/* Größen pro Breakpoint */
@media (min-width: 576px) {
    .header-logo-img  { height: 70px; }
    .header-wappen-img { height: 80px; }
}
@media (min-width: 768px) {
    .header-logo-img  { height: 78px; }
    .header-wappen-img { height: 90px; }
}
@media (min-width: 992px) {
    .header-logo-img  { height: 88px; }
    .header-wappen-img { height: 100px; }
}
@media (min-width: 1200px) {
    .header-logo-img  { height: 96px; }
    .header-wappen-img { height: 110px; }
}

/* Kleines Smartphone: Logo unter Wappen stapeln */
@media (max-width: 399px) {
    .header-brand-row {
        flex-direction: column;
        align-items: center;
        gap: 0.6rem;
        padding: 0.9rem 1rem;
    }
    .header-logo-img  { height: 48px; }
    .header-wappen-img { height: 56px; }
    /* Wappen zuerst (wie traditioneller Briefkopf) */
    .header-wappen-wrap { order: -1; }
}

/* ---- Adressleiste -------------------------------------------------- */
.header-address-bar {
    background: var(--ilrc-dark);
    color: rgba(255,255,255,.82);
    font-size: clamp(.72rem, 1.4vw, .82rem);
    text-align: center;
    padding: .45rem 1rem;
    line-height: 1.6;
}
.header-address-bar a {
    color: rgba(255,255,255,.7);
    text-decoration: none;
    transition: color .15s;
}
.header-address-bar a:hover { color: var(--ilrc-green-light); }

/* ================================================================
   FORM-CARD
   ================================================================ */

.form-card {
    background: #fff;
    border-radius: 0 0 var(--card-radius) var(--card-radius);
    box-shadow: var(--card-shadow);
}

.form-card .card-body {
    padding: 1.25rem;
}
@media (min-width: 576px)  { .form-card .card-body { padding: 1.75rem; } }
@media (min-width: 768px)  { .form-card .card-body { padding: 2rem 2.25rem; } }
@media (min-width: 992px)  { .form-card .card-body { padding: 2.1rem 2.4rem; } }
@media (min-width: 1200px) { .form-card .card-body { padding: 2.25rem 2.5rem; } }

/* ---- Abschnittsüberschriften --------------------------------------- */
.section-title {
    font-size: clamp(.9rem, 1.5vw, 1rem);
    font-weight: 700;
    border-bottom: 2px solid var(--ilrc-green);
    padding-bottom: .4rem;
    margin-bottom: 1.25rem;
    color: var(--ilrc-dark);
}

/* ---- Formular-Beschriftungen --------------------------------------- */
.form-label {
    font-size: .9rem;
    font-weight: 500;
    margin-bottom: .3rem;
}

/* Pflichtfeld-Sternchen */
.req { color: #dc3545; }

/* ---- Eingabefelder: Touch-freundliche Größe auf Smartphones -------- */
@media (max-width: 767px) {
    .form-control,
    .form-select {
        min-height: 44px;  /* iOS touch target */
        font-size: 1rem;   /* verhindert iOS-Zoom */
    }
    /* Kleine Buttons: Mindest-Touch-Target 40px */
    .btn-sm {
        min-height: 40px;
        padding-inline: .65rem;
    }
}

/* ---- Rechtlicher Hinweiskasten ------------------------------------ */
.alert-legal {
    background: #f6f8f2;
    border-left: 4px solid var(--ilrc-green);
    border-radius: .3rem;
    font-size: clamp(.88rem, 2vw, .95rem);
}

/* ---- Radio-/Checkbox-Karten --------------------------------------- */
.option-card {
    border: 1.5px solid #dee2e6;
    border-radius: .4rem;
    padding: .75rem 1rem;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.option-card:hover { border-color: var(--ilrc-green); background: #f4fae6; }
.option-card input[type="radio"] { cursor: pointer; }
.option-card input:checked + span,
.option-card input:checked ~ span { font-weight: 600; }

/* Größere Touch-Targets auf Smartphones */
@media (max-width: 767px) {
    .option-card { padding: .9rem 1rem; }
    .form-check-input { width: 1.2em; height: 1.2em; margin-top: .1em; }
}

/* ================================================================
   UNTERSCHRIFT-CANVAS
   ================================================================ */

.signature-wrapper {
    position: relative;
    border: 2px solid #ced4da;
    border-radius: .4rem;
    background: #fff;
    overflow: hidden;
    cursor: crosshair;
    touch-action: none;
    display: block;
    width: 100%;
}

/* Höhe nach Bildschirmgröße */
.signature-wrapper          { height: 130px; }  /* xs  < 576px  */
@media (min-width: 400px)   { .signature-wrapper { height: 150px; } }
@media (min-width: 576px)   { .signature-wrapper { height: 165px; } }  /* sm  */
@media (min-width: 768px)   { .signature-wrapper { height: 180px; } }  /* md  */
@media (min-width: 992px)   { .signature-wrapper { height: 185px; } }  /* lg  */
@media (min-width: 1200px)  { .signature-wrapper { height: 190px; } }  /* xl  */
@media (min-width: 1400px)  { .signature-wrapper { height: 200px; } }  /* xxl */

.signature-wrapper canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.sig-label {
    font-size: clamp(.78rem, 1.8vw, .82rem);
    color: #adb5bd;
    user-select: none;
    pointer-events: none;
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

.signature-wrapper.is-invalid { border-color: #dc3545; }

/* ================================================================
   ABSENDEBUTTON
   ================================================================ */

.btn-submit {
    background: var(--ilrc-green-light);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: .75rem 1.75rem;
    font-size: 1rem;
    border-radius: .4rem;
    transition: background .2s, transform .1s;
    white-space: normal; /* Zeilenumbruch auf schmalen Geräten */
    width: 100%;         /* auf xs volle Breite */
}

@media (min-width: 576px) {
    .btn-submit { width: auto; }
}
@media (min-width: 768px) {
    .btn-submit { font-size: 1.05rem; padding: .8rem 2rem; }
}

.btn-submit:hover    { background: var(--ilrc-green); color: #fff; }
.btn-submit:active   { transform: scale(.98); }
.btn-submit:disabled { background: #888; cursor: not-allowed; }

/* ================================================================
   LADE-OVERLAY
   ================================================================ */

#loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,.78);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
}
#loading-overlay.active { display: flex; }
#loading-overlay p {
    font-weight: 600;
    color: var(--ilrc-dark);
    margin: 0;
    font-size: 1.05rem;
}

/* ================================================================
   FOOTER
   ================================================================ */

.site-footer {
    font-size: clamp(.78rem, 1.3vw, .85rem);
    color: #6c757d;
    text-align: center;
    padding: 1.25rem .5rem 1rem;
    line-height: 1.8;
}
.site-footer a { color: #6c757d; }
.site-footer a:hover { color: var(--ilrc-green); }

/* ================================================================
   KLEINE HELFER
   ================================================================ */

/* Erziehungsberechtigten-Box */
.guardian-box {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: .4rem;
    padding: 1rem 1.25rem;
}

/* Responsive Trennlinie */
hr.section-sep {
    border-color: #dee2e6;
    margin-block: 2rem;
}

/* Honeypot – komplett aus dem Layout herausnehmen */
.hp-wrap {
    display: none !important;
}
