/* ============================================================
   selbst.lehrerland.de — Schueler-UI fuer Selbsteinschaetzung
   Performance-optimiert: keine Endlos-Animationen,
   kein backdrop-filter, kein background-attachment: fixed.
============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary:           #27408B;
    --primary-dark:      #1d2f6b;
    --primary-soft:      rgba(39, 64, 139, 0.10);

    --text-primary:      #1f2937;
    --text-secondary:    #4a5568;
    --text-light:        #718096;

    --pastel-yellow:     #fef9e7;
    --pastel-yellow-dk:  #fef3c7;
    --pastel-border:     #f3e8b6;

    --warn-bg:           #fff7ed;
    --warn-border:       #fed7aa;
    --error-bg:          #fef2f2;
    --error-border:      #fca5a5;
    --info-bg:           #eff6ff;
    --info-border:       #bfdbfe;

    --shadow-sm:         0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:         0 4px 14px rgba(0,0,0,0.08);
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.55;
    color: var(--text-primary);
    /* Bild bitte komprimiert halten (Ziel < 200 KB, z.B. WebP).
       background-attachment: fixed nur fuer Desktop — iOS Safari
       handhabt 'fixed' notorisch laggy, daher Override unten. */
    background-color: #eef2f8;
    background-image: url('images/background01.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Touch-Geraete + kleine Screens: 'fixed' wieder aus, sonst Scroll-Lag */
@media (hover: none), (max-width: 1024px) {
    body {
        background-attachment: scroll;
    }
}

/* ============================================================
   CONTAINER
============================================================ */
.container {
    max-width: 1000px;
    width: 95%;
    margin: 24px auto;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e4eaf2;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    /* KEIN backdrop-filter, KEINE Animation */
}

/* ============================================================
   HEADER
============================================================ */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    padding: 36px 32px;
    text-align: center;
}

.header h1 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.header p {
    font-size: 16px;
    opacity: 0.92;
    font-weight: 400;
}

/* ============================================================
   LOGIN FORM
============================================================ */
.login-form {
    padding: 32px;
    max-width: 520px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 15px;
}

.form-control {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--pastel-border);
    border-radius: 12px;
    font-size: 22px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 4px;
    font-weight: 700;
    background: var(--pastel-yellow);
    color: var(--text-primary);
    transition: border-color 0.15s ease, background 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.form-control::placeholder {
    color: var(--text-light);
    font-weight: 600;
    letter-spacing: 3px;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--pastel-yellow-dk);
}

.form-hint {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
}

/* ============================================================
   BUTTONS
============================================================ */
.btn-primary {
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background 0.15s ease;
    box-shadow: 0 2px 8px rgba(39, 64, 139, 0.15);
}

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

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================================
   MELDUNGEN
============================================================ */
.error-message,
.warning-message,
.info-message {
    padding: 14px 18px;
    border-radius: 10px;
    margin: 16px 32px;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 4px solid;
    background: #fff;
}

