/* 
 * styles.css
 * Custom Design System für die Feuerwehr Kirchen (Löschzug 1).
 * Farben basierend auf dem Logo (Tiefblau & Gelb).
 */

:root {
    --bg-dark: #050e1e;
    --bg-card: rgba(13, 27, 56, 0.7);
    --border-color: rgba(252, 209, 22, 0.15);
    --border-focus: #fcd116;
    --text-main: #ffffff;
    --text-muted: #cbd5e0;
    --accent-yellow: #fcd116;
    --accent-hover: #e5bd10;
    --accent-glow: rgba(252, 209, 22, 0.25);
    
    --font-primary: 'Outfit', sans-serif;
    --transition-speed: 0.3s;
}

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

body {
    background: radial-gradient(circle at top right, #0e2246 0%, var(--bg-dark) 70%);
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: rgba(252, 209, 22, 0.3);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-yellow);
}

/* Container */
.container {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 10px;
}

.logo-area {
    background: rgba(252, 209, 22, 0.05);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(252, 209, 22, 0.1);
    flex-shrink: 0;
}

.fire-icon {
    width: 48px;
    height: 48px;
    filter: drop-shadow(0 0 5px rgba(252, 209, 22, 0.5));
}

.title-area {
    display: flex;
    flex-direction: column;
}

.sub-brand {
    color: var(--accent-yellow);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 2px;
}

.header h1 {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.1;
    text-transform: uppercase;
    background: linear-gradient(135deg, #ffffff 60%, var(--accent-yellow) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.doc-title {
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 400;
    margin-top: 2px;
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: transform var(--transition-speed), border-color var(--transition-speed);
}

.glass-card:hover {
    border-color: rgba(252, 209, 22, 0.25);
}

/* Legal Text */
.legal-text-section h3 {
    color: var(--accent-yellow);
    font-size: 20px;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.legal-text-section p {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 15px;
}

.divider {
    height: 1px;
    background: linear-gradient(90deg, rgba(252, 209, 22, 0.3) 0%, rgba(252, 209, 22, 0.05) 100%);
    margin: 20px 0;
}

.gdpr-box {
    background: rgba(252, 209, 22, 0.05);
    border-left: 4px solid var(--accent-yellow);
    padding: 15px 20px;
    border-radius: 0 8px 8px 0;
    margin: 20px 0;
}

.highlight-text {
    font-weight: 500;
    color: #fff !important;
}

.consent-bullets {
    list-style: none;
    margin-top: 10px;
}

.consent-bullets li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-muted);
}

.consent-bullets li::before {
    content: "•";
    color: var(--accent-yellow);
    font-weight: bold;
    font-size: 18px;
    position: absolute;
    left: 5px;
    top: -2px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 20px;
}

.info-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
}

.info-item strong {
    color: #fff;
    font-size: 14px;
    display: block;
    margin-bottom: 5px;
}

.info-item p {
    font-size: 13px;
    color: #a0aec0;
    margin: 0;
}

/* Form inputs */
.form-section h3 {
    color: var(--accent-yellow);
    font-size: 18px;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.input-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}

.input-group input {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(252, 209, 22, 0.15);
    border-radius: 10px;
    padding: 14px 16px;
    color: #fff;
    font-family: var(--font-primary);
    font-size: 16px;
    outline: none;
    transition: all var(--transition-speed);
}

.input-group input:focus {
    border-color: var(--border-focus);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Date Input specific overrides to make it look clean */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(80%) sepia(50%) saturate(1000%) hue-rotate(5deg);
    cursor: pointer;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 10px;
    font-family: var(--font-primary);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
    text-decoration: none;
    outline: none;
}

.btn-primary {
    background-color: var(--accent-yellow);
    border: 2px solid var(--accent-yellow);
    color: #050e1e;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    border: 2px solid rgba(252, 209, 22, 0.4);
    color: var(--accent-yellow);
}

.btn-secondary:hover {
    background: rgba(252, 209, 22, 0.08);
    border-color: var(--accent-yellow);
}

.btn-large {
    width: 100%;
    padding: 16px;
    font-size: 18px;
}

.btn-icon {
    width: 20px;
    height: 20px;
}

/* Footer */
.footer {
    text-align: center;
    padding-top: 20px;
    color: #718096;
    font-size: 13px;
    border-top: 1px solid rgba(252, 209, 22, 0.05);
}

/* MODAL OVERLAY */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(2, 6, 12, 0.9);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    max-width: 650px;
    width: 100%;
    border-color: rgba(252, 209, 22, 0.4);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    position: relative;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.modal-header h2 {
    color: var(--accent-yellow);
    font-size: 22px;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover {
    color: #fff;
}

.modal-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Canvas Wrapper */
.canvas-wrapper {
    position: relative;
    width: 100%;
    height: 250px;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    border: 3px solid rgba(252, 209, 22, 0.3);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
    touch-action: none; /* Verhindert Scrollen beim Zeichnen auf dem Canvas */
}

#signatureCanvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

/* Grid Line like a real paper form */
.canvas-grid-line {
    position: absolute;
    bottom: 50px;
    left: 5%;
    right: 5%;
    height: 2px;
    background: rgba(5, 14, 30, 0.15);
    pointer-events: none;
}

.canvas-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(5, 14, 30, 0.2);
    font-size: 20px;
    font-weight: 500;
    pointer-events: none;
    user-select: none;
    letter-spacing: 1px;
    transition: opacity 0.3s;
}

.canvas-placeholder.hidden {
    opacity: 0;
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 15px;
    margin-top: 25px;
}

.modal-disclaimer {
    font-size: 11px;
    color: #718096;
    margin-top: 15px;
    text-align: center;
    line-height: 1.4;
}

/* Status overlay (spinner and success states) */
.status-overlay {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 12, 0.85);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.status-overlay.active {
    display: flex;
}

.status-card {
    max-width: 450px;
    width: 100%;
    text-align: center;
    padding: 40px 30px;
    border-color: rgba(252, 209, 22, 0.3);
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(252, 209, 22, 0.1);
    border-top: 4px solid var(--accent-yellow);
    border-radius: 50%;
    margin: 0 auto 20px auto;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.success-icon {
    width: 70px;
    height: 70px;
    background: rgba(72, 187, 120, 0.15);
    border: 3px solid #48bb78;
    color: #48bb78;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: bold;
    margin: 0 auto 20px auto;
    animation: pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

#statusTitle {
    font-size: 20px;
    margin-bottom: 10px;
}

#statusMessage {
    font-size: 14px;
    color: var(--text-muted);
}

/* Responsiveness adjustments */
@media (min-width: 600px) {
    .input-row {
        grid-template-columns: 1fr 1fr;
    }
    
    .info-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .info-item:last-child {
        grid-column: span 2;
    }
}

@media (max-width: 480px) {
    .header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    .container {
        padding: 20px 15px;
    }
    .glass-card {
        padding: 20px;
    }
    .modal-actions {
        grid-template-columns: 1fr;
    }
}
