/* CSS Variables */
:root {
    --primary: #B5007C;
    --primary-light: #FCE4F2;
    --text: #333333;
    --border: #E5E5E5;
    --muted: #666666;

    /* Navigation height calculations */
    --btn-padding-y: 12px;
    --nav-padding-y: 16px;
    --nav-border: 1px;
    --nav-total-height: calc(var(--btn-padding-y) * 2 + var(--nav-padding-y) * 2 + var(--nav-border) + 20px); /* 20px extra safety margin */

    /* Small screen navigation height */
    --btn-padding-y-small: 10px;
    --nav-padding-y-small: 12px;
    --nav-total-height-small: calc(var(--btn-padding-y-small) * 2 + var(--nav-padding-y-small) * 2 + var(--nav-border) + 20px); /* 20px extra safety margin */
}

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

html {
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #F8F9FA;
    color: var(--text);
    line-height: 1.5;
    overflow-x: hidden;
}

/* Layout */
.container {
    max-width: 600px;
    width: 100%;
    padding: 0 16px 16px 16px; /* Normal padding for desktop */
    margin: 0 auto;
    overflow-x: hidden;
}

/* Header */
.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}

.site-title {
    font-size: 17px;
    margin: 0;
    color: var(--primary);
    font-weight: 600;
}

.language-selector {
    flex-shrink: 0;
}

.language-dropdown {
    background: white;
    border: 2px solid var(--primary);
    border-radius: 8px;
    padding: 6px 8px;
    font-size: 12px;
    color: var(--text);
    cursor: pointer;
}

/* Progress Bar */
.progress-bar {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    max-width: 400px;
    margin: 0 auto;
    position: relative;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: #E9ECEF;
    transform: translateY(-50%);
    z-index: 1;
}

.progress-step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #E9ECEF;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.progress-step.active {
    background: var(--primary);
    color: white;
}

.progress-step.current {
    animation: pulse-step 1.8s ease-in-out infinite;
}

@keyframes pulse-step {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    .progress-step.current {
        animation: none;
        box-shadow: 0 0 0 2px var(--primary);
    }
}

.step-number {
    font-size: 14px;
    font-weight: 600;
}

/* Typography */
h1 {
    font-size: 29px;
    margin-bottom: 16px;
}

/* Card */
.card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 12px;
}

/* Form Elements */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: white;
    min-height: 48px; /* Force minimum height to prevent collapse */
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
}

.form-input.error {
    border-color: #dc3545;
}

#signature-location.error {
    border-color: #dc3545 !important;
}

#signature-canvas-container.error {
    border-color: #dc3545 !important;
}

.checkbox-label.error {
    color: #dc3545;
    font-weight: 500;
}

.checkbox-label.error input[type="checkbox"],
.checkbox-label.error input[type="radio"] {
    outline: 2px solid #dc3545;
    outline-offset: 2px;
}

.form-input.iban-valid {
    border-color: #28a745;
    background-color: #f8fff9;
}

.form-input.iban-invalid {
    border-color: #dc3545;
    background-color: #fff8f8;
}


.form-actions {
    margin-top: 16px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary.active {
    background: var(--primary);
    color: white;
}

.btn-full {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 12px;
}

/* Utility Classes */
.text-muted {
    color: var(--muted);
}

.mb-3 {
    margin-bottom: 16px;
}

.required {
    color: #dc3545;
}

.error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 4px;
}

.hidden {
    display: none;
}

/* Flight Panels */
.flight-panel {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    background: white;
    position: relative;
}

.flight-panel:last-child {
    margin-bottom: 0;
}

.remove-flight-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border: none;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-flight-btn:hover {
    background: #c82333;
}

/* Screen Navigation */
.screens-container {
    overflow: hidden;
    position: relative;
    width: 100%;
}

.screens {
    display: block;
    width: 100%;
}

.screen {
    width: 100%;
    padding: 12px 0 0 0;
    display: none; /* Hide inactive screens */
}

.screen.active {
    display: block; /* Show only active screen */
}

.screen-navigation {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 24px 0;
    max-width: 600px;
    margin: 0 auto;
}

.screen-navigation .btn {
    flex: 1;
}

.screen-navigation .btn.hidden {
    display: none;
}

/* When only one button is visible, make it full width */
.screen-navigation .btn:only-child {
    width: 100%;
}

/* Radio and Checkbox Options */
.radio-option,
.checkbox-option {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    cursor: pointer;
}

.radio-option input[type="radio"],
.checkbox-option input[type="checkbox"] {
    margin-right: 8px;
}

/* Horizontal Radio Group */
.radio-group-horizontal {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.radio-group-horizontal .radio-option {
    margin-bottom: 0;
}

.issue-options {
    display: flex;
    flex-direction: column;
}

/* Alert Styles */
.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.alert-info {
    background: var(--primary-light);
    border: 1px solid var(--primary);
}

.alert h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
}

.compensation-amount {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary);
}

/* Form Section Titles */
.form-section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
}

/* Upload Areas */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    background: #FAFBFC;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    margin-bottom: 16px;
}

.upload-area:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-area.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: scale(1.02);
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.upload-text {
    color: var(--text);
}

.upload-description {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 8px;
    line-height: 1.4;
    white-space: pre-line;
}

.upload-instruction {
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
}

