* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Modal de Video Introductorio */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2147483647;  /* Máximo z-index posible para estar sobre dropdowns nativos */
    opacity: 1;
    transition: opacity 0.5s ease;
    isolation: isolate;  /* Crea nuevo contexto de apilamiento */
}

.video-modal.hidden {
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

.video-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2147483647;
}

.video-modal-content video {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.play-video-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(0, 184, 230, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.play-video-btn svg {
    width: 40px;
    height: 40px;
    color: white;
    margin-left: 5px;
}

.play-video-btn:hover {
    background: rgba(0, 184, 230, 1);
    transform: translate(-50%, -50%) scale(1.1);
}

.play-video-btn.hidden {
    opacity: 0;
    pointer-events: none;
}

.skip-video-btn {
    margin-top: 20px;
    padding: 12px 32px;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Figtree', sans-serif;
    font-size: 14px;
    font-weight: 500;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.skip-video-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.8);
    color: #fff;
}

body {
    font-family: 'Figtree', sans-serif;
    background: #FFFFFF;
    min-height: 100vh;
    padding: 0;
    color: #333333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Logo */
.logo {
    margin-bottom: 40px;
    text-align: left;
}

.logo-img {
    max-height: 60px;
    width: auto;
}

/* Progress bar */
.progress-container {
    width: 100%;
    height: 4px;
    background: #E5E7EB;
    border-radius: 2px;
    margin-bottom: 20px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: #00B8E6;
    width: 0%;
    transition: width 0.3s ease;
}

/* Question counter */
.question-counter {
    font-size: 14px;
    color: #00B8E6;
    font-weight: 600;
    margin-bottom: 40px;
}

/* Question slides */
.question-slide {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
    flex: 1;
}

.question-slide.active {
    display: flex;
    flex-direction: column;
}

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

.question-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Question label */
.question-label {
    font-size: 32px;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 32px;
    line-height: 1.3;
    display: block;
}

.required {
    color: #EF4444;
}

/* Input styles */
.question-input {
    width: 100%;
    padding: 16px 0;
    border: none;
    border-bottom: 2px solid #E5E7EB;
    font-size: 18px;
    font-family: 'Figtree', sans-serif;
    color: #1F2937;
    background: transparent;
    transition: border-color 0.3s ease;
    outline: none;
}

.question-input:focus {
    border-bottom-color: #00B8E6;
}

.question-input::placeholder {
    color: #9CA3AF;
}

/* Textarea */
.question-textarea {
    width: 100%;
    min-height: 120px;
    padding: 16px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Figtree', sans-serif;
    color: #1F2937;
    resize: vertical;
    transition: border-color 0.3s ease;
    outline: none;
}

.question-textarea:focus {
    border-color: #00B8E6;
}

.question-textarea::placeholder {
    color: #9CA3AF;
}

/* Select dropdown */
.question-select {
    width: 100%;
    padding: 16px 0;
    border: none;
    border-bottom: 2px solid #E5E7EB;
    font-size: 18px;
    font-family: 'Figtree', sans-serif;
    color: #1F2937;
    background: transparent;
    transition: border-color 0.3s ease;
    outline: none;
    cursor: pointer;
}

.question-select:focus {
    border-bottom-color: #00B8E6;
}

/* Options grid */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.options-si-no {
    grid-template-columns: repeat(2, 1fr);
    max-width: 400px;
}

.checkbox-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

/* Option cards */
.option-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 20px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    background: #FFFFFF;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
    font-weight: 500;
    color: #4B5563;
}

.option-card:hover {
    border-color: #00B8E6;
    background: #F0F9FF;
}

.option-card input[type="radio"],
.option-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.option-card input[type="radio"]:checked ~ span,
.option-card input[type="checkbox"]:checked ~ span {
    color: #00B8E6;
}

.option-card:has(input:checked) {
    border-color: #00B8E6;
    background: #F0F9FF;
}

/* Navigation */
.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    gap: 16px;
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Figtree', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #00B8E6;
    color: white;
}

.nav-btn:hover {
    background: #0096C7;
    transform: translateY(-1px);
}

.nav-btn:active {
    transform: translateY(0);
}

.prev-btn {
    background: transparent;
    color: #6B7280;
    border: 2px solid #E5E7EB;
}

.prev-btn:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
    color: #374151;
}

.next-btn {
    margin-left: auto;
}

.submit-btn {
    background: #00B8E6;
    color: white;
    min-width: 140px;
}

.submit-btn:hover {
    background: #0096C7;
}

/* Success message */
.success-message {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.4s ease;
}

.success-message.show {
    display: flex;
}

.success-content {
    text-align: center;
    padding: 40px;
}

.success-content svg {
    margin-bottom: 24px;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.success-content h2 {
    font-size: 32px;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 12px;
}

.success-content p {
    font-size: 18px;
    color: #6B7280;
}

/* Date input styling */
input[type="date"] {
    position: relative;
    padding: 16px 0;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
}

/* Number input styling */
input[type="number"] {
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 24px 16px;
    }

    .question-label {
        font-size: 24px;
        margin-bottom: 24px;
    }

    .question-input {
        font-size: 16px;
    }

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

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

    .navigation {
        margin-top: 32px;
    }

    .success-content h2 {
        font-size: 24px;
    }

    .success-content p {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .question-label {
        font-size: 20px;
    }

    .option-card {
        padding: 14px 16px;
        font-size: 15px;
    }
}

/* Accessibility */
.question-input:focus-visible,
.question-textarea:focus-visible,
.question-select:focus-visible,
.option-card:focus-within {
    outline: none;
}

/* Loading state */
.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-btn:disabled:hover {
    transform: none;
    background: #00B8E6;
}

/* Pulse animation for submit button */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 184, 230, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(0, 184, 230, 0);
    }
}

/* Signature canvas */
.signature-container {
    margin-top: 20px;
}

#signatureCanvas {
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    cursor: crosshair;
    width: 100%;
    max-width: 600px;
    height: 200px;
    background: #FAFAFA;
}

.clear-signature-btn {
    margin-top: 12px;
    padding: 10px 20px;
    border: 2px solid #E5E7EB;
    border-radius: 6px;
    background: white;
    color: #6B7280;
    font-family: 'Figtree', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-signature-btn:hover {
    border-color: #00B8E6;
    color: #00B8E6;
}

/* Upload container */
.upload-container {
    margin-top: 20px;
}

#fotoInput {
    display: none;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    border: 2px dashed #E5E7EB;
    border-radius: 12px;
    background: #FAFAFA;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-label:hover {
    border-color: #00B8E6;
    background: #F0F9FF;
}

.upload-label span {
    margin-top: 12px;
    color: #6B7280;
    font-size: 16px;
    font-weight: 500;
}

.image-preview {
    margin-top: 20px;
    text-align: center;
}

.image-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
