/**
 * Frontend Form Styles - VOLLSTÄNDIG ÜBERARBEITET
 * AlphaLing Booking System
 *
 * Design-Verbesserungen:
 * - Professioneller Submit-Button mit Gradient
 * - Verbesserte Input-Felder (größer, besserer Focus)
 * - Moderne Section Headers mit Nummern
 * - Error States mit Animation
 * - Multi-Select Sprachen Styling
 * - Smooth Animations
 */

/* ===================================
   CSS Variables
   =================================== */
:root {
    --alphaling-primary: #235B83;
    --alphaling-primary-dark: #1e4a6b;
    --alphaling-success: #28a745;
    --alphaling-warning: #ffc107;
    --alphaling-danger: #dc3545;
    --alphaling-info: #17a2b8;
    --alphaling-light: #f8f9fa;
    --alphaling-dark: #343a40;
    --alphaling-border: #e5e7eb;
    --alphaling-text: #343a40;
    --alphaling-text-muted: #6c757d;
    --alphaling-bg-input: #fafbfc;
}

/* ===================================
   Container
   =================================== */
.alphaling-booking-wrapper {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.alphaling-booking-container {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(35, 91, 131, 0.12);
    border: 1px solid rgba(35, 91, 131, 0.08);
    overflow: hidden;
}

/* ===================================
   Messages (Success / Error)
   =================================== */
.alphaling-message {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 24px 28px;
    margin-bottom: 24px;
    border-radius: 12px;
    border-left: 4px solid;
    animation: slideInDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.alphaling-message-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-color: var(--alphaling-success);
    color: #155724;
}

.alphaling-message-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-color: var(--alphaling-danger);
    color: #721c24;
}

.alphaling-message-icon {
    flex-shrink: 0;
    color: inherit;
}

.alphaling-message-content h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 700;
}

.alphaling-message-content p {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
}

/* Error Summary */
.error-summary {
    background: #fef2f2;
    border: 2px solid #fecaca;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 24px;
    animation: slideInDown 0.3s ease-out;
}

.error-summary h4 {
    margin: 0 0 12px 0;
    color: #dc2626;
    font-size: 16px;
    font-weight: 700;
}

.error-summary ul {
    margin: 0;
    padding-left: 20px;
    color: #991b1b;
}

.error-summary ul li {
    margin: 6px 0;
    font-size: 14px;
}

/* ===================================
   Form
   =================================== */
.alphaling-form {
    padding: 48px 40px;
}

.alphaling-form-section {
    margin-bottom: 48px;
}

.alphaling-form-section:last-child {
    margin-bottom: 0;
}

/* Section Header - Neu gestaltet */
.alphaling-section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px 24px;
    border-left: 4px solid var(--alphaling-primary);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 28px;
}

.alphaling-section-number {
    width: 36px;
    height: 36px;
    background: var(--alphaling-primary);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

.alphaling-section-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--alphaling-primary);
    margin: 0;
}

/* Form Rows & Groups */
.alphaling-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.alphaling-form-row:last-child {
    margin-bottom: 0;
}

.alphaling-form-group {
    flex: 1;
    min-width: 0;
}

.alphaling-form-group-full {
    flex: 1 1 100%;
}

.alphaling-form-group-half {
    flex: 1 1 calc(50% - 10px);
}

.alphaling-form-group-quarter {
    flex: 1 1 calc(25% - 15px);
}

/* Labels */
.alphaling-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--alphaling-text);
    font-size: 14px;
}

.alphaling-required {
    color: var(--alphaling-danger);
    font-weight: 700;
}

.alphaling-help-text {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--alphaling-text-muted);
    line-height: 1.4;
}

/* Inputs - VERBESSERT */
.alphaling-input,
.alphaling-select,
.alphaling-textarea {
    width: 100%;
    height: 48px;
    padding: 14px 16px;
    border: 2px solid var(--alphaling-border);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--alphaling-bg-input);
    color: var(--alphaling-text);
}

