/**
 * Tobalt Frontend Booking Form
 * Multi-step booking form with validation
 *
 * Author: Tobalt — https://tobalt.lt
 */

/* Booking Form Container */
.tobalt-booking-form-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--tobalt-space-3);
    background: white;
    border-radius: var(--tobalt-border-radius);
    box-shadow: var(--tobalt-shadow-sm);
}

/* Form Header */
.tobalt-booking-form-header {
    margin-bottom: var(--tobalt-space-4);
    padding-bottom: var(--tobalt-space-3);
    border-bottom: var(--tobalt-border-width) solid var(--tobalt-border-color);
}

.tobalt-booking-form-title {
    font-size: var(--tobalt-font-size-2xl);
    font-weight: var(--tobalt-font-weight-semibold);
    color: var(--tobalt-gray-900);
    margin: 0 0 var(--tobalt-space-1);
}

.tobalt-booking-form-subtitle {
    font-size: var(--tobalt-font-size-sm);
    color: var(--tobalt-gray-600);
    margin: 0;
}

/* Progress Steps */
.tobalt-booking-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--tobalt-space-4);
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.tobalt-booking-step {
    flex: 1;
    position: relative;
    text-align: center;
    counter-increment: step;
}

.tobalt-booking-step::before {
    content: counter(step);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0 auto var(--tobalt-space-1);
    background: var(--tobalt-gray-100);
    border: 2px solid var(--tobalt-gray-300);
    border-radius: 50%;
    font-size: var(--tobalt-font-size-sm);
    font-weight: var(--tobalt-font-weight-bold);
    color: var(--tobalt-gray-600);
    transition: all var(--tobalt-transition-fast);
}

.tobalt-booking-step::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    right: -50%;
    height: 2px;
    background: var(--tobalt-gray-300);
    z-index: -1;
}

.tobalt-booking-step:last-child::after {
    display: none;
}

.tobalt-booking-step.active::before {
    background: var(--tobalt-primary);
    border-color: var(--tobalt-primary);
    color: white;
}

.tobalt-booking-step.completed::before {
    background: var(--tobalt-success);
    border-color: var(--tobalt-success);
    color: white;
    content: '✓';
}

.tobalt-booking-step.completed::after {
    background: var(--tobalt-success);
}

.tobalt-step-label {
    display: block;
    font-size: var(--tobalt-font-size-xs);
    font-weight: var(--tobalt-font-weight-medium);
    color: var(--tobalt-gray-600);
}

.tobalt-booking-step.active .tobalt-step-label {
    color: var(--tobalt-primary);
}

/* Form Sections */
.tobalt-form-section {
    display: none;
    animation: fadeIn var(--tobalt-transition-base);
}

.tobalt-form-section.active {
    display: block;
}

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

.tobalt-section-title {
    font-size: var(--tobalt-font-size-lg);
    font-weight: var(--tobalt-font-weight-semibold);
    color: var(--tobalt-gray-900);
    margin: 0 0 var(--tobalt-space-3);
}

.tobalt-section-description {
    font-size: var(--tobalt-font-size-sm);
    color: var(--tobalt-gray-600);
    margin: 0 0 var(--tobalt-space-3);
}

/* Hall Preview */
.tobalt-hall-preview {
    display: flex;
    gap: var(--tobalt-space-3);
    padding: var(--tobalt-space-3);
    margin-bottom: var(--tobalt-space-3);
    background: var(--tobalt-gray-50);
    border-radius: var(--tobalt-border-radius);
    border: var(--tobalt-border-width) solid var(--tobalt-border-color);
}

.tobalt-hall-preview-image {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: var(--tobalt-border-radius);
}

.tobalt-hall-preview-details h3 {
    margin: 0 0 var(--tobalt-space-1);
    font-size: var(--tobalt-font-size-base);
    font-weight: var(--tobalt-font-weight-semibold);
    color: var(--tobalt-gray-900);
}

