/* =============================================
   OHZ Forms - Estilos de Formulario Público
   Vista tipo Typeform
   ============================================= */

:root {
    --form-primary: #6C5CE7;
    --form-bg: #FFFFFF;
    --form-text: #333333;
    --form-font: 'Inter', sans-serif;
}

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

html, body {
    height: 100%;
    overflow: hidden;
}

body.form-page {
    font-family: var(--form-font);
    background: var(--form-bg);
    color: var(--form-text);
    -webkit-font-smoothing: antialiased;
}

/* Background Image Overlay */
body.form-page.has-bg-image {
    background: var(--form-bg);
}

body.form-page.has-bg-image::before {
    content: '';
    position: fixed;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform: scale(1.05); /* prevent blur white edges */
    z-index: 0;
}

body.form-page.has-bg-image::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.25);
    z-index: 0;
}

body.form-page.has-bg-image .typeform-container {
    position: relative;
    z-index: 1;
}

body.form-page.has-bg-image .form-progress {
    z-index: 101;
}

body.form-page.has-bg-image .form-navigation,
body.form-page.has-bg-image .keyboard-hint,
body.form-page.has-bg-image .form-footer {
    z-index: 101;
}

/* Override text readability on bg image */
body.form-page.has-bg-image .welcome-title,
body.form-page.has-bg-image .question-title,
body.form-page.has-bg-image .thankyou-title {
    text-shadow: 0 1px 8px rgba(0,0,0,0.3);
}

/* Form Container */
.typeform-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* Progress Bar */
.form-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(0,0,0,0.08);
    z-index: 100;
}

.form-progress-bar {
    height: 100%;
    background: var(--form-primary);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0 2px 2px 0;
}

/* Navigation */
.form-navigation {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    gap: 8px;
    z-index: 100;
}

.form-nav-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--form-primary);
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.form-nav-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.form-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.form-nav-btn.prev-btn {
    background: rgba(0,0,0,0.1);
    color: var(--form-text);
}

/* Footer branding */
.form-footer {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 100;
}

.form-footer a {
    font-size: 12px;
    color: rgba(0,0,0,0.3);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
}

.form-footer a:hover {
    color: rgba(0,0,0,0.6);
}

/* Slide */
.form-slides {
    position: relative;
    height: 100vh;
    width: 100%;
}

.form-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(40px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.form-slide.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: all;
}

.form-slide.exit-up {
    opacity: 0;
    transform: translateY(-40px);
}

.form-slide.exit-down {
    opacity: 0;
    transform: translateY(40px);
}

.slide-content {
    width: 100%;
    max-width: 720px;
    animation: slideContentIn 0.6s ease 0.1s both;
}

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

/* Welcome Slide */
.welcome-slide {
    text-align: center;
}

.welcome-slide .slide-content {
    max-width: 600px;
}

.welcome-icon {
    font-size: 56px;
    margin-bottom: 24px;
}

.welcome-title {
    font-size: 36px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
    color: var(--form-text);
}

.welcome-description {
    font-size: 18px;
    color: rgba(0,0,0,0.55);
    line-height: 1.6;
    margin-bottom: 40px;
}

.welcome-start-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 40px;
    background: var(--form-primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-family: var(--form-font);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

.welcome-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 92, 231, 0.4);
}

/* Question Number */
.question-number {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--form-primary);
    margin-bottom: 12px;
}

.question-number .arrow {
    font-size: 16px;
}

/* Question Title */
.question-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 8px;
    color: var(--form-text);
}

.question-required {
    color: var(--form-primary);
    font-size: 24px;
    vertical-align: super;
}

.question-description {
    font-size: 16px;
    color: rgba(0,0,0,0.5);
    margin-bottom: 32px;
    line-height: 1.5;
}

/* Text input */
.typeform-input {
    width: 100%;
    padding: 16px 0;
    border: none;
    border-bottom: 3px solid rgba(0,0,0,0.15);
    font-size: 22px;
    font-family: var(--form-font);
    outline: none;
    background: transparent;
    color: var(--form-text);
    transition: all 0.3s ease;
}

.typeform-input:focus {
    border-bottom-color: var(--form-primary);
}

.typeform-input::placeholder {
    color: rgba(0,0,0,0.25);
}

textarea.typeform-input {
    resize: none;
    min-height: 120px;
    line-height: 1.5;
}

/* Multiple choice options */
.typeform-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.typeform-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border: 2px solid rgba(0,0,0,0.12);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: 500;
}

.typeform-option:hover {
    border-color: var(--form-primary);
    background: rgba(108, 92, 231, 0.04);
}

.typeform-option.selected {
    border-color: var(--form-primary);
    background: rgba(108, 92, 231, 0.08);
}

