/**
 * Event Lead Capture Form Styles
 * 
 * Tablet-optimized styles for event/conference lead capture
 * Optimized for speed, efficiency, and touch interaction
 */

/* ============================================================================
   Container & Layout
   ============================================================================ */

.event-form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem;
}

@media (min-width: 768px) {
    .event-form-container {
        padding: 2rem;
    }
}

/* ============================================================================
   Offline Indicator
   ============================================================================ */

.offline-indicator {
    background: #fef3c7;
    border: 2px solid #f59e0b;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.offline-indicator-content {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    color: #92400e;
    font-size: 0.875rem;
    font-weight: 500;
}

.offline-text {
    flex: 1;
    min-width: 200px;
}

.offline-count {
    font-weight: 600;
    margin-left: 0.5rem;
}

.offline-retry-btn {
    min-height: 36px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #92400e;
    background: white;
    border: 2px solid #f59e0b;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.offline-retry-btn:hover {
    background: #fef3c7;
    border-color: #d97706;
}

.offline-retry-btn:active {
    transform: scale(0.98);
}

.offline-progress {
    margin-top: 0.75rem;
    height: 4px;
    background: #fde68a;
    border-radius: 2px;
    overflow: hidden;
}

.offline-progress-bar {
    height: 100%;
    width: 100%;
    background: #fde68a;
}

.offline-progress-fill {
    height: 100%;
    background: #f59e0b;
    transition: width 0.3s ease;
    width: 0%;
}

/* ============================================================================
   Camera Scan Section
   ============================================================================ */

.camera-scan-section {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 2rem;
    padding: 0 1.5rem;
}

@media (min-width: 768px) {
    .camera-scan-section {
        padding: 0 2rem;
    }
}