.tobalt-hall-preview-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--tobalt-space-2);
    font-size: var(--tobalt-font-size-sm);
    color: var(--tobalt-gray-600);
}

.tobalt-hall-preview-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Form Fields */
.tobalt-form-grid {
    display: grid;
    gap: var(--tobalt-space-3);
}

.tobalt-form-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.tobalt-form-group {
    margin-bottom: var(--tobalt-space-3);
}

.tobalt-form-label {
    display: block;
    margin-bottom: var(--tobalt-space-1);
    font-size: var(--tobalt-font-size-sm);
    font-weight: var(--tobalt-font-weight-medium);
    color: var(--tobalt-gray-700);
}

.tobalt-form-label .required {
    color: var(--tobalt-error);
}

.tobalt-form-input,
.tobalt-form-select,
.tobalt-form-textarea {
    width: 100%;
    padding: 12px var(--tobalt-space-2);
    font-family: var(--tobalt-font-family);
    font-size: var(--tobalt-font-size-base);
    line-height: var(--tobalt-line-height-normal);
    color: var(--tobalt-gray-800);
    background-color: white;
    border: var(--tobalt-border-width) solid var(--tobalt-gray-300);
    border-radius: var(--tobalt-border-radius);
    transition: all var(--tobalt-transition-fast);
}

.tobalt-form-input:focus,
.tobalt-form-select:focus,
.tobalt-form-textarea:focus {
    outline: none;
    border-color: var(--tobalt-primary);
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.tobalt-form-input.error,
.tobalt-form-select.error,
.tobalt-form-textarea.error {
    border-color: var(--tobalt-error);
}

.tobalt-form-input.error:focus,
.tobalt-form-select.error:focus,
.tobalt-form-textarea.error:focus {
    box-shadow: 0 0 0 3px rgba(245, 101, 101, 0.1);
}

.tobalt-form-textarea {
    min-height: 100px;
    resize: vertical;
}

.tobalt-form-help {
    display: block;
    margin-top: var(--tobalt-space-1);
    font-size: var(--tobalt-font-size-xs);
    color: var(--tobalt-gray-500);
}

.tobalt-form-error {
    display: none;
    margin-top: var(--tobalt-space-1);
    padding: var(--tobalt-space-1) var(--tobalt-space-2);
    background: var(--tobalt-error-light);
    border-left: 3px solid var(--tobalt-error);
    border-radius: var(--tobalt-border-radius-sm);
    font-size: var(--tobalt-font-size-xs);
    color: #742A2A;
}

.tobalt-form-error.visible {
    display: block;
}

/* Date/Time Selection */
.tobalt-datetime-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--tobalt-space-2);
    margin-bottom: var(--tobalt-space-3);
}

.tobalt-time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: var(--tobalt-space-1);
    margin-top: var(--tobalt-space-2);
}

.tobalt-time-slot-option {
    padding: var(--tobalt-space-2);
    background: white;
    border: var(--tobalt-border-width) solid var(--tobalt-gray-300);
    border-radius: var(--tobalt-border-radius);
    text-align: center;
    font-size: var(--tobalt-font-size-sm);
    cursor: pointer;
    transition: all var(--tobalt-transition-fast);
}

.tobalt-time-slot-option:hover:not(.disabled) {
    border-color: var(--tobalt-primary);
    background: var(--tobalt-primary-light);
}

.tobalt-time-slot-option.selected {
    background: var(--tobalt-primary);
    border-color: var(--tobalt-primary);
    color: white;
    font-weight: var(--tobalt-font-weight-medium);
}

.tobalt-time-slot-option.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--tobalt-gray-100);
}

/* Duration Selector */
.tobalt-duration-options {
    display: flex;
    gap: var(--tobalt-space-1);
    margin-top: var(--tobalt-space-2);
}