.typeform-option .option-letter {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(0,0,0,0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: rgba(0,0,0,0.4);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.typeform-option.selected .option-letter {
    border-color: var(--form-primary);
    background: var(--form-primary);
    color: white;
}

.typeform-option .option-text {
    flex: 1;
}

.typeform-option .option-check {
    opacity: 0;
    color: var(--form-primary);
    font-size: 20px;
    transition: all 0.3s ease;
}

.typeform-option.selected .option-check {
    opacity: 1;
}

/* Submit hint */
.submit-hint {
    margin-top: 24px;
    font-size: 13px;
    color: rgba(0,0,0,0.35);
}

.submit-hint kbd {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(0,0,0,0.06);
    border-radius: 4px;
    font-family: var(--form-font);
    font-size: 12px;
    font-weight: 600;
    margin: 0 2px;
}

/* OK Button */
.typeform-ok-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    padding: 12px 28px;
    background: var(--form-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: var(--form-font);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.typeform-ok-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.typeform-ok-btn .ok-hint {
    font-size: 12px;
    opacity: 0.7;
    font-weight: 500;
}

/* Rating */
.typeform-rating {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.typeform-rating .rating-star {
    font-size: 40px;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.25;
}

.typeform-rating .rating-star:hover,
.typeform-rating .rating-star.active {
    opacity: 1;
    transform: scale(1.15);
}

/* Scale / NPS */
.typeform-scale {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.typeform-scale .scale-number {
    width: 52px;
    height: 52px;
    border: 2px solid rgba(0,0,0,0.12);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.typeform-scale .scale-number:hover {
    border-color: var(--form-primary);
    transform: translateY(-2px);
}

.typeform-scale .scale-number.active {
    background: var(--form-primary);
    border-color: var(--form-primary);
    color: white;
}

.scale-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 13px;
    color: rgba(0,0,0,0.4);
}

/* Yes/No */
.typeform-yesno {
    display: flex;
    gap: 16px;
    margin-top: 8px;
}

.typeform-yesno .yesno-btn {
    flex: 1;
    max-width: 200px;
    padding: 20px;
    border: 2px solid rgba(0,0,0,0.12);
    border-radius: 12px;
    background: none;
    font-family: var(--form-font);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.typeform-yesno .yesno-btn .yesno-icon {
    font-size: 32px;
}

.typeform-yesno .yesno-btn:hover {
    border-color: var(--form-primary);
    transform: translateY(-2px);
}

.typeform-yesno .yesno-btn.selected {
    border-color: var(--form-primary);
    background: rgba(108, 92, 231, 0.08);
}

/* Date input */
.typeform-date {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.typeform-date input {
    padding: 14px 16px;
    border: 2px solid rgba(0,0,0,0.12);
    border-radius: 10px;
    font-size: 18px;
    font-family: var(--form-font);
    outline: none;
    transition: all 0.3s ease;
    background: transparent;
    color: var(--form-text);
}

.typeform-date input:focus {
    border-color: var(--form-primary);
}

/* Thank you slide */
.thankyou-slide {
    text-align: center;
}

.thankyou-slide .slide-content {
    max-width: 500px;
}

.thankyou-icon {
    font-size: 64px;
    margin-bottom: 24px;
}

.thankyou-title {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 12px;
}

.thankyou-description {
    font-size: 18px;
    color: rgba(0,0,0,0.55);
    line-height: 1.6;
    margin-bottom: 32px;
}

.thankyou-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--form-primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-family: var(--form-font);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
}

.thankyou-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* Validation error */
.field-error {
    color: #E17055;
    font-size: 14px;
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Keyboard shortcut hint */
.keyboard-hint {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: rgba(0,0,0,0.3);
    z-index: 50;
}

.keyboard-hint kbd {
    padding: 2px 6px;
    background: rgba(0,0,0,0.06);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .form-slide {
        padding: 24px 20px;
    }
    
    .welcome-title,
    .thankyou-title {
        font-size: 28px;
    }
    
    .question-title {
        font-size: 22px;
    }
    
    .typeform-input {
        font-size: 18px;
    }
    
    .form-navigation {
        bottom: 16px;
        right: 16px;
    }
    
    .form-footer {
        bottom: 16px;
        left: 16px;
    }
    
    .keyboard-hint {
        display: none;
    }
    
    .typeform-scale .scale-number {
        width: 44px;
        height: 44px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .welcome-title,
    .thankyou-title {
        font-size: 24px;
    }
    
    .question-title {
        font-size: 20px;
    }
    
    .typeform-yesno {
        flex-direction: column;
    }
    
    .typeform-yesno .yesno-btn {
        max-width: none;
    }

    .thankyou-custom-buttons {
        flex-direction: column;
        align-items: center;
    }
}

/* =============================================
   Botones personalizados - Thank You
   ============================================= */
.thankyou-custom-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

.thankyou-custom-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    background: var(--btn-color, var(--form-primary));
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    min-width: 140px;
}

.thankyou-custom-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    filter: brightness(1.08);
}

/* =============================================
   Redes Sociales - Thank You
   ============================================= */
.thankyou-social {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(0,0,0,0.08);
}

.social-icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0,0,0,0.06);
    color: var(--form-text);
    text-decoration: none;
    font-size: 20px;
    transition: all 0.2s ease;
}

.social-icon-link:hover {
    background: var(--form-primary);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* =============================================
   DARK MODE - Form Theme
   ============================================= */

/* Dark mode helper variables */
body.form-page.theme-dark {
    --form-bg-surface: rgba(255,255,255,0.06);
    --form-border: rgba(255,255,255,0.12);
    --form-text-muted: rgba(255,255,255,0.45);
    --form-text-hint: rgba(255,255,255,0.3);
    --form-shadow: rgba(0,0,0,0.4);
}

body.form-page.theme-light,
body.form-page:not(.theme-dark) {
    --form-bg-surface: rgba(0,0,0,0.03);
    --form-border: rgba(0,0,0,0.12);
    --form-text-muted: rgba(0,0,0,0.55);
    --form-text-hint: rgba(0,0,0,0.3);
    --form-shadow: rgba(0,0,0,0.15);
}

/* Dark: General text overrides */
body.form-page.theme-dark .welcome-description,
body.form-page.theme-dark .thankyou-description,
body.form-page.theme-dark .question-description {
    color: var(--form-text-muted);
}

/* Dark: Input styles */
body.form-page.theme-dark .typeform-input {
    border-bottom-color: var(--form-border);
    color: var(--form-text);
}

body.form-page.theme-dark .typeform-input::placeholder {
    color: var(--form-text-hint);
}

/* Dark: Options */
body.form-page.theme-dark .typeform-option {
    border-color: var(--form-border);
    color: var(--form-text);
}

body.form-page.theme-dark .typeform-option:hover {
    border-color: var(--form-primary);
    background: rgba(108, 92, 231, 0.12);
}

body.form-page.theme-dark .typeform-option.selected {
    border-color: var(--form-primary);
    background: rgba(108, 92, 231, 0.18);
}

body.form-page.theme-dark .typeform-option .option-letter {
    border-color: var(--form-border);
    color: var(--form-text-muted);
}

/* Dark: Scale/NPS */
body.form-page.theme-dark .typeform-scale .scale-number {
    border-color: var(--form-border);
    color: var(--form-text);
}

body.form-page.theme-dark .typeform-scale .scale-number:hover {
    border-color: var(--form-primary);
}

body.form-page.theme-dark .scale-labels {
    color: var(--form-text-hint);
}

/* Dark: Yes/No */
body.form-page.theme-dark .typeform-yesno .yesno-btn {
    border-color: var(--form-border);
    color: var(--form-text);
}

body.form-page.theme-dark .typeform-yesno .yesno-btn:hover {
    border-color: var(--form-primary);
}

body.form-page.theme-dark .typeform-yesno .yesno-btn.selected {
    border-color: var(--form-primary);
    background: rgba(108, 92, 231, 0.15);
}

/* Dark: Submit hint, keyboard hint */
body.form-page.theme-dark .submit-hint,
body.form-page.theme-dark .keyboard-hint {
    color: var(--form-text-hint);
}

body.form-page.theme-dark .submit-hint kbd,
body.form-page.theme-dark .keyboard-hint kbd {
    background: rgba(255,255,255,0.08);
    color: var(--form-text-muted);
}

/* Dark: Progress bar */
body.form-page.theme-dark .form-progress {
    background: rgba(255,255,255,0.06);
}

/* Dark: Navigation */
body.form-page.theme-dark .form-nav-btn.prev-btn {
    background: rgba(255,255,255,0.1);
    color: var(--form-text);
}

/* Dark: Footer */
body.form-page.theme-dark .form-footer a {
    color: rgba(255,255,255,0.25);
}

/* Dark: BG image overlay darker */
body.form-page.theme-dark.has-bg-image::after {
    background: rgba(0,0,0,0.55);
}

body.form-page.theme-dark .form-footer a:hover {
    color: rgba(255,255,255,0.5);
}

/* Dark: Social icons */
body.form-page.theme-dark .social-icon-link {
    background: rgba(255,255,255,0.08);
    color: var(--form-text);
}

body.form-page.theme-dark .thankyou-social {
    border-top-color: rgba(255,255,255,0.08);
}

/* Dark: Date/Select inputs with inline styles */
body.form-page.theme-dark input[type="date"],
body.form-page.theme-dark select.typeform-input {
    border-color: var(--form-border) !important;
    color: var(--form-text);
    background: transparent;
}

body.form-page.theme-dark select.typeform-input option {
    background: #1a1a2e;
    color: #fff;
}

/* =============================================
   Branding Footer - Enhanced
   ============================================= */
.form-footer {
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-footer .branding-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 3px;
}

.form-footer .branding-text {
    font-size: 12px;
    font-weight: 600;
}
