/* ===== WIZARD — MOBILE FIRST ===== */

.wizard-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem 0;
}

/* Header */
.wizard-header {
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
    color: white;
    padding: 1.5rem 1rem;
    border-radius: 10px 10px 0 0;
    text-align: center;
}
.wizard-header h2 { margin: 0; font-weight: 600; font-size: 1.3rem; }
.wizard-header p { margin: 0.5rem 0 0; opacity: 0.9; font-size: 0.85rem; }

/* ===== PROGRESS STEPS ===== */
.wizard-steps {
    display: flex;
    background: var(--color-surface);
    padding: 1rem 0.5rem 0.5rem;
    border-bottom: 2px solid var(--color-border);
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0;
}

.wizard-step {
    flex: 0 0 auto;
    min-width: 60px;
    text-align: center;
    position: relative;
    cursor: pointer;
    padding: 0 4px;
}

.wizard-step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-border);
    color: var(--color-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
    transition: all 0.3s;
    position: relative;
    z-index: 2;
}

.wizard-step.active .wizard-step-number {
    background: var(--color-primary);
    color: white;
    transform: scale(1.15);
}

.wizard-step.completed .wizard-step-number {
    background: var(--color-primary-light);
    color: white;
}
.wizard-step.completed .wizard-step-number::after {
    content: '✓';
    position: absolute;
    font-size: 1rem;
}

.wizard-step-title {
    font-size: 0.65rem;
    color: var(--color-text-muted);
    font-weight: 500;
    line-height: 1.2;
}
.wizard-step.active .wizard-step-title {
    color: var(--color-primary);
    font-weight: 600;
}

/* Progress line */
.wizard-steps::before {
    content: '';
    position: absolute;
    top: 1.5rem;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--color-border);
    z-index: 1;
}
.wizard-progress-line {
    position: absolute;
    top: 1.5rem;
    left: 10%;
    height: 2px;
    background: var(--color-primary);
    z-index: 1;
    transition: width 0.3s ease;
}

/* ===== WIZARD BODY ===== */
.wizard-body {
    background: var(--color-surface);
    padding: 1.25rem 1rem;
    min-height: 300px;
}

.wizard-step-content { display: none; }
.wizard-step-content.active {
    display: block;
    animation: fadeIn 0.3s;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.wizard-step-content h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

/* ===== FORM GROUPS ===== */
.form-group-wizard {
    margin-bottom: 1.25rem;
}
.form-group-wizard label {
    font-weight: 500;
    color: var(--color-text-primary);
    margin-bottom: 0.4rem;
    display: block;
    font-size: 0.9rem;
}
.form-group-wizard label .required {
    color: var(--color-error);
    margin-left: 2px;
}
.form-group-wizard .form-control,
.form-group-wizard .form-select {
    border-radius: 8px;
    border: 1px solid var(--color-border);
    padding: 0.7rem 0.75rem;
    font-size: 1rem;
    transition: border-color 0.3s;
}
.form-group-wizard .form-control:focus,
.form-group-wizard .form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.2rem rgba(31, 143, 163, 0.2);
}
.form-group-wizard .form-text {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* ===== CHECKBOX GRID ===== */
.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-top: 0.75rem;
}
.checkbox-card {
    border: 2px solid var(--color-border);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
}
.checkbox-card:hover { border-color: var(--color-primary); }
.checkbox-card input[type="checkbox"] {
    margin-right: 0.75rem;
    width: 22px;
    height: 22px;
    cursor: pointer;
    flex-shrink: 0;
}
.checkbox-card.checked {
    border-color: var(--color-primary);
    background: #E6F4F7;
}
.checkbox-card label {
    margin: 0;
    cursor: pointer;
    flex: 1;
    font-size: 0.95rem;
}

/* ===== SCHEDULE — MOBILE: CARDS ===== */
.schedule-table { width: 100%; }
.schedule-table thead { display: none; }
.schedule-table tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.5rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
    align-items: center;
}
.schedule-table tbody tr td:first-child {
    grid-column: 1 / -1;
    font-size: 0.95rem;
}
.schedule-table td { padding: 0; }
.schedule-table input[type="time"] {
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 0.5rem;
    width: 100%;
    font-size: 0.95rem;
}
.schedule-table input[type="checkbox"] {
    width: 24px;
    height: 24px;
}

/* ===== SERVICES SWITCHES ===== */
.form-check-label {
    font-size: 0.95rem;
    padding-top: 2px;
}
.form-check.form-switch {
    margin-bottom: 1rem;
}

