/* Public Form - Two Column Layout with Sticky Sidebar */

/* Container */
.public-form-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1rem 0 1rem;
    background: #f9fafb;
    min-height: 100vh;
    scroll-behavior: smooth;
}

/* Two Column Layout */
.public-form-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

/* Left Sidebar - Navigation Stepper */
.public-form-sidebar {
    width: 256px;
    flex-shrink: 0;
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Sidebar Logo */
.sidebar-logo {
    display: block;
    flex-shrink: 0;
    overflow: visible;
    padding: 0;
    margin: 0 0 1rem 0;
    text-align: center;
    min-height: fit-content;
}

.sidebar-logo img {
    max-width: 80%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Auto-save Indicator */
.auto-save-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    font-size: 0.75rem;
    color: #6b7280;
    transition: all 0.2s;
}

.auto-save-icon {
    width: 0.875rem;
    height: 0.875rem;
    color: #10b981;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.auto-save-text {
    color: #6b7280;
    font-size: 0.75rem;
    transition: color 0.3s;
    flex: 1;
}

.auto-save-clear {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

.auto-save-clear:hover {
    background: #f3f4f6;
    color: #ef4444;
}

.auto-save-clear:active {
    transform: scale(0.95);
}

/* Vertical Stepper - Timeline Style */
.form-stepper {
    background: white;
    border-radius: 1rem;
    padding: 0;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

/* Continuous vertical line connecting all steps */
.form-stepper::before {
    content: '';
    position: absolute;
    left: 1.5rem;
    top: 1rem;
    bottom: 1rem;
    width: 1px;
    background: #e5e7eb;
    z-index: 0;
}

.stepper-item {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    padding: 1rem 0;
    cursor: pointer;
    transition: all 0.2s;
    gap: 0.75rem;
    background: transparent;
}

.stepper-icon-wrapper {
    position: relative;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 1;
}

.stepper-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    background: white;
    transition: all 0.2s;
    position: relative;
}

/* Active Step - Solid Teal Circle */
.stepper-item.active .stepper-dot {
    width: 1rem;
    height: 1rem;
    border: 2px solid #0d9488;
    background: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.stepper-item.active .stepper-label {
    color: #0f766e;
    font-weight: 700;
    font-size: 0.9375rem;
}

/* Completed Step - Green Checkmark Circle */
.stepper-checkmark {
    position: absolute;
    width: 1rem;
    height: 1rem;
    color: #10b981;
    display: none;
    z-index: 2;
}

.stepper-item.completed .stepper-dot {
    width: 1rem;
    height: 1rem;
    border: 2px solid #10b981;
    background: #d1fae5;
}

.stepper-item.completed .stepper-checkmark {
    display: block;
}

.stepper-item.completed .stepper-label {
    color: #111827;
    font-weight: 400;
}

/* Future Step - Hollow Gray Circle */
.stepper-item:not(.active):not(.completed) .stepper-dot {
    width: 0.5rem;
    height: 0.5rem;
    border: 2px solid #d1d5db;
    background: white;
}

.stepper-item:not(.active):not(.completed) .stepper-label {
    color: #9ca3af;
    font-weight: 400;
}

.stepper-item:not(.active):not(.completed):hover .stepper-label {
    color: #6b7280;
}

.stepper-label {
    font-size: 0.875rem;
    transition: all 0.2s;
    line-height: 1.4;
    flex: 1;
}

/* Main Content Area */
.public-form-content {
    flex: 1;
    min-width: 0;
}

/* Welcome Header - Clean & Minimalist */
.form-welcome {
    background: transparent;
    padding: 0;
    margin-bottom: 2rem;
    border: none;
    box-shadow: none;
}

.form-welcome h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.form-welcome-subtitle {
    color: #6b7280;
    font-size: 1.125rem;
    line-height: 1.6;
    margin: 0 0 1.5rem 0;
}

/* Info Accordion */
.info-accordion {
    margin-top: 1.5rem;
}

.info-accordion-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 0.5rem;
    color: #1e40af;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.info-accordion-toggle:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}

.info-accordion-toggle[aria-expanded="true"] {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: none;
}

.info-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    color: #3b82f6;
}

.accordion-chevron {
    width: 1rem;
    height: 1rem;
    margin-left: auto;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.info-accordion-toggle[aria-expanded="true"] .accordion-chevron {
    transform: rotate(180deg);
}

.info-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.info-accordion-content.expanded {
    max-height: 1000px;
    transition: max-height 0.5s ease-in;
}

.info-card {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-top: none;
    border-radius: 0 0 0.5rem 0.5rem;
    padding: 1.5rem;
    color: #1e3a8a;
    font-size: 0.875rem;
    line-height: 1.6;
    position: relative;
}

.info-card-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    transition: all 0.2s;
    z-index: 10;
}

.info-card-close:hover {
    background: rgba(255, 255, 255, 0.7);
    color: #1e3a8a;
}

.info-card-close:active {
    transform: scale(0.95);
}

.info-card p {
    margin-bottom: 1rem;
    color: #1e3a8a;
}

.info-card p:last-child {
    margin-bottom: 0;
}

.info-card strong {
    color: #1e40af;
    font-weight: 600;
}

.info-card a {
    color: #2563eb;
    text-decoration: underline;
}

.info-card a:hover {
    color: #1d4ed8;
}

/* Intro Section Styling */
.intro-content {
    display: block;
    margin-bottom: 2rem;
}

.intro-section.intro-single {
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
}

.intro-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.intro-list li {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.intro-list-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: #f0fdfa;
    border: 1px solid #99f6e4;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #14b8a6;
}

.intro-list-icon svg {
    width: 1.2rem;
    height: 1.2rem;
}

.intro-list-body h4 {
    margin: 0 0 0.35rem 0;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.intro-list-body p {
    margin: 0 0 0.35rem 0;
    color: #374151;
    line-height: 1.6;
}

.intro-list-body p:last-child {
    margin-bottom: 0;
}

.intro-list-body strong {
    color: #0f766e;
    font-weight: 700;
}

.intro-list-body a {
    color: #0d9488;
    text-decoration: underline;
}

.intro-list-body a:hover {
    color: #0d9488;
}

.intro-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.btn-intro-next {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.75rem;
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-intro-next:hover {
    background: linear-gradient(135deg, #0d9488, #0f766e);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.btn-intro-next:active {
    transform: translateY(0);
}

.btn-intro-next svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

/* Form Section Cards */
.form-section-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    scroll-margin-top: 2rem;
}

.form-section-card:last-child {
    margin-bottom: 0;
}

.form-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.form-section-title svg {
    width: 1.5rem;
    height: 1.5rem;
    color: #14b8a6;
    flex-shrink: 0;
}

.form-section-note {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border-radius: 0.5rem;
    border-left: 3px solid #14b8a6;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-group label .required {
    color: #ef4444;
    margin-left: 0.25rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    background: white;
    color: #111827;
    transition: all 0.2s;
}

.form-group input:hover,
.form-group textarea:hover,
.form-group select:hover {
    border-color: #9ca3af;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #14b8a6;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

/* Error state - only shown after blur or submit */
.form-group input.error,
.form-group textarea.error,
.form-group select.error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.form-group input.error:focus,
.form-group textarea.error:focus,
.form-group select.error:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Valid state */
.form-group input.valid:not(:focus),
.form-group textarea.valid:not(:focus),
.form-group select.valid:not(:focus) {
    border-color: #10b981;
}

/* Override global invalid styling for public form:
   Keep neutral borders on load; errors appear only via JS classes */
.public-form-container input:invalid:not(:focus),
.public-form-container textarea:invalid:not(:focus),
.public-form-container select:invalid:not(:focus) {
    border-color: #d1d5db;
    background: #ffffff;
    box-shadow: none;
}

.form-group small {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.5rem;
    font-weight: 400;
}

/* Error text styling - distinct from helper text */
.field-error {
    display: block;
    color: #ef4444 !important;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    font-weight: 500;
}

.field-error.hidden {
    display: none;
}

/* Ensure helper text stays gray even when error is shown */
.form-group:has(.field-error) small {
    color: #6b7280 !important;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

/* Toggle Chips for Amenities */
.amenity-chips-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .amenity-chips-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .amenity-chips-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.amenity-chip {
    position: relative;
    display: block;
}

.amenity-chip input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.amenity-chip label {
    display: block;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
    background: white;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    margin: 0;
}

.amenity-chip label:hover {
    border-color: #14b8a6;
    background: #f0fdfa;
    transform: translateY(-1px);
}

.amenity-chip input[type="checkbox"]:checked + label {
    background: #14b8a6;
    border-color: #14b8a6;
    color: white;
    font-weight: 600;
}

.amenity-chip input[type="checkbox"]:focus + label {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

/* Photo Upload - Drag & Drop */
.photo-upload-zone {
    border: 2px dashed #d1d5db;
    border-radius: 0.75rem;
    padding: 3rem 2rem;
    text-align: center;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 1.5rem;
}

.photo-upload-zone:hover {
    border-color: #14b8a6;
    background: #f0fdfa;
}

.photo-upload-zone.dragover {
    border-color: #14b8a6;
    background: #ecfeff;
    transform: scale(1.02);
}

.photo-upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    color: #9ca3af;
}

.photo-upload-zone:hover .photo-upload-icon {
    color: #14b8a6;
}

.photo-upload-text {
    font-size: 1rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.photo-upload-hint {
    font-size: 0.875rem;
    color: #6b7280;
}

.photo-upload-zone input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Map Section */
.map-container {
    margin-bottom: 1.5rem;
    position: relative;
}

.map-search {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    margin-bottom: 1rem;
    transition: all 0.2s;
}

.map-search:focus {
    outline: none;
    border-color: #14b8a6;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

.map-search-container {
    position: relative;
    margin-bottom: 1rem;
}

#search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    border: 1.5px solid #d1d5db;
    border-radius: 0.5rem;
}

#search-results.hidden {
    display: none;
}

.search-result-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    background: var(--bg-white);
}

.search-result-item:hover {
    background: var(--bg-light);
}

.search-result-no-results {
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-top: 0.5rem;
}

#map {
    height: 450px;
    width: 100%;
    border-radius: 0.75rem;
    border: 1.5px solid #d1d5db;
    overflow: hidden;
}

/* Submit Section */
.form-submit-section {
    background: transparent;
    border-radius: 0;
    padding: 2rem 0;
    margin-top: 2rem;
    margin-bottom: 0;
    box-shadow: none;
    border: none;
}

.submit-button {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.submit-button:hover {
    background: linear-gradient(135deg, #0d9488, #0f766e);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.submit-button:active {
    transform: translateY(0);
}

.submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.security-note svg {
    width: 1rem;
    height: 1rem;
    color: #10b981;
}

/* Mobile Progress Bar */
.mobile-progress {
    display: none;
    position: sticky;
    top: 0;
    z-index: 100;
    background: white;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    margin: -2rem -1rem 2rem -1rem;
}

.mobile-progress-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-progress-text {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.mobile-progress-bar {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.mobile-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #14b8a6, #0d9488);
    transition: width 0.3s ease;
    border-radius: 3px;
    width: var(--progress-width, 14.29%); /* Počáteční hodnota pro první krok (1/7) */
}

/* Mobile Responsive */
@media (max-width: 1023px) {
    .public-form-sidebar {
        display: none;
    }
    
    .mobile-progress {
        display: block;
    }
    
    .public-form-layout {
        flex-direction: column;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .amenity-chips-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-welcome h1 {
        font-size: 1.75rem;
    }
    
    .form-welcome-subtitle {
        font-size: 1rem;
    }
}

@media (max-width: 640px) {
    .public-form-container {
        padding: 1rem 0.5rem;
    }
    
    .form-section-card,
    .form-welcome,
    .form-submit-section {
        padding: 1.5rem;
        border-radius: 0.75rem;
    }
    
    .amenity-chips-grid {
        grid-template-columns: 1fr;
    }
}

/* Radio Group Styling */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.radio-group label {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0;
}

.radio-group label:hover {
    border-color: #14b8a6;
    background: #f0fdfa;
}

.radio-group input[type="radio"] {
    width: auto;
    margin-right: 0.75rem;
    accent-color: #14b8a6;
}

.radio-group input[type="radio"]:checked + span,
.radio-group label:has(input[type="radio"]:checked) {
    border-color: #14b8a6;
    background: #f0fdfa;
    font-weight: 500;
}

/* Loading overlay and progress bar */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    min-width: 300px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #14b8a6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-progress-container {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.loading-progress-text {
    font-size: 1rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.75rem;
}

.loading-progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    position: relative;
}

.loading-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #14b8a6, #0d9488);
    border-radius: 4px;
    width: var(--progress-bar-width, 0%);
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.loading-progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.loading-progress-percentage {
    font-size: 0.875rem;
    font-weight: 600;
    color: #14b8a6;
    margin-top: 0.25rem;
}

.loading-success-message {
    font-size: 1rem;
    font-weight: 500;
    color: #059669;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: #d1fae5;
    border-radius: 0.375rem;
    border: 1px solid #10b981;
    text-align: center;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Utility classes for CSP compliance (no inline styles)
   ======================================== */

/* Hidden utility class */
.hidden {
    display: none !important;
}

/* Form submit note styling */
.form-submit-note {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
    text-align: center;
    font-style: italic;
}

/* Auto-save clear button visibility */
.auto-save-clear.hidden {
    display: none;
}

.auto-save-clear:not(.hidden) {
    display: flex;
}

/* Info accordion fade out animation */
.info-accordion-fade-out {
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
    opacity: 0;
    transform: translateY(-10px);
}

/* Auto-save icon animation */
.auto-save-icon-scale {
    transform: scale(1.2);
    transition: transform 0.2s;
}

.auto-save-icon-normal {
    transform: scale(1);
}

/* Auto-save text color */
.auto-save-text-success {
    color: #10b981;
}

/* Fixed notification message */
.form-message-fixed {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    padding: 1rem;
    border-radius: 0.5rem;
}

.form-message-inner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Fade out animation */
.fade-out {
    animation: fadeOut 0.3s ease-out;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Photo preview styles for CSP compliance */
.photo-error-message {
    margin-bottom: 1rem;
    padding: 1rem;
    background: #fee;
    border: 2px solid #fcc;
    border-radius: 0.5rem;
    color: #c33;
}

.photo-counter {
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.photo-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.photo-preview-container {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 2px solid var(--border-color);
}

.photo-preview-container.invalid {
    border-color: #fcc;
    background: #fee;
    opacity: 0.8;
}

.photo-preview-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.photo-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    padding: 0.5rem;
}

.photo-preview-container:hover .photo-preview-overlay {
    opacity: 1;
}

.photo-preview-filename {
    color: white;
    font-size: 0.75rem;
    text-align: center;
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.photo-preview-filesize {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.7rem;
}

.photo-preview-warning {
    color: #ffcccc;
    font-size: 0.7rem;
    font-weight: bold;
    margin-top: 0.25rem;
}

.photo-preview-remove-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.photo-preview-remove-btn:hover {
    background: rgba(220, 38, 38, 1);
    transform: scale(1.1);
}

/* Form message visibility */
.form-message.hidden {
    display: none;
}

/* Shake animation for invalid fields */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.field-shake {
    animation: shake 0.5s;
}

/* Explanation list styling */
.explanation-list {
    margin-top: 0.5rem;
    margin-bottom: 0;
    padding-left: 1.5rem;
    list-style-type: disc;
}

.explanation-list li {
    margin-bottom: 0.5rem;
}
