/* ─── Variables (heredadas de GokyWebs) ─── */
:root {
    --blue:        #2563EB;
    --blue-light:  #3B82F6;
    --blue-dark:   #1D4ED8;
    --green:       #22C55E;
    --green-dark:  #16A34A;
    --bg:          #0F0F10;
    --surface:     #1A1A1F;
    --surface-2:   #222228;
    --border:      rgba(255,255,255,0.08);
    --border-blue: rgba(37,99,235,0.4);
    --text:        #FFFFFF;
    --text-muted:  #9CA3AF;
    --error:       #EF4444;
    --font:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display:'Space Grotesk', var(--font);
    --radius:      16px;
    --radius-sm:   10px;
    --transition:  all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-blue: 0 8px 32px rgba(37,99,235,0.3);
    --shadow-card: 0 4px 24px rgba(0,0,0,0.4);
}

/* ─── Reset ─── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; font-size:16px; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px 48px;
    -webkit-font-smoothing: antialiased;
    position: relative;
    overflow-x: hidden;
}

/* ─── Background glow ─── */
.bg-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse at 15% 40%, rgba(37,99,235,0.1) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 10%, rgba(34,197,94,0.06) 0%, transparent 50%);
}

/* ─── Wrapper ─── */
.form-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 640px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ─── Header ─── */
.form-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    padding-bottom: 8px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 8px;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.header-sub {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ─── Card ─── */
.form-card {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: var(--radius);
    padding: 36px 32px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.12);
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ─── Secciones del formulario ─── */
#leadForm {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.section-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.section-divider {
    height: 1px;
    background: #E5E7EB;
    margin: 8px 0;
}

/* ─── Submit row ─── */
.submit-row {
    display: flex;
    padding-top: 8px;
}

.step-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
    letter-spacing: -0.02em;
}

.step-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: -8px;
}

.step-highlight {
    font-size: 0.95rem;
    color: var(--text);
    background: rgba(37,99,235,0.12);
    border-left: 3px solid var(--blue);
    padding: 12px 16px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    line-height: 1.5;
}

/* ─── Fields ─── */
.field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

.req { color: var(--blue-light); }

.text-input {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-family: var(--font);
    font-size: 1rem;
    color: var(--text);
    outline: none;
    transition: var(--transition);
    resize: none;
}

.text-input::placeholder { color: rgba(156,163,175,0.5); }

.text-input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

.text-input.error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(239,68,68,0.12);
}

.textarea { min-height: 100px; line-height: 1.6; }

/* ─── Option cards ─── */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.option-card {
    position: relative;
    cursor: pointer;
    user-select: none;
}

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

.option-content {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    transition: var(--transition);
    height: 100%;
}

.option-icon {
    font-size: 1.3rem;
    line-height: 1;
    flex-shrink: 0;
}

.option-text {
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.3;
    color: var(--text);
}

.check-mark {
    display: none;
    position: absolute;
    top: 8px;
    right: 8px;
    width: 18px;
    height: 18px;
    background: var(--green);
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    align-items: center;
    justify-content: center;
}

/* Selected state – radio */
.option-card:has(input[type="radio"]:checked) .option-content {
    border-color: var(--blue);
    background: rgba(37,99,235,0.12);
    box-shadow: 0 0 0 2px rgba(37,99,235,0.2);
}

/* Selected state – checkbox */
.option-card:has(input[type="checkbox"]:checked) .option-content {
    border-color: var(--green);
    background: rgba(34,197,94,0.1);
    box-shadow: 0 0 0 2px rgba(34,197,94,0.15);
}

.option-card:has(input[type="checkbox"]:checked) .check-mark {
    display: flex;
}

/* Hover */
.option-card:hover .option-content {
    border-color: rgba(37,99,235,0.5);
    transform: translateY(-2px);
}

/* Error highlight for option groups */
.options-grid.error .option-content {
    border-color: var(--error);
}

/* ─── Nav buttons ─── */
.nav-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn {
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.01em;
}

.btn-back {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-muted);
    padding: 14px 20px;
}

