/**
 * Estudia — Tema acogedor para maestras de Infantil
 */

input[type="text"],
input[type="email"],
input[type="number"],
textarea,
select {
    font-size: 16px !important;
}

/* ── Fondo decorativo ── */
.decor-cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 9999px;
    filter: blur(1px);
}

.decor-cloud-1 {
    width: 140px;
    height: 50px;
    top: 12%;
    left: 8%;
    box-shadow: 60px 0 0 -5px rgba(255,255,255,0.7), 30px -18px 0 -8px rgba(255,255,255,0.6);
    animation: floatCloud 8s ease-in-out infinite;
}

.decor-cloud-2 {
    width: 100px;
    height: 38px;
    top: 22%;
    right: 10%;
    box-shadow: 45px 0 0 -5px rgba(255,255,255,0.65);
    animation: floatCloud 10s ease-in-out infinite reverse;
}

.decor-star {
    position: absolute;
    color: #FFE066;
    opacity: 0.45;
    font-size: 1.25rem;
    animation: twinkle 3s ease-in-out infinite;
}

.decor-star-1 { top: 18%; right: 28%; }
.decor-star-2 { top: 35%; left: 15%; animation-delay: 1s; }
.decor-star-3 { bottom: 30%; right: 12%; animation-delay: 2s; font-size: 0.9rem; }

@keyframes floatCloud {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.15); }
}

.welcome-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: linear-gradient(135deg, #FFD6E0, #FFF3C4);
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #9d5c63;
}

/* ── Tarjetas ── */
.card {
    background: #fff;
    border-radius: 1.75rem;
    padding: 1.5rem;
    box-shadow: 0 10px 40px rgba(255, 172, 197, 0.15);
    border: 2px solid rgba(255, 232, 220, 0.8);
}

