/* ============================================================
   MDC Fase I – Formulario de interesados
   Diseño minimalista blanco con toques azul cosmos
   Soporta modo claro (default) y modo oscuro (toggle + prefers)
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
    --bg:          #f8faff;
    --bg-card:     #ffffff;
    --bg-input:    #f1f5fd;
    --bg-section:  #f8faff;
    --text:        #1e293b;
    --text-muted:  #64748b;
    --text-label:  #334155;
    --border:      #dde5f8;
    --border-focus:#4f7ae8;
    --accent:      #4f7ae8;
    --accent-dark: #3a62c8;
    --accent-light:#e8effd;
    --error:       #e53e3e;
    --error-bg:    #fff5f5;
    --success:     #2f855a;
    --success-bg:  #f0fff4;
    --header-from: #0b1120;
    --header-to:   #1e3a6e;
    --shadow:      0 4px 32px rgba(79,122,232,0.10);
    --shadow-card: 0 2px 16px rgba(79,122,232,0.08);
    --radius:      12px;
    --radius-sm:   8px;
    --transition:  0.2s ease;
}

.dark {
    --bg:          #0b1120;
    --bg-card:     #111827;
    --bg-input:    #1a2235;
    --bg-section:  #0f1729;
    --text:        #e2e8f0;
    --text-muted:  #94a3b8;
    --text-label:  #cbd5e1;
    --border:      #1e2d4a;
    --border-focus:#6b9fd4;
    --accent:      #6b9fd4;
    --accent-dark: #4f7ae8;
    --accent-light:#1a2744;
    --error:       #fc8181;
    --error-bg:    #1a0e0e;
    --success:     #68d391;
    --success-bg:  #0d1f14;
    --shadow:      0 4px 32px rgba(0,0,0,0.4);
    --shadow-card: 0 2px 16px rgba(0,0,0,0.3);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    background: var(--bg);
    color: var(--text);
    transition: background var(--transition), color var(--transition);
    min-height: 100vh;
}

/* ── Header / Hero ─────────────────────────────────────────── */
.hero {
    background: linear-gradient(160deg, var(--header-from) 0%, #162550 55%, var(--header-to) 100%);
    position: relative;
    overflow: hidden;
    padding: 56px 24px 48px;
    text-align: center;
}

/* Estrellas CSS */
.hero::before,
.hero::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
}

.hero::before {
    background-image:
        radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,0.8) 0%, transparent 100%),
        radial-gradient(1px 1px at 25% 40%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 40% 10%, rgba(255,255,255,0.9) 0%, transparent 100%),
        radial-gradient(1px 1px at 55% 60%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 70% 25%, rgba(255,255,255,0.7) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 80% 70%, rgba(255,255,255,0.8) 0%, transparent 100%),
        radial-gradient(1px 1px at 90% 45%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 15% 75%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 35% 85%, rgba(255,255,255,0.4) 0%, transparent 100%),
        radial-gradient(1px 1px at 62% 90%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 5%  55%, rgba(255,255,255,0.7) 0%, transparent 100%),
        radial-gradient(2px 2px at 48% 30%, rgba(168,196,240,0.6) 0%, transparent 100%),
        radial-gradient(2px 2px at 88% 18%, rgba(168,196,240,0.5) 0%, transparent 100%);
}

.hero::after {
    background: radial-gradient(ellipse at 50% 120%, rgba(79,122,232,0.20) 0%, transparent 70%);
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-label {
    color: #a8c4f0;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.hero h1 {
    color: #ffffff;
    font-size: clamp(22px, 5vw, 34px);
    font-weight: 300;
    letter-spacing: 1px;
    margin-bottom: 8px;
    line-height: 1.3;
}

.hero h1 strong {
    font-weight: 600;
    color: #d0e2ff;
}

.hero-sub {
    color: #7aadda;
    font-size: 14px;
    margin-top: 8px;
    font-style: italic;
}

/* ── Dark mode toggle ────────────────────────────────────────── */
.theme-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 100;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 13px;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(8px);
    transition: background var(--transition), border var(--transition);
    line-height: 1;
}

.theme-toggle:hover {
    background: rgba(255,255,255,0.22);
}

.dark .theme-toggle {
    background: rgba(30,55,100,0.6);
    border-color: rgba(100,160,220,0.3);
    color: #a8c4f0;
}

/* ── Layout ─────────────────────────────────────────────────── */
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 16px 64px;
}

/* ── Logo header ─────────────────────────────────────────────── */
.logo-header {
    text-align: center;
    padding: 32px 24px 0;
    background: var(--bg-card);
    transition: background var(--transition);
}

.logo-img {
    height: 110px;
    width: auto;
    display: inline-block;
    /* Fondo blanco integrado con la card */
    border-radius: var(--radius-sm);
}

/* En modo oscuro el logo tiene fondo blanco visible → le damos un halo suave */
.dark .logo-img {
    background: #ffffff;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.08);
}

/* ── Card / formulario ───────────────────────────────────────── */
.form-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: background var(--transition), box-shadow var(--transition);
}

/* ── Secciones del formulario ────────────────────────────────── */
.form-section {
    padding: 32px 32px 24px;
    border-bottom: 1px solid var(--border);
    transition: border-color var(--transition);
}

.form-section:last-of-type { border-bottom: none; }

.section-title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── Grid campos ─────────────────────────────────────────────── */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-grid .col-full { grid-column: 1 / -1; }

@media (max-width: 560px) {
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .col-full { grid-column: auto; }
    .form-section { padding: 24px 20px 20px; }
}

/* ── Campos ──────────────────────────────────────────────────── */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-label);
    transition: color var(--transition);
}