.error-message { background: var(--error-bg); border-color: #dc2626; color: #b91c1c; }
.warning-message { background: var(--warn-bg); border-color: #d97706; color: #92400e; }
.info-message { background: var(--info-bg); border-color: #3182ce; color: #1d4ed8; }

.error-message::before { content: '⚠️'; font-size: 18px; }
.warning-message::before { content: '⚡'; font-size: 18px; }
.info-message::before { content: 'ℹ️'; font-size: 18px; }

/* ============================================================
   SUCCESS / DANKESCHOEN
============================================================ */
.success-message {
    background: #ffffff;
    padding: 56px 32px;
    text-align: center;
    border-radius: 12px;
    margin: 24px;
    border: 1px solid #e4eaf2;
}

.success-message h2 {
    color: var(--primary);
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 16px;
}

.success-message p {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.7;
}

/* ============================================================
   STUDENT INFO
============================================================ */
.student-info {
    background: var(--pastel-yellow);
    padding: 20px 24px;
    border-bottom: 1px solid var(--pastel-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.student-info h3 {
    color: var(--text-primary);
    margin-bottom: 6px;
    font-size: 18px;
    font-weight: 700;
}

.student-info p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 4px;
}

/* ============================================================
   ANLEITUNG / INSTRUCTIONS
============================================================ */
.instructions {
    background: #ffffff;
    border: 1px solid #e4eaf2;
    border-radius: 12px;
    padding: 24px;
    margin: 24px;
    box-shadow: var(--shadow-sm);
}

.instructions h3 {
    color: var(--primary);
    margin-bottom: 12px;
    font-size: 18px;
    font-weight: 700;
}

.instructions p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 14px;
    margin-bottom: 16px;
}

.rating-scale {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-top: 16px;
    background: var(--pastel-yellow);
    border-radius: 10px;
    padding: 16px;
}

.scale-item {
    text-align: center;
    padding: 10px 6px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.7);
}

.scale-item .star {
    font-size: 18px;
    display: block;
    margin-bottom: 4px;
}

.scale-item p {
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 600;
}

/* ============================================================
   KATEGORIEN
============================================================ */
.category {
    margin: 0 24px 20px;
    padding: 20px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e4eaf2;
    box-shadow: var(--shadow-sm);
    /* KEINE Entrance-Animation, kein staggered fade-in */
}

.category-header {
    background: var(--pastel-yellow);
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--pastel-border);
}

.category-icon {
    font-size: 28px;
    /* KEINE iconBounce-Animation */
}

.category-header h3 {
    color: var(--primary);
    font-size: 17px;
    font-weight: 700;
    flex: 1;
}

/* ============================================================
   BEWERTUNGS-ITEMS
============================================================ */
.rating-item {
    background: var(--pastel-yellow);
    border: 1px solid var(--pastel-border);
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 12px;
}

.rating-item.unrated {
    border-color: rgba(245, 87, 108, 0.4);
    background: #fff5f5;
    /* KEINE pulseWarning-Animation */
}

.rating-item h4 {
    color: var(--text-primary);
    margin-bottom: 6px;
    font-size: 15px;
    font-weight: 700;
}

.rating-item p {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 14px;
    line-height: 1.6;
}

/* ============================================================
   STERN-/WOLKEN-BEWERTUNG
============================================================ */
.star-rating {
    display: flex;
    gap: 0;
    justify-content: center;
    align-items: stretch;
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid var(--pastel-border);
    overflow: hidden;
}

.cloud-area {
    background: #3a5fcd;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stars-area {
    background: #CDB38B;
    padding: 14px 18px;
    display: flex;
    gap: 12px;
    flex: 1;
    justify-content: center;
}

.star,
.cloud {
    font-size: 26px;
    cursor: pointer;
    user-select: none;
    opacity: 0.45;
    filter: grayscale(1) brightness(0.85);
    transition: opacity 0.12s ease, filter 0.12s ease, transform 0.12s ease;
    line-height: 1;
}

.cloud {
    font-size: 28px;
}

.star.active,
.cloud.active {
    opacity: 1;
    filter: none;
    transform: scale(1.1);
    /* KEINE ratingPop-Animation, nur statisches Highlight */
}

.star:hover,
.cloud:hover {
    opacity: 0.85;
    filter: none;
}

/* ============================================================
   FORM FOOTER
============================================================ */
.form-footer {
    padding: 0 24px 32px;
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 768px) {
    .container {
        margin: 0;
        width: 100%;
        border-radius: 0;
    }

    .header {
        padding: 28px 20px;
    }

    .header h1 {
        font-size: 26px;
    }

    .login-form,
    .form-footer {
        padding: 24px 20px;
    }

    .instructions,
    .category,
    .success-message {
        margin: 16px;
        padding: 16px;
    }

    .student-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .rating-scale {
        grid-template-columns: repeat(3, 1fr);
    }

    .star-rating {
        flex-direction: column;
    }

    .cloud-area,
    .stars-area {
        width: 100%;
        justify-content: center;
    }

    .form-control {
        font-size: 18px;
        padding: 14px 18px;
        letter-spacing: 3px;
    }
}

@media (max-width: 480px) {
    .header h1 { font-size: 22px; }
    .header p { font-size: 14px; }
    .form-control { font-size: 16px; letter-spacing: 2px; }
    .rating-scale { grid-template-columns: repeat(2, 1fr); }
    .star, .cloud { font-size: 24px; }
}

/* ============================================================
   ACCESSIBILITY
============================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition: none !important;
        animation: none !important;
    }
}

/* iOS-/Safari-Tap: kein blaues Highlight, schnellere Reaktion */
button, .star, .cloud, .form-control {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* ============================================================
   Inline-Style-Ersatz (vorher direkt in index.php)
============================================================ */
.success-lead {
    font-size: 17px;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.success-info {
    background: var(--primary-soft);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    padding: 16px 20px;
    margin: 20px 0;
    text-align: left;
}

.success-info p {
    margin: 4px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.success-countdown {
    margin-top: 24px;
    font-size: 16px;
    text-align: center;
}

.success-countdown #countdown {
    display: inline-block;
    min-width: 22px;
    color: var(--primary);
    font-size: 22px;
    font-weight: 800;
}

.success-hint {
    margin-top: 8px;
    font-size: 13px;
    opacity: 0.7;
    text-align: center;
}

.code-pill {
    font-family: 'Fira Code', Consolas, Monaco, 'Courier New', monospace;
    background: var(--primary-soft);
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-block;
    font-size: 14px;
    margin-top: 4px;
}

.student-info__meta {
    text-align: right;
    opacity: 0.85;
}

.student-info__meta p {
    font-size: 13px;
    margin: 2px 0;
}

.category-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
    font-weight: 400;
    opacity: 0.9;
}

.privacy-note {
    margin-top: 20px;
    padding: 14px 18px;
    background: var(--primary-soft);
    border-radius: 10px;
    border-left: 4px solid var(--primary);
}

.privacy-note p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}
