/* ============================================================
   Meldeblock (Verbandbuch) - External Stylesheet
   Light & Dark Theme mit CSS-Variablen
   ============================================================ */

:root {
  --card:               #ffffff;
  --ring:               #34a85a;
  --input:              #d4d4d4;
  --border:             #d4d4d4;
  --radius:             0.5rem;
  --primary:            #34a85a;
  --secondary:          #6495ed;
  --background:         #f9f9fa;
  --foreground:         #000000;
  --card-foreground:    #000000;
  --muted-foreground:   #6e6e6e;
  --primary-foreground: #ffffff;
  --secondary-foreground: #ffffff;
}

html.dark {
  --card:               #2f3436;
  --ring:               #33cc33;
  --input:              #444444;
  --border:             #444444;
  --radius:             0.5rem;
  --primary:            #33cc33;
  --secondary:          #87ceeb;
  --background:         #1a1d23;
  --foreground:         #ffffff;
  --card-foreground:    #ffffff;
  --muted-foreground:   #a3a3a3;
  --primary-foreground: #000000;
  --secondary-foreground: #000000;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.main-content {
    display: block;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--background);
    min-height: 100vh;
    color: var(--foreground);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.header-bar {
    background: var(--card);
    color: var(--foreground);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.header-bar a {
    color: var(--foreground);
    text-decoration: none;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.3s ease;
}

.header-bar a:hover {
    opacity: 0.8;
}

.container {
    width: 100%;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    min-height: 100vh;
}

.header {
    border-bottom: 1px solid var(--border);
    background: var(--card);
    padding: 25px 15px;
    text-align: center;
    color: var(--foreground);
}

.header h1 {
    font-size: 1.8em;
    margin-bottom: 10px;
    color: var(--foreground);
    font-weight: bold;
    line-height: 1.2;
}

.header p {
    font-size: 0.95em;
    opacity: 0.9;
    color: var(--muted-foreground);
    line-height: 1.4;
}

.form-content {
    padding: 15px;
    background: var(--background);
}

/* ---- Consent Section ---- */
.consent-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 15px;
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
}

.consent-section h3 {
    color: var(--foreground);
    margin-bottom: 15px;
    font-size: 1.1em;
}

.consent-text {
    color: var(--muted-foreground);
    line-height: 1.6;
    margin-bottom: 20px;
}

/* ---- Checkbox Container ---- */
.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
    cursor: pointer;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.checkbox-container:hover {
    border-color: var(--primary);
    background-color: var(--card);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.checkbox-container input[type="checkbox"] {
    display: none;
}

.checkbox-container::before {
    content: "";
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 4px;
    background: var(--background);
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.checkbox-container span {
    font-weight: 500;
    color: var(--foreground);
    font-size: 0.95em;
    line-height: 1.4;
    cursor: pointer;
    flex: 1;
}

.checkbox-container:has(input[type="checkbox"]:checked) {
    border-color: var(--primary);
    background: var(--card);
}

.checkbox-container:has(input[type="checkbox"]:checked)::before {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-container:has(input[type="checkbox"]:checked)::after {
    content: "✓";
    position: absolute;
    left: 19px;
    top: 19px;
    color: var(--primary-foreground);
    font-weight: bold;
    font-size: 14px;
}

.checkbox-container:active {
    transform: translateY(0);
}

.checkbox-container:focus-within {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ---- Form Section ---- */
.form-section {
    margin-bottom: 25px;
    padding: 20px 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card);
}

.form-section h3 {
    color: var(--foreground);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    font-size: 1.1em;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: var(--muted-foreground);
    margin-bottom: 8px;
    font-size: 0.95em;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 15px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: var(--background);
    color: var(--foreground);
    min-height: 52px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.15);
}

html.dark .form-group input:focus,
html.dark .form-group select:focus,
html.dark .form-group textarea:focus {
    box-shadow: 0 0 0 3px rgba(51, 204, 51, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--muted-foreground);
    opacity: 0.7;
}

/* ---- Submit Button ---- */
.submit-btn {
    background: var(--secondary);
    color: var(--secondary-foreground);
    padding: 18px 25px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    min-height: 56px;
    margin-top: 20px;
}

.submit-btn:hover,
.submit-btn:active {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ---- Loading Spinner ---- */
.loading {
    display: none;
    text-align: center;
    padding: 30px 20px;
    background: var(--card);
    border-radius: 12px;
    margin-top: 20px;
    color: var(--muted-foreground);
}

.spinner {
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ---- Success / Error Messages ---- */
.success-message {
    font-size: 1em;
    display: none;
    background: var(--card);
    color: var(--primary);
    padding: 25px 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    text-align: center;
    margin-top: 20px;
}

.success-message h3 {
    font-size: 1.3em;
    line-height: 1.4;
    margin-bottom: 10px;
    font-weight: 600;
}

.success-message p {
    font-size: 1em;
    line-height: 1.4;
    margin: 0;
}

.error-message {
    font-size: 1em;
    display: none;
    background: var(--card);
    color: #ef4444;
    padding: 25px 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    text-align: center;
    margin-top: 20px;
}

.error-message h3 {
    font-size: 1.3em;
    line-height: 1.4;
    margin-bottom: 10px;
    font-weight: 600;
}

.error-message p {
    font-size: 1em;
    line-height: 1.4;
    margin: 0;
}

/* ---- Pflichtfeld Hinweis ---- */
.required-hint {
    color: #ef4444;
    font-size: 0.85em;
    margin-bottom: 20px;
    display: block;
}

.form-group label .required {
    color: #ef4444;
    margin-left: 3px;
}

/* ---- Responsive: Desktop ---- */
@media (min-width: 769px) {
    .form-content {
        padding: 30px;
        max-width: 800px;
        margin: 0 auto;
    }

    .form-row {
        flex-direction: row;
        gap: 30px;
    }

    .form-group {
        flex: 1;
    }

    .submit-btn {
        width: auto;
        min-width: 300px;
        margin: 20px auto;
        display: block;
    }
}

/* ---- Responsive: Large screens ---- */
@media (min-width: 1024px) {
    .header {
        padding: 40px 30px;
    }

    .header h1 {
        font-size: 2.5em;
    }

    .form-content {
        padding: 40px;
    }

    .form-section {
        padding: 30px;
    }
}

/* ---- Responsive: Very small screens ---- */
@media (max-width: 480px) {
    .header {
        padding: 20px 10px;
    }

    .header h1 {
        font-size: 1.5em;
    }

    .header p {
        font-size: 0.85em;
    }

    .form-content {
        padding: 10px;
    }

    .form-section {
        padding: 15px 10px;
        margin-bottom: 20px;
    }

    .consent-section {
        padding: 15px 10px;
    }
}