.upload-area.has-files {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-area.has-files .upload-instruction {
    color: var(--primary);
}

/* Smaller upload areas for receipts */
.upload-area-small {
    padding: 16px;
    margin-bottom: 8px;
}

.upload-area-small .upload-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.upload-area-small .upload-instruction {
    font-size: 14px;
}

/* File Preview */
.file-preview {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: #F3F4F6;
    border-radius: 8px;
    font-size: 14px;
    border: 1px solid var(--border);
    margin-bottom: 8px;
    width: 100%;
}

.file-item .file-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.file-item .file-icon {
    margin-right: 8px;
    font-size: 16px;
}

.file-item .file-name {
    font-weight: 500;
    margin-right: 8px;
}

.file-item .file-size {
    color: var(--muted);
    font-size: 12px;
}

.file-item .file-remove {
    background: #DC2626;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    margin-left: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.file-item .file-remove:hover {
    background: #B91C1C;
    transform: scale(1.1);
}

/* Alternative X button style */
.file-remove-x {
    background: #EF4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}

.file-remove-x:hover {
    background: #DC2626;
    transform: scale(1.1);
}

/* Mobile and Tablet - Fixed Navigation */
@media screen and (max-width: 1024px) {
    .screen.active {
        margin-bottom: 200px; /* Massive margin to clear fixed navigation */
    }

    .screen-navigation {
        position: fixed;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 100%;
        max-width: 600px;
        background: #F8F9FA;
        border-top: 1px solid var(--border);
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.1);
        padding: 16px;
        margin: 0;
        z-index: 1000;
    }
}

/* Mobile Optimization for iPhone SE and small screens */
@media screen and (max-width: 400px) {
    .card {
        padding: 16px;
        margin-bottom: 8px;
    }

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

    .form-actions {
        margin-top: 12px;
    }

    .screen {
        padding: 8px 0;
    }

    h1 {
        font-size: 24px;
        margin-bottom: 12px;
    }

    .flight-panel {
        padding: 12px;
        margin-bottom: 12px;
    }

    /* Reduce button padding on mobile */
    .btn {
        padding: 10px 20px;
    }

    /* Additional mobile adjustments for smaller screens */
    .screen-navigation {
        padding: 12px 16px;
        max-width: 100%;
        border-radius: 0;
    }

    .screen.active {
        margin-bottom: 180px; /* Massive margin for small screens */
    }
}

/* Legal Agreements Styles */
.checkbox-group {
    margin: 16px 0;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    margin-top: 2px;
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.checkbox-label span {
    flex: 1;
}

.checkbox-label a {
    color: var(--primary);
    text-decoration: none;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* Info Box Styles */
.info-box {
    background: #F8F9FA;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
}

.info-header {
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-list {
    margin: 0;
    padding-left: 20px;
    color: var(--muted);
}

.info-list li {
    margin-bottom: 8px;
    line-height: 1.4;
}

/* Summary Section Styles for Review Screen */
.summary-section {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 16px;
    padding: 16px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.section-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.edit-section-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
}

.edit-section-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.section-content {
    padding-top: 8px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    color: var(--text);
}

.summary-label {
    color: var(--muted);
    font-size: 14px;
}

.summary-value {
    font-weight: 500;
    text-align: right;
}

.summary-value.summary-multiline {
    white-space: pre-wrap;
    word-wrap: break-word;
    max-width: 60%;
}

.summary-value.highlight {
    color: var(--primary);
    font-weight: 600;
    font-size: 18px;
}

.summary-list {
    list-style: none;
    padding: 0;
    margin: 8px 0;
}

.summary-list li {
    padding: 4px 0;
    color: var(--text);
}

/* Email Verification Section */
.verification-section {
    background: var(--primary-light);
    border-radius: 8px;
    margin-top: 24px;
}

.verification-info-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: white;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 2px solid var(--primary-light);
}

.verification-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.verification-text {
    flex: 1;
}

.verification-text p {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: var(--text);
}

.verification-spam-hint {
    color: var(--muted);
    font-size: 13px;
    font-style: italic;
}

.verification-input {
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 8px;
    font-family: 'Courier New', monospace;
}

.verification-status {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
}

.verification-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.verification-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.btn-small {
    font-size: 14px;
    padding: 8px 16px;
}
/* ============================================================================
   Upload Progress Overlay
   ============================================================================ */

.upload-progress-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.upload-progress-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.upload-progress-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    min-width: 300px;
    max-width: 90%;
}

.upload-progress-text {
    font-size: 16px;
    font-weight: 600;
    color: #333333;
    margin-bottom: 16px;
    text-align: center;
}

.upload-progress-bar-container {
    width: 100%;
    height: 8px;
    background: #E5E5E5;
    border-radius: 4px;
    overflow: hidden;
}

.upload-progress-bar {
    height: 100%;
    background: #B5007C;
    width: 0%;
    transition: width 0.3s ease;
}

/* Upload progress bar success state */
.upload-progress-bar.success {
    background: #B5007C;
}

/* Upload close button */
.upload-close-btn {
    width: 100%;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    border-radius: 24px;
    background: #B5007C;
    color: white;
    transition: background 0.2s ease;
}

.upload-close-btn:hover {
    background: #8F0062;
}

.upload-close-btn:active {
    transform: scale(0.98);
}

/* Error highlighting for radio button groups (Rechtsschutzversicherung) */
.radio-option.error input[type="radio"] {
    outline: 2px solid #dc3545;
    outline-offset: 2px;
}

.radio-option.error label {
    color: #dc3545;
    font-weight: 500;
}