.tobalt-duration-option {
    flex: 1;
    padding: var(--tobalt-space-2);
    background: white;
    border: var(--tobalt-border-width) solid var(--tobalt-gray-300);
    border-radius: var(--tobalt-border-radius);
    text-align: center;
    font-size: var(--tobalt-font-size-sm);
    cursor: pointer;
    transition: all var(--tobalt-transition-fast);
}

.tobalt-duration-option:hover {
    border-color: var(--tobalt-primary);
}

.tobalt-duration-option.selected {
    background: var(--tobalt-primary);
    border-color: var(--tobalt-primary);
    color: white;
    font-weight: var(--tobalt-font-weight-medium);
}

/* Booking Summary */
.tobalt-booking-summary {
    padding: var(--tobalt-space-3);
    background: var(--tobalt-gray-50);
    border-radius: var(--tobalt-border-radius);
    border-left: 4px solid var(--tobalt-primary);
    margin-bottom: var(--tobalt-space-3);
}

.tobalt-booking-summary h4 {
    margin: 0 0 var(--tobalt-space-2);
    font-size: var(--tobalt-font-size-base);
    font-weight: var(--tobalt-font-weight-semibold);
    color: var(--tobalt-gray-900);
}

.tobalt-summary-row {
    display: flex;
    justify-content: space-between;
    padding: var(--tobalt-space-1) 0;
    font-size: var(--tobalt-font-size-sm);
}

.tobalt-summary-label {
    color: var(--tobalt-gray-600);
}

.tobalt-summary-value {
    font-weight: var(--tobalt-font-weight-medium);
    color: var(--tobalt-gray-900);
}

.tobalt-summary-total {
    margin-top: var(--tobalt-space-2);
    padding-top: var(--tobalt-space-2);
    border-top: var(--tobalt-border-width) solid var(--tobalt-border-color);
}

.tobalt-summary-total .tobalt-summary-label {
    font-size: var(--tobalt-font-size-base);
    font-weight: var(--tobalt-font-weight-semibold);
    color: var(--tobalt-gray-900);
}

.tobalt-summary-total .tobalt-summary-value {
    font-size: var(--tobalt-font-size-xl);
    font-weight: var(--tobalt-font-weight-bold);
    color: var(--tobalt-primary);
}

/* Payment Methods */
.tobalt-payment-methods {
    display: grid;
    gap: var(--tobalt-space-2);
    margin-bottom: var(--tobalt-space-3);
}

.tobalt-payment-method {
    display: flex;
    align-items: center;
    gap: var(--tobalt-space-2);
    padding: var(--tobalt-space-2);
    background: white;
    border: 2px solid var(--tobalt-gray-300);
    border-radius: var(--tobalt-border-radius);
    cursor: pointer;
    transition: all var(--tobalt-transition-fast);
}

.tobalt-payment-method:hover {
    border-color: var(--tobalt-primary);
}

.tobalt-payment-method.selected {
    border-color: var(--tobalt-primary);
    background: var(--tobalt-primary-light);
}

.tobalt-payment-method input[type="radio"] {
    margin: 0;
}

.tobalt-payment-method-details {
    flex: 1;
}

.tobalt-payment-method-name {
    display: block;
    font-weight: var(--tobalt-font-weight-medium);
    color: var(--tobalt-gray-900);
    margin-bottom: 2px;
}

.tobalt-payment-method-description {
    display: block;
    font-size: var(--tobalt-font-size-xs);
    color: var(--tobalt-gray-600);
}

.tobalt-payment-method-logo {
    height: 30px;
    width: auto;
}

/* Terms Acceptance */
.tobalt-terms-acceptance {
    margin-bottom: var(--tobalt-space-3);
}

.tobalt-checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: var(--tobalt-space-1);
    padding: var(--tobalt-space-2);
    background: var(--tobalt-gray-50);
    border-radius: var(--tobalt-border-radius);
}

.tobalt-checkbox-wrapper input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
}

