/**
 * Styles frontend du plugin Stage VTT
 */

/* Variables */
:root {
    --vtt-primary: #1a9e8f;
    --vtt-primary-dark: #158578;
    --vtt-primary-light: rgba(26, 158, 143, 0.1);
    --vtt-lime: #b4d455;
    --vtt-coral: #ff6b6b;
    --vtt-success: #28a745;
    --vtt-warning: #ffc107;
    --vtt-error: #dc3545;
    --vtt-gray-100: #f8f9fa;
    --vtt-gray-200: #e9ecef;
    --vtt-gray-500: #6c757d;
    --vtt-gray-700: #495057;
    --vtt-gray-900: #212529;
    --vtt-border-radius: 12px;
    --vtt-transition: 0.3s ease;
}

/* Container */
.vtt-form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Indicateur d'étapes */
.vtt-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 5px;
}

.vtt-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.vtt-step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--vtt-gray-200);
    color: var(--vtt-gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: var(--vtt-transition);
}

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

.vtt-step.completed .vtt-step-number {
    background: var(--vtt-lime);
    color: white;
}

.vtt-step.completed .vtt-step-number::after {
    content: "✓";
}

.vtt-step-label {
    font-size: 12px;
    color: var(--vtt-gray-500);
}

.vtt-step.active .vtt-step-label {
    color: var(--vtt-primary);
    font-weight: 600;
}

.vtt-step-line {
    width: 50px;
    height: 3px;
    background: var(--vtt-gray-200);
    margin: 0 10px;
}

/* Formulaire */
.vtt-form-step {
    background: white;
    border-radius: var(--vtt-border-radius);
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.vtt-form-step h2 {
    color: var(--vtt-gray-900);
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 24px;
}

.vtt-form-step h3 {
    color: var(--vtt-primary);
    margin-top: 25px;
    margin-bottom: 15px;
}

/* Step header (étape 0) */
.vtt-step-header {
    text-align: center;
    margin-bottom: 30px;
}

.vtt-step-header .vtt-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

/* Grille de formulaire */
.vtt-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.vtt-form-full {
    grid-column: 1 / -1;
}

/* Groupes de formulaire */
.vtt-form-group {
    margin-bottom: 5px;
}

.vtt-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--vtt-gray-700);
    font-size: 14px;
}

.vtt-form-group input,
.vtt-form-group select,
.vtt-form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--vtt-gray-200);
    border-radius: 8px;
    font-size: 16px;
    transition: var(--vtt-transition);
    box-sizing: border-box;
}

.vtt-form-group input:focus,
.vtt-form-group select:focus,
.vtt-form-group textarea:focus {
    border-color: var(--vtt-primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--vtt-primary-light);
}

/* Section optionnelle */
.vtt-optional-section {
    background: var(--vtt-gray-100);
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.vtt-optional-section h3 {
    margin-top: 0;
    font-size: 16px;
    color: var(--vtt-gray-700);
}

/* Accordéon contrat */
.vtt-contract-accordion {
    margin-bottom: 20px;
}

.vtt-accordion-toggle {
    width: 100%;
    padding: 20px;
    background: var(--vtt-primary-light);
    border: 2px solid rgba(26, 158, 143, 0.3);
    border-radius: var(--vtt-border-radius);
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: var(--vtt-transition);
    text-align: left;
}

.vtt-accordion-toggle:hover {
    background: rgba(26, 158, 143, 0.15);
}

.vtt-accordion-icon {
    font-size: 24px;
}

.vtt-accordion-title {
    flex: 1;
    font-weight: 600;
    color: var(--vtt-gray-900);
}

.vtt-accordion-arrow {
    transition: transform 0.3s;
}

.vtt-accordion-toggle.open .vtt-accordion-arrow {
    transform: rotate(180deg);
}

.vtt-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.vtt-accordion-content.open {
    max-height: 500px;
    overflow-y: auto;
}

.vtt-contract-text {
    padding: 20px;
    background: var(--vtt-gray-100);
    border: 1px solid var(--vtt-gray-200);
    border-radius: 0 0 var(--vtt-border-radius) var(--vtt-border-radius);
    font-size: 14px;
    line-height: 1.6;
    color: var(--vtt-gray-700);
}

/* Checkbox personnalisée */
.vtt-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    padding: 15px;
    background: var(--vtt-primary-light);
    border: 2px solid rgba(26, 158, 143, 0.3);
    border-radius: var(--vtt-border-radius);
    transition: var(--vtt-transition);
}

