/* Förderantrag-Generator — Wizard CSS (TTFI Design System) */

:root {
    --primary: #1a365d;
    --primary-light: #2b6cb0;
    --accent: #38b2ac;
    --bg: #0d1117;
    --bg-card: #161b22;
    --bg-input: #1c2333;
    --text: #e6edf3;
    --text-muted: #8b949e;
    --border: #30363d;
    --success: #2ea043;
    --warning: #d29922;
    --error: #f85149;
    --radius: 8px;
    --shadow: 0 4px 12px rgba(0,0,0,0.3);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.site-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
}
.header-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo { text-decoration: none; color: #fff; display: flex; align-items: baseline; gap: 6px; }
.logo-text { font-size: 22px; font-weight: 700; letter-spacing: 1px; }
.logo-sub { font-size: 14px; font-weight: 400; opacity: 0.85; }
.header-badge {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 13px;
    color: #fff;
    font-weight: 500;
}

/* Main */
main {
    flex: 1;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 24px;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 20px 24px;
    text-align: center;
}
.footer-inner { max-width: 900px; margin: 0 auto; }
.footer-inner a { color: var(--primary-light); text-decoration: none; }
.footer-inner a:hover { text-decoration: underline; }
.footer-inner p { font-size: 13px; color: var(--text-muted); margin: 4px 0; }
.zero-data-badge {
    display: inline-block;
    background: rgba(46,160,67,0.1);
    border: 1px solid var(--success);
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 12px;
    color: var(--success);
    margin-top: 8px;
}

/* Loading */
.loading-screen { text-align: center; padding: 80px 0; }
.spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary-light);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Progress Bar */
.progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 32px;
    position: relative;
}
.progress-bar::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 30px;
    right: 30px;
    height: 2px;
    background: var(--border);
}
.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 1;
}
.step-circle {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
}
.step-label { font-size: 11px; color: var(--text-muted); max-width: 80px; text-align: center; }
.progress-step.active .step-circle { background: var(--primary-light); border-color: var(--primary-light); color: #fff; }
.progress-step.completed .step-circle { background: var(--success); border-color: var(--success); color: #fff; }

/* Card */
.wizard-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
}
.wizard-card h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}
.wizard-card .subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* Forms */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(43,108,176,0.2);
}
textarea { resize: vertical; min-height: 80px; }

/* Radio & Checkbox */
.radio-group, .checkbox-group { display: flex; flex-direction: column; gap: 10px; }
.radio-option, .checkbox-option {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s;
    font-size: 14px;
}
.radio-option:hover, .checkbox-option:hover { border-color: var(--primary-light); }
.radio-option input, .checkbox-option input { margin-top: 2px; }
.radio-desc { font-size: 12px; color: var(--text-muted); }

/* Grid */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 120px 1fr; gap: 16px; }

/* Dynamic Table (Teilnehmer) */
.tn-table-wrap { overflow-x: auto; margin: 16px 0; }
.tn-table { width: 100%; border-collapse: collapse; }
.tn-table th {
    background: var(--primary);
    color: #fff;
    padding: 10px 14px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
}
.tn-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.tn-table input, .tn-table select {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-size: 13px;
}
.btn-remove {
    background: none; border: none; color: var(--error);
    cursor: pointer; font-size: 18px; padding: 4px 8px;
}
.btn-remove:hover { opacity: 0.7; }