.alphaling-input:focus,
.alphaling-select:focus,
.alphaling-textarea:focus {
    outline: none;
    border-color: var(--alphaling-primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(35, 91, 131, 0.08);
    transform: translateY(-1px);
}

.alphaling-input::placeholder {
    color: #9ca3af;
}

/* Error State */
.alphaling-input.error,
.alphaling-select.error,
.alphaling-textarea.error {
    border-color: #ef4444 !important;
    background: #fef2f2 !important;
    animation: shake 0.4s;
}

/* Field Error Message */
.field-error {
    display: block;
    margin-top: 8px;
    padding: 8px 12px;
    background: #fef2f2;
    color: #dc2626;
    font-size: 13px;
    border-radius: 6px;
    border-left: 3px solid #dc2626;
    animation: slideInDown 0.2s ease-out;
}

.alphaling-textarea {
    height: auto;
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

.alphaling-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23343a40' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 44px;
}

/* ===================================
   Duration Display - VERBESSERT
   =================================== */
.alphaling-duration-display {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-left: 4px solid var(--alphaling-info);
    border-radius: 10px;
    font-size: 15px;
    color: var(--alphaling-text);
    box-shadow: 0 2px 8px rgba(23, 162, 184, 0.1);
}

.alphaling-duration-display svg {
    color: var(--alphaling-info);
    flex-shrink: 0;
}

.alphaling-duration-display strong {
    color: var(--alphaling-primary);
}

/* Duration Color Codes */
.alphaling-duration-display.duration-short {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-left-color: #28a745;
}

.alphaling-duration-display.duration-medium {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%);
    border-left-color: #ffc107;
}

.alphaling-duration-display.duration-long {
    background: linear-gradient(135deg, #ffe4d6 0%, #ffd4b8 100%);
    border-left-color: #fd7e14;
}

.alphaling-duration-display.duration-verylong {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-left-color: #dc3545;
}

/* Validation Messages */
.alphaling-validation-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    animation: slideInDown 0.2s ease-out;
}

.alphaling-validation-message.error {
    background: #fef2f2;
    color: #991b1b;
    border-left: 4px solid #dc2626;
}

.alphaling-validation-message.warning {
    background: #fffbeb;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.alphaling-validation-message.info {
    background: #eff6ff;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

/* ===================================
   Language Multi-Select - NEU!
   =================================== */
.language-selection {
    margin-bottom: 24px;
}

.language-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.language-option {
    cursor: pointer;
    display: block;
    position: relative;
}

.language-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.language-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #f8f9fa;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.language-label:hover {
    border-color: var(--alphaling-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(35, 91, 131, 0.15);
}

.language-option input:checked + .language-label {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: var(--alphaling-primary);
    box-shadow: 0 0 0 4px rgba(35, 91, 131, 0.1);
}

.language-checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.language-option input:checked + .language-label .language-checkmark {
    background: var(--alphaling-primary);
    border-color: var(--alphaling-primary);
}

.language-option input:checked + .language-label .language-checkmark::after {
    content: '';
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

.language-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--alphaling-text);
}

/* Selected Languages Summary */
.selected-languages-summary {
    margin-top: 16px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-left: 4px solid #28a745;
    border-radius: 8px;
    font-size: 14px;
    color: #155724;
}

.selected-languages-summary strong {
    font-weight: 700;
}

/* ===================================
   Location Info - VERBESSERT
   =================================== */
.alphaling-location-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-left: 4px solid var(--alphaling-primary);
    border-radius: 8px;
    font-size: 14px;
    color: var(--alphaling-text);
    animation: slideInDown 0.3s ease-out;
}

.alphaling-location-info svg {
    color: var(--alphaling-primary);
    flex-shrink: 0;
}

.alphaling-location-info strong {
    color: var(--alphaling-primary);
    font-weight: 600;
}

/* ===================================
   File Upload - VERBESSERT
   =================================== */
.alphaling-file-upload-area {
    position: relative;
    border: 2px dashed var(--alphaling-border);
    border-radius: 12px;
    padding: 40px 24px;
    text-align: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    background: var(--alphaling-bg-input);
}

.alphaling-file-upload-area:hover {
    border-color: var(--alphaling-primary);
    background: rgba(35, 91, 131, 0.02);
    transform: translateY(-2px);
}