.vtt-checkbox-label:hover {
    border-color: var(--vtt-primary);
}

.vtt-checkbox-label input {
    display: none;
}

.vtt-checkbox-custom {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border: 2px solid var(--vtt-gray-200);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--vtt-transition);
    background: white;
}

.vtt-checkbox-label input:checked + .vtt-checkbox-custom {
    background: var(--vtt-primary);
    border-color: var(--vtt-primary);
}

.vtt-checkbox-label input:checked + .vtt-checkbox-custom::after {
    content: "✓";
    color: white;
    font-weight: bold;
}

/* Boutons */
.vtt-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--vtt-transition);
    border: none;
    text-decoration: none;
}

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

.vtt-btn-primary:hover:not(:disabled) {
    background: var(--vtt-primary-dark);
}

.vtt-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.vtt-btn-secondary {
    background: var(--vtt-gray-200);
    color: var(--vtt-gray-700);
}

.vtt-btn-secondary:hover {
    background: var(--vtt-gray-300, #dee2e6);
}

.vtt-btn-link {
    background: none;
    color: var(--vtt-gray-500);
    padding: 8px;
}

.vtt-btn-link:hover {
    color: var(--vtt-primary);
}

.vtt-btn-arrow {
    font-size: 18px;
}

/* Périodes */
.vtt-periods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.vtt-period-card {
    position: relative;
    padding: 20px;
    border: 2px solid var(--vtt-gray-200);
    border-radius: var(--vtt-border-radius);
    cursor: pointer;
    transition: var(--vtt-transition);
}

.vtt-period-card:hover:not(.disabled) {
    border-color: var(--vtt-primary);
}

.vtt-period-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.vtt-period-card input {
    display: none;
}

.vtt-period-card input:checked + .vtt-period-content {
    /* Styles quand sélectionné */
}

.vtt-period-card:has(input:checked) {
    border-color: var(--vtt-primary);
    background: var(--vtt-primary-light);
}

.vtt-period-name {
    font-weight: 600;
    color: var(--vtt-gray-900);
    margin-bottom: 8px;
}

.vtt-period-dates,
.vtt-period-time {
    font-size: 14px;
    color: var(--vtt-gray-500);
}

.vtt-period-spots {
    margin-top: 10px;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-block;
}

.vtt-period-spots.available {
    background: rgba(40, 167, 69, 0.15);
    color: #1e7e34;
}

.vtt-period-spots.limited {
    background: rgba(255, 193, 7, 0.2);
    color: #856404;
}

.vtt-period-spots.full {
    background: rgba(220, 53, 69, 0.15);
    color: #bd2130;
}

.vtt-period-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--vtt-primary);
    color: white;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.vtt-period-card:has(input:checked) .vtt-period-check {
    display: flex;
}

/* Enfants */
.vtt-child-card {
    background: var(--vtt-gray-100);
    border-radius: var(--vtt-border-radius);
    padding: 20px;
    margin-bottom: 20px;
}

.vtt-child-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.vtt-child-title {
    font-weight: 600;
    color: var(--vtt-gray-900);
}

.vtt-remove-child {
    background: var(--vtt-coral);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
}

/* Durée */
.vtt-duration-selector {
    margin: 20px 0;
}

.vtt-duration-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 10px;
}

.vtt-duration-option {
    cursor: pointer;
}

.vtt-duration-option input {
    display: none;
}

.vtt-duration-content {
    padding: 15px;
    border: 2px solid var(--vtt-gray-200);
    border-radius: 8px;
    text-align: center;
    transition: var(--vtt-transition);
}

.vtt-duration-option input:checked + .vtt-duration-content {
    border-color: var(--vtt-primary);
    background: var(--vtt-primary-light);
}

.vtt-duration-content strong {
    display: block;
    font-size: 18px;
    margin-bottom: 5px;
}

.vtt-duration-content span {
    display: block;
    font-size: 13px;
    color: var(--vtt-gray-500);
}

.vtt-duration-content .vtt-price {
    color: var(--vtt-primary);
    font-weight: 600;
    margin-top: 8px;
}

/* Autorisations */
.vtt-child-authorizations {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--vtt-gray-200);
}

.vtt-child-authorizations h4 {
    margin-top: 0;
    font-size: 14px;
    color: var(--vtt-gray-700);
}

.vtt-auth-group {
    margin-bottom: 15px;
    padding: 12px;
    background: white;
    border-radius: 8px;
}