/* ===== NAVIGATION ===== */
.wizard-navigation {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background: var(--color-background);
    border-radius: 0 0 10px 10px;
    gap: 0.75rem;
}
.btn-wizard {
    padding: 0.85rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s;
    border: none;
    min-height: 48px;
    flex: 1;
}
.btn-wizard-prev {
    background: var(--color-text-secondary);
    color: white;
    flex: 0 1 auto;
}
.btn-wizard-prev:hover { background: var(--color-text-primary); }
.btn-wizard-next {
    background: var(--color-primary);
    color: white;
}
.btn-wizard-next:hover { background: var(--color-primary-dark); }
.btn-wizard-submit {
    background: var(--color-success);
    color: white;
}
.btn-wizard-submit:hover { opacity: 0.9; }
.btn-wizard:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== SUMMARY ===== */
.summary-section {
    background: var(--color-background);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}
.summary-section h5 {
    color: var(--color-primary);
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
}
.summary-item {
    display: flex;
    flex-direction: column;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--color-border);
}
.summary-item:last-child { border-bottom: none; }
.summary-label {
    font-weight: 500;
    color: var(--color-text-secondary);
    font-size: 0.8rem;
}
.summary-value {
    color: var(--color-text-primary);
    font-size: 0.95rem;
}

/* ===== SUCCESS ===== */
.success-message {
    text-align: center;
    padding: 2rem 1rem;
}
.success-message i { font-size: 4rem; color: var(--color-success); margin-bottom: 1rem; }
.success-message h3 { color: var(--color-primary); margin-bottom: 1rem; font-size: 1.3rem; }

/* ===== LOADING ===== */
.wizard-loading { display: none; text-align: center; padding: 2rem; }
.wizard-loading.active { display: block; }
.spinner {
    border: 4px solid var(--color-border);
    border-top: 4px solid var(--color-primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* ===== VALIDATION ===== */
.invalid-feedback {
    display: none;
    color: var(--color-error);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}
.form-control.is-invalid,
.form-select.is-invalid { border-color: var(--color-error); }
.form-control.is-invalid ~ .invalid-feedback,
.form-select.is-invalid ~ .invalid-feedback { display: block; }
.form-control.is-valid,
.form-select.is-valid { border-color: var(--color-success); }

/* ===== IMAGE UPLOAD ===== */
.image-upload-area {
    border: 2px dashed var(--color-border);
    border-radius: 8px;
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}
.image-upload-area:hover { border-color: var(--color-primary); }
.image-upload-area i { font-size: 2.5rem; color: var(--color-primary); margin-bottom: 0.75rem; }

.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 1rem;
}
.image-preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
}
.image-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.image-preview-item .remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   DESKTOP OVERRIDES (min-width: 768px)
   ============================================ */
@media (min-width: 768px) {
    .wizard-container { padding: 2rem 0; }
    .wizard-header { padding: 2rem; }
    .wizard-header h2 { font-size: 1.6rem; }
    .wizard-header p { font-size: 1rem; }

    .wizard-steps { padding: 2rem 1rem 1rem; overflow-x: visible; }
    .wizard-step { flex: 1; min-width: auto; }
    .wizard-step-number { width: 40px; height: 40px; font-size: 0.9rem; }
    .wizard-step-title { font-size: 0.85rem; }

    .wizard-body { padding: 2rem; min-height: 400px; }
    .wizard-step-content h4 { font-size: 1.3rem; margin-bottom: 1.5rem; }

    .checkbox-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }

    /* Schedule: table layout on desktop */
    .schedule-table thead { display: table-header-group; }
    .schedule-table th {
        background: var(--color-background);
        padding: 0.75rem;
        font-weight: 600;
        text-align: left;
    }
    .schedule-table tbody tr {
        display: table-row;
    }
    .schedule-table tbody tr td {
        display: table-cell;
        padding: 0.75rem;
        border-bottom: 1px solid var(--color-border);
    }

    .wizard-navigation { padding: 1.5rem 2rem; }
    .btn-wizard { flex: 0 1 auto; padding: 0.75rem 2rem; }

    .summary-item { flex-direction: row; }
    .summary-label { min-width: 150px; }

    .image-preview-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* ===== SLIDER CAPTCHA ===== */
.slider-track {
    position: relative;
    height: 48px;
    background: var(--color-border);
    border-radius: 24px;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.slider-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    border-radius: 24px;
    transition: none;
}

.slider-fill.verified {
    background: linear-gradient(135deg, var(--color-success), #27ae60);
}

.slider-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 44px;
    height: 44px;
    background: var(--color-surface);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    cursor: grab;
    z-index: 2;
    transition: none;
    color: var(--color-primary);
    font-size: 1rem;
}

.slider-thumb:active { cursor: grabbing; }

.slider-thumb.verified {
    color: var(--color-success);
    cursor: default;
}

.slider-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--color-text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    pointer-events: none;
    white-space: nowrap;
    z-index: 1;
}

.slider-label.verified {
    color: white;
}