.card-warm {
    background: linear-gradient(180deg, #FFFCFA 0%, #FFFFFF 100%);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.95rem 1.5rem;
    background: linear-gradient(135deg, #FFB4A2 0%, #FFACC5 50%, #FFE066 100%);
    color: #5c3d42;
    font-weight: 700;
    font-family: Fredoka, Nunito, sans-serif;
    border-radius: 1.25rem;
    box-shadow: 0 8px 28px rgba(255, 180, 162, 0.35);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    min-height: 52px;
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 12px 32px rgba(255, 172, 197, 0.45);
    transform: translateY(-2px);
}

.btn-primary:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: #fff;
    color: #6b5b5e;
    font-weight: 600;
    border-radius: 1.25rem;
    border: 2px solid #FFE8DC;
    box-shadow: 0 4px 20px rgba(255, 180, 162, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 48px;
}

.btn-secondary:hover:not(:disabled) {
    background: #FFF8F0;
    border-color: #FFB4A2;
}

.btn-secondary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.input-field {
    width: 100%;
    padding: 0.875rem 1rem;
    border-radius: 1.25rem;
    border: 2px solid #FFE8DC;
    background: #FFFCFA;
    transition: all 0.2s ease;
    min-height: 48px;
}

.input-field:focus {
    outline: none;
    border-color: #FFACC5;
    box-shadow: 0 0 0 4px rgba(255, 224, 102, 0.35);
}

.dropzone {
    border: 2px dashed #FFB4A2;
    border-radius: 1.75rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 248, 240, 0.5);
}

.dropzone:hover {
    border-color: #FFACC5;
    background: rgba(255, 214, 224, 0.2);
}

.dropzone.dragover {
    border-color: #95D5B2;
    background: rgba(216, 243, 220, 0.35);
    transform: scale(1.01);
}

.dropzone-icon {
    width: 5rem;
    height: 5rem;
    margin: 0 auto;
    border-radius: 9999px;
    background: linear-gradient(135deg, #FFD6E0, #CAF0F8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tipo-card,
.dificultad-card {
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    padding: 1rem;
    border-radius: 1.5rem;
    background: #fff;
    box-shadow: 0 6px 24px rgba(255, 172, 197, 0.12);
}

.tipo-card {
    text-align: left;
}

.tipo-card:hover,
.dificultad-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(255, 172, 197, 0.2);
}

.tipo-card.selected {
    border-color: #FFACC5;
    background: linear-gradient(135deg, rgba(255,214,224,0.3), rgba(202,240,248,0.2));
}

.dificultad-card.selected {
    border-color: #FFE066;
    background: linear-gradient(180deg, #FFFCF0, #FFF8F0);
    box-shadow: 0 0 0 4px rgba(255, 224, 102, 0.35);
}

.tipo-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.range-slider {
    appearance: none;
    width: 100%;
    height: 10px;
    background: linear-gradient(90deg, #FFD6E0, #FFF3C4);
    border-radius: 9999px;
    outline: none;
}

.range-slider::-webkit-slider-thumb {
    appearance: none;
    width: 26px;
    height: 26px;
    border-radius: 9999px;
    background: linear-gradient(135deg, #FFB4A2, #FFACC5);
    box-shadow: 0 4px 12px rgba(255, 172, 197, 0.4);
    cursor: pointer;
    border: 3px solid #fff;
}

.progress-track {
    background: #FFF5EB !important;
}

.progress-fill {
    background: linear-gradient(90deg, #FFB4A2, #95D5B2, #90E0EF) !important;
}

.step-dot {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #b0a0a3;
    padding: 0.4rem 0.85rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.85);
    transition: all 0.3s ease;
}

.step-dot span {
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 9999px;
    background: #FFE8DC;
    color: #9d7a7f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
}

.step-dot.active {
    color: #c9184a;
    background: rgba(255, 214, 224, 0.5);
}

.step-dot.active span {
    background: linear-gradient(135deg, #FFACC5, #FFB4A2);
    color: #fff;
}

.step-dot.completed {
    color: #40916c;
}

.step-dot.completed span {
    background: #95D5B2;
    color: #fff;
}

.step-line {
    width: 1.5rem;
    height: 3px;
    background: #FFE8DC;
    border-radius: 9999px;
}

@media (max-width: 639px) {
    .step-line { display: none; }
}

.option-btn {
    width: 100%;
    text-align: left;
    padding: 1rem 1.25rem;
    border-radius: 1.25rem;
    border: 2px solid #FFF0EB;
    background: #FFFCFA;
    transition: all 0.2s ease;
    cursor: pointer;
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.option-btn:hover {
    border-color: #FFB4A2;
    background: rgba(255, 232, 220, 0.35);
}

.option-btn.selected {
    border-color: #FFACC5;
    background: rgba(255, 214, 224, 0.35);
    box-shadow: 0 0 0 3px rgba(255, 224, 102, 0.3);
}

.option-btn.correct {
    border-color: #95D5B2;
    background: rgba(216, 243, 220, 0.5);
}

.option-btn.incorrect {
    border-color: #ffb3b3;
    background: #fff5f5;
}

.option-letter {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.85rem;
    background: #FFE8DC;
    color: #7d5a5f;
    font-weight: 700;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: Fredoka, sans-serif;
}

.option-btn.selected .option-letter {
    background: linear-gradient(135deg, #FFB4A2, #FFACC5);
    color: #fff;
}

.textarea-respuesta {
    min-height: 150px;
    resize: vertical;
}

.nav-pill {
    width: 2.6rem;
    height: 2.6rem;
    min-width: 42px;
    min-height: 42px;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 700;
    font-family: Fredoka, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #FFE8DC;
    background: #fff;
    transition: all 0.2s ease;
    cursor: pointer;
    color: #8b7377;
}

.nav-pill.active {
    border-color: #FFACC5;
    background: linear-gradient(135deg, #FFB4A2, #FFACC5);
    color: #fff;
}

.nav-pill.answered {
    border-color: #95D5B2;
    background: #D8F3DC;
    color: #2d6a4f;
}

.result-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.35rem;
    border-radius: 1.25rem;
    font-family: Fredoka, sans-serif;
    font-weight: 700;
    font-size: 1.125rem;
}

.result-item.correct { border-left: 4px solid #95D5B2; }
.result-item.incorrect { border-left: 4px solid #FFB4A2; }

.keyword-found { background: #D8F3DC; color: #2d6a4f; }
.keyword-missing { background: #FFE8DC; color: #9d5c63; }

.keyword-tag {
    display: inline-block;
    padding: 0.3rem 0.65rem;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 1rem;
}

@media (min-width: 640px) {
    .modal { align-items: center; }
}

.modal.hidden { display: none; }

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(93, 61, 66, 0.25);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: #FFFCFA;
    border-radius: 1.75rem;
    padding: 1.5rem;
    width: 100%;
    max-width: 32rem;
    box-shadow: 0 10px 40px rgba(255, 172, 197, 0.25);
    max-height: 85vh;
    overflow: hidden;
    z-index: 10;
    border: 2px solid #FFE8DC;
}

.toast {
    position: fixed;
    bottom: 6rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    padding: 0.9rem 1.5rem;
    border-radius: 1.25rem;
    box-shadow: 0 8px 28px rgba(255, 172, 197, 0.3);
    font-weight: 600;
    font-size: 0.875rem;
    max-width: 24rem;
    text-align: center;
    transition: all 0.3s ease;
}

@media (min-width: 640px) {
    .toast { bottom: 1.5rem; }
}

.toast.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(1rem);
}

.toast.success { background: linear-gradient(135deg, #95D5B2, #74C69D); color: #fff; }
.toast.error { background: linear-gradient(135deg, #FFB4A2, #E5989B); color: #fff; }
.toast.info { background: linear-gradient(135deg, #90E0EF, #48CAE4); color: #fff; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.view-section.hidden { display: none; }

#progreso-content,
#results-detail {
    -webkit-overflow-scrolling: touch;
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
    #mobile-finish-bar {
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-slide-up { animation: slideUp 0.4s ease-out; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-fade-in { animation: fadeIn 0.4s ease-out; }

/* ── Pie de página ── */
.site-footer {
    border-top: 2px solid #FFE8DC;
    background: linear-gradient(180deg, rgba(255, 248, 240, 0.6) 0%, rgba(255, 255, 255, 0.95) 100%);
    margin-top: 2rem;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.footer-brand {
    font-family: Fredoka, Nunito, sans-serif;
    font-weight: 700;
    color: #E5989B;
    text-decoration: none;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

.footer-brand:hover {
    color: #c9184a;
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (max-width: 639px) {
    .site-footer {
        padding-bottom: 5rem;
    }
}
