/* ==========================================================================
   1. RESET & BASIS-STYLING (Mobile-First)
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent; /* Verhindert hässlichen blauen Rahmen beim Tippen auf iOS */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #0f172a; /* Dunkler Kino-Hintergrund */
    color: #f8fafc;
    line-height: 1.5;
    padding: 12px 8px; /* Sehr schmaler Rand auf Smartphones */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ==========================================================================
   2. CONTAINER (Für Handys optimiert, wächst auf Desktop)
   ========================================================================== */
.container {
    background-color: #1e293b;
    width: 100%;
    max-width: 600px; /* Begrenzung für Desktop */
    margin: 0 auto;
    padding: 18px 14px; /* Kompakt auf Mobilgeräten */
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border: 1px solid #334155;
}

h1 {
    font-size: 1.4rem; /* Leicht kleiner auf Handys für einzeilige Darstellung */
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
    color: #fff;
    border-bottom: 2px solid #ffe81f;
    padding-bottom: 12px;
}

/* ==========================================================================
   3. FORMULAR-ELEMENTE (Große Touch-Targets für Finger)
   ========================================================================== */
form {
    display: flex;
    flex-direction: column;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    margin-top: 14px;
    color: #cbd5e1;
    font-size: 0.9rem;
}

/* Inputs & Dropdowns optimiert für Touch (44px+ Höhe) */
input[type="text"],
input[type="email"],
input[type="password"],
select {
    width: 100%;
    height: 46px; /* Perfekte Höhe für Daumen-Eingabe */
    padding: 0 12px;
    font-size: 16px; /* WICHTIG: Genau 16px verhindert das automatische Hineinzoomen bei iPhones! */
    background-color: #0f172a;
    border: 1px solid #475569;
    border-radius: 6px;
    color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    appearance: none; /* Entfernt Standard-Styles von iOS/Android */
}

/* Kleiner Pfeil für das Select-Feld, da 'appearance: none' ihn entfernt */
select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

input:focus,
select:focus {
    border-color: #ffe81f;
    box-shadow: 0 0 0 3px rgba(255, 232, 31, 0.25);
}

::placeholder {
    color: #64748b;
}

/* Dynamische Begleiter-Boxen */
.begleiter-box {
    background-color: #273549;
    padding: 12px;
    margin-top: 12px;
    border-radius: 6px;
    border-left: 4px solid #ffe81f;
}

/* ==========================================================================
   4. BUTTONS & LINKS
   ========================================================================== */
.btn {
    display: block;
    width: 100%;
    min-height: 48px; /* Schöne, große Touch-Fläche */
    background-color: #ffe81f;
    color: #000;
    font-size: 1rem;
    font-weight: 700;
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 20px;
    transition: background-color 0.2s;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.btn:active {
    background-color: #e5cf1c;
}

a.mail {
    color: #ffe81f;
    text-decoration: none;
    font-weight: 600;
    word-break: break-all; /* Verhindert, dass lange E-Mail-Adressen das Layout sprengen */
}

/* ==========================================================================
   5. STATUS- UND PHP-MESSAGEBOXEN
   ========================================================================== */
.message-box {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    border-left: 4px solid transparent;
    word-break: break-word;
}

.message-box.success {
    background-color: rgba(16, 185, 129, 0.12);
    border-color: #10b981;
    color: #a7f3d0;
}

.message-box.error {
    background-color: rgba(239, 68, 68, 0.12);
    border-color: #ef4444;
    color: #fca5a5;
}

.message-box.warning {
    background-color: rgba(245, 158, 11, 0.12);
    border-color: #f59e0b;
    color: #fde68a;
}

/* Code-Tags & Live-Prüfungs-Elemente */
code {
    background-color: rgba(0, 0, 0, 0.4);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85rem;
    color: #f43f5e;
    display: inline-block;
    max-width: 100%;
    overflow-x: auto;
    vertical-align: middle;
}

/* ==========================================================================
   6. UPGRADE FÜR GRÖSSERE MONITOR-AUFLÖSUNGEN (Tablets & PC)
   ========================================================================== */
@media (min-width: 481px) {
    body {
        padding: 24px;
    }

    .container {
        padding: 30px;
        border-radius: 12px;
    }

    h1 {
        font-size: 1.75rem;
        margin-bottom: 25px;
    }

    label {
        font-size: 0.95rem;
        margin-top: 16px;
    }

    .message-box {
        font-size: 0.95rem;
        padding: 15px 20px;
    }
}