.btn-back:hover {
    border-color: rgba(255,255,255,0.25);
    color: var(--text);
}

.btn-next {
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
    color: #fff;
    box-shadow: var(--shadow-blue);
    flex: 1;
}

.btn-next:hover {
    background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 100%);
    box-shadow: 0 12px 40px rgba(37,99,235,0.4);
    transform: translateY(-1px);
}

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

.btn-submit {
    background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 100%);
    color: #fff;
    box-shadow: 0 8px 32px rgba(34,197,94,0.3);
    flex: 1;
    font-size: 1rem;
    width: 100%;
}

.btn-submit:hover {
    box-shadow: 0 12px 40px rgba(34,197,94,0.45);
    transform: translateY(-1px);
}

/* ─── Footer ─── */
.form-footer {
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    opacity: 0.7;
}

/* ─── Error message ─── */
.error-msg {
    font-size: 0.8rem;
    color: var(--error);
    margin-top: -4px;
    display: none;
}
.error-msg.visible { display: block; }

/* ─── Success screen ─── */
.success-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
    padding: 16px 0;
}

.success-screen.active { display: flex; }

.success-icon {
    font-size: 3.5rem;
    animation: pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.success-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
}

.success-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 380px;
}

/* ─── Responsive ─── */
@media (max-width: 520px) {
    .form-card { padding: 24px 20px; }
    .step-title { font-size: 1.2rem; }
    .options-grid { grid-template-columns: 1fr; }
    .submit-row { flex-direction: column; }
    .btn { width: 100%; text-align: center; }
}

/* ─── form-card fondo blanco: overrides de legibilidad ─── */
.form-card .step-title   { color: #111827; }
.form-card .step-desc    { color: #6B7280; }

.form-card .step-highlight {
    background: rgba(37,99,235,0.07);
    color: #1E3A8A;
    border-left-color: var(--blue);
}

.form-card .field-label  { color: #374151; }
.form-card .req          { color: var(--blue); }

.form-card .text-input {
    background: #F9FAFB;
    border-color: #D1D5DB;
    color: #111827;
}
.form-card .text-input::placeholder { color: #9CA3AF; }
.form-card .text-input:focus {
    background: #fff;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.form-card .text-input.error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}

.form-card .option-content {
    background: #F3F4F6;
    border-color: #E5E7EB;
}
.form-card .option-text { color: #111827; }

.form-card .option-card:hover .option-content {
    border-color: var(--blue-light);
    background: #EFF6FF;
}
.form-card .option-card:has(input[type="radio"]:checked) .option-content {
    background: #EFF6FF;
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}
.form-card .option-card:has(input[type="checkbox"]:checked) .option-content {
    background: #F0FDF4;
    border-color: var(--green);
    box-shadow: 0 0 0 2px rgba(34,197,94,0.12);
}
.form-card .options-grid.error .option-content {
    border-color: var(--error);
}

/* success en card blanca */
.form-card .success-title { color: #111827; }
.form-card .success-desc  { color: #4B5563; }

/* ─── Loading spinner en botón submit ─── */
.btn-submit.loading {
    opacity: 0.75;
    cursor: not-allowed;
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-submit.loading::after {
    content: '';
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Confetti dots ─── */
.confetti-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    pointer-events: none;
    animation: confetti-fall 1s ease-in forwards;
}
@keyframes confetti-fall {
    0%   { transform: translateY(-10px) rotate(0deg);   opacity: 1; }
    100% { transform: translateY(80px)  rotate(540deg); opacity: 0; }
}
.success-screen { position: relative; overflow: hidden; }

/* ─── Badge 24 hs ─── */
.success-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(34,197,94,0.12);
    border: 1px solid rgba(34,197,94,0.35);
    border-radius: 99px;
    padding: 6px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--green);
    animation: badgePop 0.5s 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
}
.form-card .success-badge {
    background: #F0FDF4;
    border-color: rgba(34,197,94,0.4);
    color: #15803D;
}
@keyframes badgePop {
    from { transform: scale(0.7); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}