.vtt-auth-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
}

.vtt-auth-options {
    display: flex;
    gap: 15px;
}

.vtt-auth-options label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
}

.vtt-auth-yes {
    color: var(--vtt-success);
}

.vtt-auth-no {
    color: var(--vtt-coral);
}

.vtt-leave-alone-address {
    margin-top: 10px;
}

.vtt-leave-alone-address input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--vtt-gray-200);
    border-radius: 6px;
    font-size: 14px;
}

/* Récapitulatif */
.vtt-summary {
    background: var(--vtt-primary-light);
    border: 2px solid rgba(26, 158, 143, 0.3);
    border-radius: var(--vtt-border-radius);
    padding: 20px;
    margin-top: 30px;
}

.vtt-summary h3 {
    margin-top: 0;
}

.vtt-summary-total {
    display: flex;
    justify-content: space-between;
    font-size: 20px;
    font-weight: 700;
    padding-top: 15px;
    margin-top: 15px;
    border-top: 2px solid rgba(26, 158, 143, 0.3);
}

.vtt-summary-total span:last-child {
    color: var(--vtt-primary);
}

/* Signature */
.vtt-contract-reminder {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    border-radius: var(--vtt-border-radius);
    margin-bottom: 30px;
}

.vtt-contract-reminder .vtt-icon {
    font-size: 24px;
    color: var(--vtt-success);
}

.vtt-contract-reminder strong {
    color: var(--vtt-success);
}

.vtt-contract-reminder p {
    margin: 5px 0 0;
    font-size: 14px;
    color: var(--vtt-gray-500);
}

.vtt-signature-section {
    margin-bottom: 30px;
}

.vtt-signature-canvas-wrapper {
    border: 2px solid var(--vtt-gray-200);
    border-radius: 8px;
    background: white;
    overflow: hidden;
}

#vtt-signature-canvas {
    width: 100%;
    height: 200px;
    display: block;
}

/* Paiement */
.vtt-payment-options {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
}

.vtt-payment-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border: 2px solid var(--vtt-gray-200);
    border-radius: var(--vtt-border-radius);
    cursor: pointer;
    transition: var(--vtt-transition);
}

.vtt-payment-option:hover {
    border-color: var(--vtt-primary);
}

.vtt-payment-option input {
    display: none;
}

.vtt-payment-option:has(input:checked) {
    border-color: var(--vtt-primary);
    background: var(--vtt-primary-light);
}

.vtt-payment-icon {
    font-size: 32px;
    width: 50px;
    text-align: center;
}

.vtt-payment-content {
    flex: 1;
}

.vtt-payment-content strong {
    display: block;
    margin-bottom: 4px;
}

.vtt-payment-content span {
    font-size: 14px;
    color: var(--vtt-gray-500);
}

.vtt-payment-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--vtt-primary);
    color: white;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.vtt-payment-option:has(input:checked) .vtt-payment-check {
    display: flex;
}

/* Final summary */
.vtt-final-summary {
    background: var(--vtt-gray-100);
    border-radius: var(--vtt-border-radius);
    padding: 20px;
}

.vtt-final-total {
    display: flex;
    justify-content: space-between;
    font-size: 24px;
    font-weight: 700;
    padding-top: 15px;
    margin-top: 15px;
    border-top: 2px solid var(--vtt-gray-200);
}

.vtt-final-total span:last-child {
    color: var(--vtt-primary);
}

/* Navigation */
.vtt-form-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--vtt-gray-200);
}

.vtt-form-actions {
    text-align: center;
    margin-top: 30px;
}

/* Spinner */
.vtt-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: vtt-spin 1s linear infinite;
}

@keyframes vtt-spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 600px) {
    .vtt-form-container {
        padding: 10px;
    }
    
    .vtt-form-step {
        padding: 20px;
    }
    
    .vtt-steps {
        gap: 3px;
    }
    
    .vtt-step-number {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .vtt-step-label {
        display: none;
    }
    
    .vtt-step-line {
        width: 20px;
    }
    
    .vtt-form-grid {
        grid-template-columns: 1fr;
    }
    
    .vtt-duration-options {
        grid-template-columns: 1fr;
    }
    
    .vtt-periods-grid {
        grid-template-columns: 1fr;
    }
    
    .vtt-form-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .vtt-form-navigation .vtt-btn {
        width: 100%;
        justify-content: center;
    }
}