/* Buttons */
.btn-group {
    display: flex;
    justify-content: space-between;
    margin-top: 28px;
    gap: 12px;
}
.btn {
    padding: 12px 28px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-secondary {
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--primary-light); }
.btn-success {
    background: linear-gradient(135deg, #276749, var(--success));
    color: #fff;
    font-size: 16px;
    padding: 14px 32px;
}
.btn-success:hover { opacity: 0.9; }
.btn-add {
    background: none;
    border: 1px dashed var(--border);
    color: var(--primary-light);
    padding: 10px;
    width: 100%;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}
.btn-add:hover { border-color: var(--primary-light); background: rgba(43,108,176,0.05); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-magic-link {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    padding: 16px 28px;
    font-size: 16px;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.3s;
    letter-spacing: 0.5px;
}
.btn-magic-link:hover {
    border-color: #90cdf4;
    box-shadow: 0 0 24px rgba(43,108,176,0.35);
    transform: translateY(-2px);
}

/* Info Boxes */
.info-box {
    background: rgba(43,108,176,0.1);
    border-left: 4px solid var(--primary-light);
    border-radius: 0 6px 6px 0;
    padding: 14px 18px;
    margin: 16px 0;
    font-size: 13px;
}
.warning-box {
    background: rgba(210,153,34,0.1);
    border-left: 4px solid var(--warning);
    border-radius: 0 6px 6px 0;
    padding: 14px 18px;
    margin: 16px 0;
    font-size: 13px;
}
.success-box {
    background: rgba(46,160,67,0.1);
    border: 1px solid var(--success);
    border-radius: var(--radius);
    padding: 20px;
    margin: 16px 0;
    text-align: center;
}

/* Consent Gate */
.consent-disclaimer {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 16px;
    margin: 16px 0;
    font-size: 13px;
    line-height: 1.7;
}

/* Kostenberechnung */
.cost-result {
    background: linear-gradient(135deg, rgba(43,108,176,0.1), rgba(56,178,172,0.1));
    border: 2px solid var(--primary-light);
    border-radius: var(--radius);
    padding: 24px;
    margin: 24px 0;
    text-align: center;
}
.cost-big { font-size: 32px; font-weight: 700; color: var(--primary-light); }
.cost-label { font-size: 14px; color: var(--text-muted); margin-top: 4px; }
.cost-table { width: 100%; margin: 16px 0; }
.cost-table td { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.cost-table .right { text-align: right; font-variant-numeric: tabular-nums; }
.cost-table .highlight td { font-weight: 700; color: var(--success); border-top: 2px solid var(--success); }

/* Summary */
.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.summary-item .label { color: var(--text-muted); }
.summary-item .value { font-weight: 600; }
.summary-item .edit-link {
    color: var(--primary-light);
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
}
.summary-item .edit-link:hover { text-decoration: underline; }

/* Download screen */
.download-icon { font-size: 48px; margin-bottom: 16px; }
.next-steps { text-align: left; margin: 24px 0; }
.next-steps li { padding: 8px 0; font-size: 14px; border-bottom: 1px solid var(--border); }
.cta-booking {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent), #319795);
    color: #fff;
    padding: 14px 28px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 20px;
    transition: opacity 0.2s;
}
.cta-booking:hover { opacity: 0.9; }

/* Error */
.error-msg { color: var(--error); font-size: 13px; margin-top: 4px; }
.error-msg:focus { outline: 2px solid var(--error); outline-offset: 2px; }

/* Skip-to-content (WCAG 2.1 AA) */
.skip-to-content {
    position: absolute; top: -40px; left: 0;
    background: var(--primary); color: #fff;
    padding: 8px 16px; text-decoration: none; z-index: 1000;
    border-radius: 0 0 6px 0; font-size: 14px; font-weight: 600;
}
.skip-to-content:focus { top: 0; }

/* Screen-Reader Only (WCAG) */
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Focus-Visible (WCAG 2.1 AA) */
:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
    box-shadow: 0 0 0 3px rgba(43,108,176,0.3);
}

/* Reduced Motion (WCAG 2.1 AA) */
@media (prefers-reduced-motion: reduce) {
    .spinner { animation: none; border-top-color: var(--primary-light); }
    * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* Timeout Warning Modal */
.timeout-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6); display: flex;
    align-items: center; justify-content: center; z-index: 9999;
}

/* Responsive */
@media (max-width: 700px) {
    .form-row { grid-template-columns: 1fr; }
    .wizard-card { padding: 20px; }
    .progress-bar { gap: 4px; }
    .step-label { font-size: 10px; }
    .btn-group { flex-direction: column; }
}