.camera-scan-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 400px;
    min-height: 60px;
    padding: 1rem 1.5rem;
    background: linear-gradient(to right, #2563eb, #1d4ed8);
    color: white;
    font-size: 1.125rem;
    font-weight: 600;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.camera-scan-button:hover {
    background: linear-gradient(to right, #1d4ed8, #1e40af);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.camera-scan-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.camera-scan-button:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.camera-scan-hint {
    margin-top: 0.5rem;
    color: #6b7280;
}

/* ============================================================================
   Camera Modal
   ============================================================================ */

.camera-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.camera-modal-content {
    background: white;
    border-radius: 1rem;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.camera-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.camera-close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.camera-close-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.camera-preview-container {
    position: relative;
    width: 100%;
    padding-top: 75%;
    /* 4:3 aspect ratio */
    background: #000;
    overflow: hidden;
}

#camera-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-controls {
    padding: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.camera-capture-btn {
    width: 72px;
    /* Increased from 64px for better touch target */
    height: 72px;
    /* Increased from 64px for better touch target */
    min-width: 72px;
    /* Ensure minimum size */
    min-height: 72px;
    /* Ensure minimum size */
    border-radius: 50%;
    border: 4px solid white;
    background: #2563eb;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    touch-action: manipulation;
    /* Prevent double-tap zoom */
    -webkit-tap-highlight-color: transparent;
    /* Remove tap highlight */
}

.camera-capture-btn:hover {
    background: #1d4ed8;
    transform: scale(1.05);
}

.camera-capture-btn:active {
    transform: scale(0.95);
}

.camera-error {
    padding: 1rem 1.5rem;
    background: #fee2e2;
    color: #991b1b;
    border-top: 1px solid #fecaca;
    font-size: 0.875rem;
}

/* ============================================================================
   OCR Processing
   ============================================================================ */

.ocr-processing {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.ocr-processing-content {
    text-align: center;
    color: #2563eb;
    padding: 2rem;
}

.ocr-processing-content svg {
    margin: 0 auto 1rem;
    display: block;
}

.ocr-processing-content p {
    font-size: 1.125rem;
    font-weight: 500;
    margin-top: 1rem;
}

.spinner {
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Auto-filled field highlight */
/* ============================================================================
   OCR Auto-Filled Fields
   ============================================================================ */

.form-input.ocr-filled,
.form-textarea.ocr-filled {
    border-left: 4px solid #10b981;
    /* Green border to indicate OCR fill */
    background-color: #f0fdf4;
    /* Light green background */
    position: relative;
}

.form-input.ocr-filled::after,
.form-textarea.ocr-filled::after {
    content: '✓';
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #10b981;
    font-weight: bold;
    font-size: 1rem;
    pointer-events: none;
}

.form-input.ocr-filled:focus,
.form-textarea.ocr-filled:focus {
    border-left-color: #059669;
    background-color: #ffffff;
}

/* Warning state for OCR-filled fields with potential issues */
.form-input.ocr-filled-warning {
    border-left-color: #f59e0b;
    /* Orange border for warnings */
    background-color: #fffbeb;
    /* Light yellow background */
}

.form-input.ocr-filled-warning::after {
    content: '⚠';
    color: #f59e0b;
}

/* Edit button for OCR-filled fields */
.ocr-edit-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.ocr-edit-btn:hover {
    opacity: 1;
    color: #2563eb;
}

.form-input.ocr-filled,
.form-textarea.ocr-filled {
    background-color: #f0fdf4 !important;
    /* Light green background */
    border-left: 4px solid #10b981 !important;
    /* Green left border */
    border-color: #10b981 !important;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    position: relative;
    padding-right: 2.5rem !important;
    /* Space for checkmark icon */
}

/* Warning state for OCR-filled fields with potential validation issues */
.form-input.ocr-filled-warning,
.form-textarea.ocr-filled-warning {
    background-color: #fffbeb !important;
    /* Light yellow background */
    border-left-color: #f59e0b !important;
    /* Orange left border */
}

/* Success indicator icon for OCR-filled fields */
.form-input.ocr-filled::before {
    content: '✓';
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #10b981;
    font-weight: bold;
    font-size: 1rem;
    pointer-events: none;
    z-index: 1;
}

.form-input.ocr-filled-warning::before {
    content: '⚠';
    color: #f59e0b;
}

.form-input.ocr-filled:focus,
.form-textarea.ocr-filled:focus {
    background-color: #ffffff !important;
    border-left-color: #059669 !important;
}

/* Toast notification styles */
.ocr-toast {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.875rem;
    line-height: 1.5;
}

@media (max-width: 640px) {
    .ocr-toast {
        right: 10px !important;
        left: 10px !important;
        max-width: calc(100% - 20px) !important;
    }
}

/* ============================================================================
   Form Progress Indicator
   ============================================================================ */

.form-progress {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
}

.form-progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.form-progress-fill {
    height: 100%;
    background: linear-gradient(to right, #2563eb, #1d4ed8);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.form-progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: #6b7280;
}

.form-progress-percentage {
    font-weight: 600;
    color: #2563eb;
}

@media (max-width: 640px) {
    .form-progress {
        padding: 0.75rem;
    }

    .form-progress-text {
        font-size: 0.8125rem;
    }
}

/* ============================================================================
   Form Steps
   ============================================================================ */

.form-step {
    opacity: 1;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    transform: translateX(0);
}

.form-step.hidden {
    display: none !important;
}

.form-step.active {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

/* Step transitions */
.form-step:not(.active):not(.hidden) {
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
}

/* ============================================================================
   Step Navigation Buttons
   ============================================================================ */

.step-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e5e7eb;
    gap: 1rem;
}

.step-next-button,
.step-back-button {
    min-height: 56px;
    /* Exceeds 44px minimum for primary actions */
    min-width: 44px;
    padding: 0.875rem 1.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.step-next-button {
    width: 100%;
    background: linear-gradient(to right, #2563eb, #1d4ed8);
    color: white;
    margin-left: auto;
}

.step-next-button:hover:not(:disabled) {
    background: linear-gradient(to right, #1d4ed8, #1e40af);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.step-next-button:active:not(:disabled) {
    transform: translateY(0);
}

.step-next-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.step-next-button:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.step-back-button {
    background: white;
    color: #374151;
    border: 2px solid #d1d5db;
    padding: 0.875rem 1.5rem;
    flex-shrink: 0;
    /* Prevent button from shrinking */
}

.step-back-button:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.step-back-button:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Submit button when inside step-navigation (Step 2) */
.step-navigation .form-submit-button {
    flex: 1;
    /* Take remaining space */
    width: auto;
    /* Override 100% width */
    margin-left: auto;
    /* Push to right */
}

@media (max-width: 640px) {
    .step-navigation {
        flex-direction: column;
    }

    .step-next-button,
    .step-back-button,
    .step-navigation .form-submit-button {
        width: 100%;
        margin-left: 0;
        /* Reset margin on mobile */
    }
}

/* ============================================================================
   Form Sections
   ============================================================================ */

.form-section {
    margin-bottom: 2rem;
}

.form-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e5e7eb;
}

/* ============================================================================
   Form Fields
   ============================================================================ */

.form-field-group {
    margin-bottom: 2rem;
    /* Increased from 1.5rem for better spacing on tablet/mobile */
}

/* Ensure minimum 8px spacing between touch targets */
.form-field-group+.form-field-group {
    margin-top: 0;
    /* Reset top margin, rely on bottom margin */
}

.form-label {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-label.required::after {
    content: " *";
    color: #ef4444;
}

.form-input,
.form-textarea {
    width: 100%;
    min-height: 44px;
    /* WCAG AA compliant touch target */
    min-width: 44px;
    /* Ensure minimum width */
    padding: 0.75rem 1rem;
    font-size: 16px;
    /* Prevents iOS zoom on focus */
    line-height: 1.5;
    color: #111827;
    background: white;
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    /* Prevent double-tap zoom on mobile */
}

.form-input:focus,
.form-textarea:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input:focus-visible,
.form-textarea:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: #9ca3af;
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

.form-error {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #ef4444;
    display: none;
}

.form-error.show {
    display: block;
}

.form-input.error,
.form-textarea.error {
    border-color: #ef4444;
    padding-right: 2.5rem;
    /* Make room for error icon */
}

.form-input.valid {
    border-color: #10b981;
    /* Green border for valid fields */
    padding-right: 2.5rem;
    /* Make room for success icon */
}

.form-field-group {
    position: relative;
    /* For absolute positioning of icons */
}

.field-success-icon {
    position: absolute;
    right: 0.75rem;
    top: 2.5rem;
    /* Position below label */
    color: #10b981;
    pointer-events: none;
    display: flex;
    align-items: center;
    z-index: 10;
}

.field-error-icon {
    position: absolute;
    right: 0.75rem;
    top: 2.5rem;
    /* Position below label */
    color: #ef4444;
    pointer-events: none;
    display: flex;
    align-items: center;
    z-index: 10;
}

.form-hint {
    margin-top: 0.5rem;
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.5;
    display: block;
}

.form-hint.hidden {
    display: none;
}

/* ============================================================================
   Owner Selection Screen
   ============================================================================ */

.owner-selection-screen {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.owner-selection-screen.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

.owner-selection-container {
    text-align: center;
}

.owner-selection-title {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
}

.owner-selection-subtitle {
    font-size: 1rem;
    color: #6b7280;
    margin-bottom: 2rem;
}

.owner-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    /* Minimum 8px spacing between touch targets (1rem = 16px) */
    margin-top: 2rem;
}

/* Intergastra 2026: Always 3×3 grid for visual consistency */
.owner-grid[data-event-id="intergastra-2026"] {
    grid-template-columns: repeat(3, 1fr);
}

/* Landscape tablets and larger: 4 columns (except Intergastra 2026) */
@media (min-width: 1024px) {
    .owner-grid:not([data-event-id="intergastra-2026"]) {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Mobile: Keep 3 columns but adjust spacing */
@media (max-width: 640px) {
    .owner-selection-screen {
        padding: 1.5rem 1rem;
    }

    .owner-selection-title {
        font-size: 1.75rem;
    }

    .owner-grid {
        gap: 0.75rem;
    }
}

.owner-button {
    min-height: 80px;
    /* Exceeds 44px minimum for better visibility */
    min-width: 44px;
    /* Ensure minimum width for touch target */
    padding: 1.5rem 1rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    touch-action: manipulation;
    /* Prevent double-tap zoom */
    -webkit-tap-highlight-color: transparent;
    /* Remove tap highlight */
}

.owner-button:hover {
    border-color: #2563eb;
    background: #eff6ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.owner-button:active {
    transform: translateY(0);
    border-color: #1d4ed8;
    background: #dbeafe;
}

.owner-button:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.owner-button[data-preselected="true"] {
    border-color: #2563eb;
    background: #eff6ff;
    font-weight: 700;
}

/* ============================================================================
   Form Header & Change Owner Button
   ============================================================================ */

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-header-left {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    flex: 1;
    flex-wrap: wrap;
}

.form-header-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.selected-owner-display {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 0.5rem;
    color: #1e40af;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
}

.selected-owner-display svg {
    flex-shrink: 0;
    color: #2563eb;
}

.selected-owner-label {
    color: #6b7280;
    font-weight: 400;
}

.selected-owner-name {
    color: #1e40af;
    font-weight: 600;
}

.change-owner-button {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    /* Ensure touch target meets minimum */
    min-width: 44px;
    /* Ensure touch target meets minimum */
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    touch-action: manipulation;
    /* Prevent double-tap zoom on mobile */
    -webkit-tap-highlight-color: transparent;
    /* Remove tap highlight */
}

.change-owner-button:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: #eff6ff;
}

.change-owner-button:active {
    background: #dbeafe;
}

.change-owner-button:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.change-owner-button svg {
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .form-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .form-header-left {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .form-header-title {
        width: 100%;
    }

    .selected-owner-display {
        width: 100%;
        justify-content: flex-start;
    }

    .change-owner-button {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================================================
   Custom Dropdowns (Button-style)
   ============================================================================ */

.custom-dropdown {
    position: relative;
    width: 100%;
}

.dropdown-button {
    width: 100%;
    min-height: 44px;
    /* WCAG AA compliant touch target */
    min-width: 44px;
    /* Ensure minimum width */
    padding: 0.75rem 1rem;
    font-size: 16px;
    /* Prevents iOS zoom */
    text-align: left;
    background: white;
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    /* Prevent double-tap zoom */
    -webkit-tap-highlight-color: transparent;
    /* Remove tap highlight */
}

.dropdown-button:hover {
    border-color: #9ca3af;
}

.dropdown-button:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.dropdown-button[aria-expanded="true"] {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.dropdown-button-text {
    flex: 1;
    color: #111827;
}

.dropdown-button[data-placeholder="true"] .dropdown-button-text {
    color: #9ca3af;
}

.dropdown-arrow {
    width: 1.25rem;
    height: 1.25rem;
    color: #6b7280;
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-left: 0.75rem;
}

.dropdown-button[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
}

/* OCR-filled dropdown visual feedback */
.dropdown-button.ocr-filled {
    border-left: 4px solid #10b981;
    background-color: #f0fdf4;
    position: relative;
    padding-right: 2.5rem;
}

.dropdown-button.ocr-filled::after {
    content: '✓';
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #10b981;
    font-weight: bold;
    font-size: 1rem;
    pointer-events: none;
}

.dropdown-button.ocr-filled-warning {
    border-left-color: #f59e0b;
    background-color: #fffbeb;
}

.dropdown-button.ocr-filled-warning::after {
    content: '⚠';
    color: #f59e0b;
}

.dropdown-button.ocr-filled:focus,
.dropdown-button.ocr-filled-warning:focus {
    border-left-color: #059669;
    background-color: #ffffff;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 100;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-option {
    width: 100%;
    min-height: 44px;
    /* WCAG AA compliant touch target */
    min-width: 44px;
    /* Ensure minimum width */
    padding: 0.75rem 1rem;
    text-align: left;
    background: none;
    border: none;
    color: #111827;
    font-size: 16px;
    /* Prevents iOS zoom */
    cursor: pointer;
    transition: background-color 0.15s ease;
    display: flex;
    align-items: center;
    touch-action: manipulation;
    /* Prevent double-tap zoom */
    -webkit-tap-highlight-color: transparent;
    /* Remove tap highlight */
}

.dropdown-option:hover {
    background: #f3f4f6;
}

.dropdown-option:focus {
    outline: 2px solid #2563eb;
    outline-offset: -2px;
    background: #e5e7eb;
}

.dropdown-option:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: -2px;
}

.dropdown-option.selected {
    background: #dbeafe;
    color: #1e40af;
    font-weight: 600;
}

/* ============================================================================
   Checkbox Group
   ============================================================================ */

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    /* Increased from 0.75rem for better touch target spacing (minimum 8px between) */
}

.checkbox-item {
    display: flex;
    align-items: center;
    min-height: 44px;
    /* WCAG AA compliant touch target */
    min-width: 44px;
    /* Ensure minimum width */
    padding: 0.75rem 1rem;
    /* Increased horizontal padding for better touch area */
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    touch-action: manipulation;
    /* Prevent double-tap zoom */
    -webkit-tap-highlight-color: transparent;
    /* Remove tap highlight */
}

.checkbox-item:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

.checkbox-item:focus-within {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-color: #2563eb;
}

.checkbox-input:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.checkbox-input:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.checkbox-item:has(.checkbox-input:checked) {
    border-color: #2563eb;
    background: #eff6ff;
}

.checkbox-input {
    width: 1.25rem;
    height: 1.25rem;
    min-width: 1.25rem;
    /* Ensure checkbox doesn't shrink */
    min-height: 1.25rem;
    /* Ensure checkbox doesn't shrink */
    margin-right: 0.75rem;
    cursor: pointer;
    flex-shrink: 0;
    touch-action: manipulation;
    /* Prevent double-tap zoom */
}

.checkbox-label {
    flex: 1;
    font-size: 16px;
    color: #111827;
    cursor: pointer;
}

/* ============================================================================
   Feature Grid (Interessiert an)
   ============================================================================ */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 0.5rem;
}

/* Mobile: 2 columns */
@media (max-width: 640px) {
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

/* Desktop: Keep 3 columns (or optionally 4 if space allows) */
@media (min-width: 1024px) {
    .feature-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablet/desktop (3-col): center the last row when it has a single item (e.g. Checklisten) */
@media (min-width: 641px) {
    .feature-grid .feature-button:last-child:nth-child(3n+1) {
        grid-column: 2;
    }
}

.feature-button {
    min-height: 100px;
    min-width: 44px;
    padding: 1rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.feature-button:hover {
    border-color: #d1d5db;
    background: #f9fafb;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.feature-button:active {
    transform: translateY(0);
    border-color: #1d4ed8;
    background: #dbeafe;
}

.feature-button:focus-within {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-color: #2563eb;
}

/* Selected state - using :has() selector */
.feature-button:has(.feature-checkbox:checked) {
    border-color: #2563eb;
    background: #eff6ff;
}

.feature-button:has(.feature-checkbox:checked) .feature-icon {
    color: #2563eb;
}

.feature-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.feature-checkbox:focus {
    outline: none;
}

.feature-checkbox:focus-visible {
    outline: none;
}

.feature-icon {
    width: 2rem;
    height: 2rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.feature-button:has(.feature-checkbox:checked) .feature-icon {
    color: #2563eb;
}

.feature-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #111827;
    line-height: 1.4;
    word-wrap: break-word;
    hyphens: auto;
}

.feature-button:has(.feature-checkbox:checked) .feature-label {
    color: #1e40af;
    font-weight: 600;
}

/* Mobile adjustments */
@media (max-width: 640px) {
    .feature-button {
        min-height: 90px;
        padding: 0.75rem 0.5rem;
    }

    .feature-icon {
        width: 1.75rem;
        height: 1.75rem;
        margin-bottom: 0.375rem;
    }

    .feature-label {
        font-size: 0.8125rem;
    }
}

/* ============================================================================
   Submit Button
   ============================================================================ */

.form-submit-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e5e7eb;
}

.form-submit-button {
    width: 100%;
    min-height: 56px;
    /* Exceeds 44px minimum for primary CTA */
    min-width: 44px;
    /* Ensure minimum width */
    padding: 0.875rem 1.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(to right, #2563eb, #1d4ed8);
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    touch-action: manipulation;
    /* Prevent double-tap zoom */
    -webkit-tap-highlight-color: transparent;
    /* Remove tap highlight */
}

.form-submit-button:hover:not(:disabled) {
    background: linear-gradient(to right, #1d4ed8, #1e40af);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.form-submit-button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-submit-button:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.button-loading {
    display: inline-flex;
    align-items: center;
}

/* ============================================================================
   Success State
   ============================================================================ */

.success-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.success-content {
    max-width: 500px;
    margin: 0 auto;
}

/* Success icon - centered checkmark using flexbox */
.success-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    color: #10b981;
    margin-bottom: 1.5rem;
}

.success-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
}

.success-message {
    font-size: 1rem;
    color: #6b7280;
    margin-bottom: 2rem;
}

.success-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 640px) {
    .success-actions {
        flex-direction: row;
        justify-content: center;
    }
}

.success-button-primary,
.success-button-secondary {
    min-height: 56px;
    /* Increased from 44px for primary actions */
    min-width: 44px;
    padding: 0.875rem 1.5rem;
    font-size: 1.125rem;
    /* Increased from 1rem */
    font-weight: 600;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.success-button-primary {
    background: linear-gradient(to right, #2563eb, #1d4ed8);
    color: white;
}

.success-button-primary:hover {
    background: linear-gradient(to right, #1d4ed8, #1e40af);
}

.success-button-secondary {
    background: white;
    color: #374151;
    border: 2px solid #d1d5db;
}

.success-button-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

/* ============================================================================
   Error State
   ============================================================================ */

.error-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.error-content {
    max-width: 500px;
    margin: 0 auto;
}

.error-icon {
    color: #ef4444;
    margin-bottom: 1.5rem;
}

.error-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
}

.error-message {
    font-size: 1rem;
    color: #6b7280;
    margin-bottom: 2rem;
}

.error-button {
    min-height: 44px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(to right, #2563eb, #1d4ed8);
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.error-button:hover {
    background: linear-gradient(to right, #1d4ed8, #1e40af);
}

/* ============================================================================
   Mobile Optimizations
   ============================================================================ */

@media (max-width: 640px) {
    .event-form-container {
        padding: 1rem;
    }

    .form-section-title {
        font-size: 1.125rem;
    }

    .camera-scan-button {
        font-size: 1rem;
        min-height: 56px;
    }

    .form-submit-button {
        font-size: 1rem;
        min-height: 52px;
    }
}

/* ============================================================================
   Accessibility
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* ============================================================================
   Print Styles
   ============================================================================ */

@media print {

    .camera-scan-section,
    .camera-modal,
    .ocr-processing,
    .form-submit-section {
        display: none !important;
    }
}