.field label .req {
    color: var(--accent);
    margin-left: 2px;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: var(--text);
    font-family: inherit;
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
    appearance: none;
    -webkit-appearance: none;
    outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--border-focus);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(79,122,232,0.12);
}

.field input.error,
.field select.error,
.field textarea.error {
    border-color: var(--error);
    background: var(--error-bg);
}

.field textarea {
    resize: vertical;
    min-height: 100px;
}

.field-error {
    font-size: 12px;
    color: var(--error);
    display: none;
    align-items: center;
    gap: 4px;
}

.field-error.visible {
    display: flex;
}

/* ── Teléfono (select + input) ───────────────────────────────── */
.phone-group {
    display: flex;
    gap: 8px;
}

.phone-group select {
    flex: 0 0 auto;
    width: 160px;
    min-width: 140px;
    padding-right: 10px;
}

.phone-group input {
    flex: 1;
}

@media (max-width: 400px) {
    .phone-group { flex-direction: column; }
    .phone-group select { width: 100%; }
}

/* ── Círculos de sanación ─────────────────────────────────────── */
.radio-group {
    display: flex;
    gap: 16px;
    margin-top: 4px;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-label);
    padding: 8px 16px;
    border: 1.5px solid var(--border);
    border-radius: 50px;
    transition: all var(--transition);
    user-select: none;
}

.radio-item:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.radio-item input[type="radio"] {
    width: auto;
    accent-color: var(--accent);
    margin: 0;
    padding: 0;
    border: none;
    box-shadow: none;
    background: transparent;
    flex-shrink: 0;
}

.radio-item input[type="radio"]:focus {
    box-shadow: none;
    border: none;
}

.radio-item.selected {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 500;
}

.circulos-container {
    display: none;
    margin-top: 20px;
    animation: fadeSlide 0.3s ease;
}

.circulos-container.visible { display: block; }

@keyframes fadeSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.circulos-grupo {
    margin-bottom: 16px;
}

.circulos-pais {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
}

.circulos-region {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    margin: 10px 0 6px 4px;
}

.checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-label);
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: 50px;
    padding: 5px 12px;
    transition: all var(--transition);
    user-select: none;
}

.check-item:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.check-item input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--accent);
    margin: 0;
    padding: 0;
    border: none;
    box-shadow: none;
    background: transparent;
    flex-shrink: 0;
}

.check-item input[type="checkbox"]:focus {
    box-shadow: none;
}

.check-item:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 500;
}

/* ── Botón enviar ─────────────────────────────────────────────── */
.form-footer {
    padding: 28px 32px 32px;
    background: var(--bg-section);
    border-top: 1px solid var(--border);
    transition: background var(--transition);
}

.form-footer p.nota {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.5;
}

.btn-submit {
    display: block;
    width: 100%;
    padding: 15px 24px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-submit:hover:not(:disabled) {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79,122,232,0.35);
}

.btn-submit:active:not(:disabled) {
    transform: translateY(0);
}

.btn-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.btn-submit .spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto;
}

.btn-submit.loading .btn-text { display: none; }
.btn-submit.loading .spinner  { display: inline-block; }

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Mensajes globales ────────────────────────────────────────── */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
    display: none;
    align-items: flex-start;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

.alert.visible { display: flex; }
.alert-icon { flex-shrink: 0; font-size: 18px; }

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid currentColor;
}

.alert-error {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid currentColor;
}

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

/* ── Success state (después de envío) ────────────────────────── */
.success-view {
    display: none;
    text-align: center;
    padding: 64px 32px;
    animation: fadeIn 0.5s ease;
}

.success-view.visible { display: block; }

.success-icon {
    font-size: 56px;
    margin-bottom: 20px;
    display: block;
}

.success-view h2 {
    font-size: 24px;
    font-weight: 400;
    color: var(--text);
    margin-bottom: 12px;
}

.success-view p {
    font-size: 15px;
    color: var(--text-muted);
    max-width: 440px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ── Bloque de pago (success-view) ───────────────────────────── */
.pago-bloque {
    margin: 32px auto 24px;
    max-width: 480px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px 32px;
    text-align: center;
}

.pago-descripcion {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px !important;
    line-height: 1.6;
}

.btn-stripe {
    display: inline-block;
    padding: 15px 36px;
    background: #1a7c4a;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    border-radius: 10px;
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: background 0.2s, transform 0.1s;
    box-shadow: 0 4px 14px rgba(26,124,74,0.35);
}

.btn-stripe:hover {
    background: #145e38;
    transform: translateY(-1px);
}

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

.pago-nota {
    margin-top: 14px !important;
    font-size: 12px !important;
    color: var(--text-muted);
    opacity: 0.7;
}

.success-email-nota {
    font-size: 13px !important;
    color: var(--text-muted);
    margin-top: 8px !important;
}

/* ── Footer de página ─────────────────────────────────────────── */
.page-footer {
    text-align: center;
    padding: 24px;
    font-size: 12px;
    color: var(--text-muted);
}

.page-footer a {
    color: var(--accent);
    text-decoration: none;
}

/* ── Select arrow custom ─────────────────────────────────────── */
.field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234f7ae8' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

/* ── Separador de opciones en select ─────────────────────────── */
option.separator { color: #94a3b8; font-style: italic; }

/* ── Responsive ajustes ──────────────────────────────────────── */
@media (max-width: 680px) {
    .container { padding: 20px 8px 48px; }
    .form-footer { padding: 24px 20px 24px; }
}

@media (max-width: 420px) {
    .radio-group { flex-direction: column; gap: 8px; }
    .radio-item  { justify-content: center; }
}