.tobalt-checkbox-label {
    font-size: var(--tobalt-font-size-sm);
    color: var(--tobalt-gray-700);
    cursor: pointer;
}

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

/* Form Actions */
.tobalt-form-actions {
    display: flex;
    gap: var(--tobalt-space-2);
    justify-content: space-between;
    margin-top: var(--tobalt-space-4);
    padding-top: var(--tobalt-space-3);
    border-top: var(--tobalt-border-width) solid var(--tobalt-border-color);
}

.tobalt-btn-back,
.tobalt-btn-next,
.tobalt-btn-submit {
    padding: 12px var(--tobalt-space-4);
    min-height: var(--tobalt-min-touch);
    font-family: var(--tobalt-font-family);
    font-size: var(--tobalt-font-size-base);
    font-weight: var(--tobalt-font-weight-medium);
    border-radius: var(--tobalt-border-radius);
    cursor: pointer;
    transition: all var(--tobalt-transition-fast);
    border: none;
}

.tobalt-btn-back {
    background: white;
    color: var(--tobalt-gray-700);
    border: var(--tobalt-border-width) solid var(--tobalt-gray-300);
}

.tobalt-btn-back:hover {
    border-color: var(--tobalt-gray-400);
    color: var(--tobalt-gray-900);
}

.tobalt-btn-next,
.tobalt-btn-submit {
    background: var(--tobalt-primary);
    color: white;
    border: var(--tobalt-border-width) solid var(--tobalt-primary);
}

.tobalt-btn-next:hover,
.tobalt-btn-submit:hover {
    background: var(--tobalt-primary-dark);
}

.tobalt-btn-next:disabled,
.tobalt-btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading State */
.tobalt-form-loading {
    position: relative;
}

.tobalt-form-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--tobalt-border-radius);
    z-index: 10;
}

.tobalt-form-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid var(--tobalt-gray-200);
    border-top-color: var(--tobalt-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 11;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Success/Error Messages */
.tobalt-form-message {
    padding: var(--tobalt-space-3);
    margin-bottom: var(--tobalt-space-3);
    border-radius: var(--tobalt-border-radius);
    font-size: var(--tobalt-font-size-sm);
}

.tobalt-form-message.success {
    background: var(--tobalt-success-light);
    color: #22543D;
    border-left: 4px solid var(--tobalt-success);
}

.tobalt-form-message.error {
    background: var(--tobalt-error-light);
    color: #742A2A;
    border-left: 4px solid var(--tobalt-error);
}

.tobalt-form-message h4 {
    margin: 0 0 var(--tobalt-space-1);
    font-size: var(--tobalt-font-size-base);
    font-weight: var(--tobalt-font-weight-semibold);
}

.tobalt-form-message p {
    margin: 0;
}

/* Responsive */
@media (max-width: 782px) {
    .tobalt-booking-form-wrapper {
        padding: var(--tobalt-space-2);
    }

    .tobalt-booking-steps {
        flex-wrap: wrap;
    }

    .tobalt-booking-step {
        flex-basis: 50%;
        margin-bottom: var(--tobalt-space-2);
    }

    .tobalt-booking-step:nth-child(odd)::after {
        right: 0;
    }

    .tobalt-hall-preview {
        flex-direction: column;
    }

    .tobalt-hall-preview-image {
        width: 100%;
        height: 200px;
    }

    .tobalt-form-grid-2,
    .tobalt-datetime-selector {
        grid-template-columns: 1fr;
    }

    .tobalt-time-slots {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }

    .tobalt-form-actions {
        flex-direction: column-reverse;
    }

    .tobalt-btn-back,
    .tobalt-btn-next,
    .tobalt-btn-submit {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .tobalt-booking-step {
        flex-basis: 100%;
    }

    .tobalt-booking-step::after {
        display: none;
    }

    .tobalt-step-label {
        font-size: 10px;
    }

    .tobalt-duration-options {
        flex-direction: column;
    }
}