.alphaling-file-upload-area.dragging {
    border-color: var(--alphaling-primary);
    background: rgba(35, 91, 131, 0.08);
    border-width: 3px;
}

.alphaling-file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.alphaling-file-upload-icon {
    color: var(--alphaling-primary);
    margin-bottom: 16px;
}

.alphaling-file-upload-text {
    font-size: 16px;
    color: var(--alphaling-text);
    margin: 0 0 8px 0;
}

.alphaling-file-upload-link {
    color: var(--alphaling-primary);
    text-decoration: underline;
    font-weight: 600;
}

.alphaling-file-upload-hint {
    font-size: 13px;
    color: var(--alphaling-text-muted);
    margin: 0;
}

.alphaling-file-preview {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 10px;
    padding: 16px 20px;
}

.alphaling-file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--alphaling-text);
}

.alphaling-file-info svg {
    color: var(--alphaling-primary);
    flex-shrink: 0;
}

.alphaling-file-info span {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
}

.alphaling-file-remove {
    background: var(--alphaling-danger);
    color: #ffffff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

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

/* ===================================
   Submit Button - VOLLSTÄNDIG NEU!
   =================================== */
.alphaling-form-actions {
    margin-top: 48px;
    text-align: center;
}

.alphaling-submit-btn {
    width: 100%;
    height: 56px;
    background: linear-gradient(135deg, #235B83 0%, #1e4a6b 100%);
    color: #ffffff;
    border: none;
    padding: 0 48px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(35, 91, 131, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.alphaling-submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #1e4a6b 0%, #163956 100%);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(35, 91, 131, 0.35);
}

.alphaling-submit-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 4px 16px rgba(35, 91, 131, 0.2);
}

.alphaling-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.alphaling-btn-text {
    display: flex;
    align-items: center;
    gap: 10px;
}

.alphaling-btn-text svg {
    transition: transform 0.2s;
}

.alphaling-submit-btn:hover:not(:disabled) .alphaling-btn-text svg {
    transform: translateX(4px);
}

.alphaling-btn-loader {
    display: none;
    align-items: center;
    gap: 12px;
}

.alphaling-submit-btn.loading .alphaling-btn-text {
    display: none;
}

.alphaling-submit-btn.loading .alphaling-btn-loader {
    display: flex;
}

/* Spinner Animation */
.alphaling-spinner {
    animation: spin 1s linear infinite;
}

.alphaling-spinner .path {
    stroke: #ffffff;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

/* ===================================
   Animations
   =================================== */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

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

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(35, 91, 131, 0.5); }
    70% { box-shadow: 0 0 0 15px rgba(35, 91, 131, 0); }
    100% { box-shadow: 0 0 0 0 rgba(35, 91, 131, 0); }
}

/* Shake Animation for Form */
.alphaling-form.shake {
    animation: shake 0.5s;
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 768px) {
    .alphaling-booking-wrapper {
        margin: 20px auto;
        padding: 0 16px;
    }

    .alphaling-form {
        padding: 32px 24px;
    }

    .alphaling-section-header {
        padding: 16px 20px;
    }

    .alphaling-section-title {
        font-size: 19px;
    }

    .alphaling-section-number {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .alphaling-form-row {
        flex-direction: column;
        gap: 16px;
    }

    .alphaling-form-group-half,
    .alphaling-form-group-quarter {
        flex: 1 1 100%;
    }

    .language-grid {
        grid-template-columns: 1fr;
    }

    .alphaling-file-upload-area {
        padding: 32px 20px;
    }

    .alphaling-submit-btn {
        height: 52px;
        font-size: 15px;
    }

    .alphaling-message {
        padding: 20px;
        gap: 16px;
    }

    .alphaling-message-icon svg {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 480px) {
    .alphaling-form {
        padding: 24px 20px;
    }

    .alphaling-section-header {
        padding: 14px 18px;
        gap: 12px;
    }

    .alphaling-section-title {
        font-size: 17px;
    }

    .alphaling-input,
    .alphaling-select,
    .alphaling-textarea {
        height: 46px;
        padding: 12px 14px;
        font-size: 14px;
    }

    .alphaling-submit-btn {
        height: 50px;
        font-size: 14px;
        padding: 0 32px;
    }
}
