/*
 * Paso «Empecemos por conocerte»: nombre, sexo, edad y correo juntos y al alcance del pulgar.
 * Objetivos táctiles de 48-62 px, un solo bloque visible en tableta y mensajes de error debajo de cada campo.
 */
.gimsa-intake-root .profile-stage .recovery-banner { margin-bottom: 16px; padding: 11px 14px; }
.gimsa-intake-root .profile-stage .lead { margin-bottom: 20px; }
.gimsa-intake-root .profile-stage h2 { margin-bottom: 14px; }
.gimsa-intake-root .profile-stage .recovery-banner + h2 { margin-top: 0; }

.gimsa-intake-root .profile-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 18px 16px;
    align-items: start;
}

.gimsa-intake-root .profile-name,
.gimsa-intake-root .profile-sex,
.gimsa-intake-root .profile-grid > .existing-record-notice { grid-column: 1 / -1; }
.gimsa-intake-root .profile-age { grid-column: span 2; }
.gimsa-intake-root .profile-email { grid-column: span 4; }
.gimsa-intake-root .profile-municipality,
.gimsa-intake-root .profile-phone,
.gimsa-intake-root .profile-phone-field { grid-column: span 3; }
.gimsa-intake-root .profile-phone-field { grid-column: 1 / -1; }

/* Sexo: tres botones grandes en una sola fila, un toque. */
.gimsa-intake-root .profile-sex { min-width: 0; margin: 0; padding: 0; border: 0; gap: 8px; }
.gimsa-intake-root .profile-sex > legend { padding: 0; margin-bottom: 8px; }
.gimsa-intake-root .segmented-group {
    display: grid;
    grid-template-columns: repeat(var(--segments, 3), minmax(0, 1fr));
    gap: 10px;
    border-radius: 18px;
}
.gimsa-intake-root .segment { position: relative; min-width: 0; margin: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.gimsa-intake-root .segment > input { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; opacity: 0; pointer-events: none; }
.gimsa-intake-root .segment > span {
    display: flex;
    min-height: 62px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 10px 12px;
    border: 1.5px solid #d7e1e9;
    border-radius: 16px;
    background: #fff;
    color: #1e3b57;
    box-shadow: 0 4px 16px rgba(0, 30, 80, .035);
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease, color .16s ease;
}
.gimsa-intake-root .segment > span i { font-size: 24px; color: #6f89a1; transition: color .16s ease; }
.gimsa-intake-root .segment > span b { font-size: 17px; font-weight: 750; letter-spacing: -.005em; }
.gimsa-intake-root .segment:active > span { transform: scale(.975); }
.gimsa-intake-root .segment > input:checked + span {
    border-color: var(--control-focus, #0068d7);
    background: #edf6ff;
    color: #07498f;
    box-shadow: 0 0 0 3px rgba(0, 104, 215, .1), 0 8px 22px rgba(0, 30, 80, .06);
}
.gimsa-intake-root .segment > input:checked + span i { color: var(--control-focus, #0068d7); }
.gimsa-intake-root .segment > input:focus-visible + span { outline: 3px solid rgba(0, 104, 215, .35); outline-offset: 3px; }
.gimsa-intake-root .segmented-group.invalid-selection .segment > span { border-color: #cb4f4f; background: #fffafa; }

/* Edad: teclado numérico; − y + para corregir sin teclear. */
.gimsa-intake-root .profile-age .age-control { display: grid; grid-template-columns: 46px minmax(0, 1fr) 46px; gap: 6px; align-items: center; }
.gimsa-intake-root .profile-age .age-control input {
    width: 100%;
    height: 62px;
    padding: 0 2px;
    border: 1px solid var(--control-border, #dbe3ec);
    border-radius: 16px;
    background: var(--control-surface, #f4f6f9);
    color: var(--control-ink, #17324e);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 24px;
    font-weight: 800;
    text-align: center;
    font-variant-numeric: tabular-nums;
    box-shadow: inset 0 1px 2px rgba(0, 30, 80, .025);
}
.gimsa-intake-root .profile-age .age-control input::placeholder { color: #8b9bab; font-size: 16px; font-weight: 600; }
.gimsa-intake-root .profile-age .age-control input:focus {
    border-color: var(--control-focus, #0068d7);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(0, 104, 215, .13);
    outline: none;
}
.gimsa-intake-root .age-step {
    width: 46px;
    height: 62px;
    padding: 0;
    border: 1px solid #d7e3ef;
    border-radius: 16px;
    background: #fff;
    color: #0a56a6;
    font-size: 26px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 7px rgba(0, 30, 80, .05);
    transition: background .14s ease, transform .14s ease;
    -webkit-tap-highlight-color: transparent;
}
.gimsa-intake-root .age-step:active { background: #edf6ff; transform: scale(.94); }
.gimsa-intake-root .age-step:focus-visible { outline: 3px solid rgba(0, 104, 215, .35); outline-offset: 2px; }
.gimsa-intake-root .profile-age .age-unit { display: none; }
.gimsa-intake-root .profile-age.invalid-selection .age-control input { border-color: #cb4f4f; background: #fffafa; box-shadow: 0 0 0 4px rgba(201, 71, 71, .1); }

/* Correo: «No tengo correo» junto al título (va después del campo en el HTML para que Tab pase de campo en campo). */
.gimsa-intake-root .profile-email { position: relative; min-width: 0; }
.gimsa-intake-root .profile-email-head { display: flex; min-height: 26px; align-items: center; justify-content: space-between; gap: 10px; }
.gimsa-intake-root .profile-email-head > label { margin: 0; }
.gimsa-intake-root .profile-email .email-unavailable-badge {
    position: absolute;
    top: -2px;
    right: 0;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 9px;
    font-size: 11px;
    transform: none;
}

/* Al pasar de un campo a otro con el teclado, el grupo de sexo se resalta un momento y muestra qué opción tiene el cursor. */
@keyframes profileGroupAttention {
    0% { box-shadow: 0 0 0 0 rgba(0, 104, 215, .5); }
    70% { box-shadow: 0 0 0 12px rgba(0, 104, 215, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 104, 215, 0); }
}
.gimsa-intake-root .segmented-group.is-attention { animation: profileGroupAttention 1.1s ease-out 1; }
.gimsa-intake-root .segmented-group:focus-within .segment > input:focus + span { border-color: #7fb3e6; }
.gimsa-intake-root .email-domains { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.gimsa-intake-root .email-domain {
    min-height: 40px;
    padding: 0 13px;
    border: 1px solid #cfe0ef;
    border-radius: 999px;
    background: #f1f8ff;
    color: #0a56a6;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .14s ease, transform .14s ease, border-color .14s ease;
    -webkit-tap-highlight-color: transparent;
}
.gimsa-intake-root .email-domain:active { background: #dcecfb; border-color: #89bde6; transform: scale(.96); }
.gimsa-intake-root .email-domain:focus-visible { outline: 3px solid rgba(0, 104, 215, .35); outline-offset: 2px; }

/* Celular ya escrito en la primera pantalla: solo se muestra, con su estado y la opción de cambiarlo. */
.gimsa-intake-root .profile-phone { min-width: 0; }
.gimsa-intake-root .profile-phone-label { color: #405972; font-size: 13px; font-weight: 700; letter-spacing: .01em; }
.gimsa-intake-root .profile-phone-card {
    display: flex;
    min-height: 62px;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
    padding: 8px 12px 8px 14px;
    border: 1px solid #e0e8ef;
    border-radius: 16px;
    background: #f7f9fb;
}
.gimsa-intake-root .profile-phone-icon { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 11px; background: #e8eef4; color: #4d6a84; font-size: 19px; }
.gimsa-intake-root .profile-phone-card.is-confirmed .profile-phone-icon { background: #e3f5ec; color: #12824f; }
.gimsa-intake-root .profile-phone-copy { display: grid; min-width: 0; flex: 1 1 150px; gap: 1px; }
.gimsa-intake-root .profile-phone-copy b { color: #17324e; font-size: 16px; font-variant-numeric: tabular-nums; letter-spacing: .01em; white-space: nowrap; }
.gimsa-intake-root .profile-phone-copy small { color: #688096; font-size: 12px; font-weight: 600; line-height: 1.3; }
.gimsa-intake-root .profile-phone-card.is-confirmed .profile-phone-copy small { color: #12824f; }
.gimsa-intake-root .profile-phone-change {
    min-height: 44px;
    margin-left: auto;
    padding: 0 12px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: #0a56a6;
    font-size: 14px;
    font-weight: 750;
    cursor: pointer;
}
.gimsa-intake-root .profile-phone-change:active { background: #e6f1fb; }
.gimsa-intake-root .profile-phone-change:focus-visible { outline: 3px solid rgba(0, 104, 215, .35); outline-offset: 2px; }

/* El recuadro rojo genérico sobra aquí: el control marcado y su mensaje bastan. */
.gimsa-intake-root .profile-grid .invalid-selection { outline: 0; box-shadow: none; }

/* Mensajes de error: justo debajo del campo, en lenguaje claro. */
.gimsa-intake-root .stage .client-error[hidden] { display: none !important; }
.gimsa-intake-root .profile-grid .field-error { display: block; margin-top: -2px; }

/* Tableta vertical: la columna es angosta; edad y correo no comparten renglón y el celular ocupa todo el ancho. */
@media (min-width: 761px) and (max-width: 900px) {
    .gimsa-intake-root .profile-age { grid-column: 1 / -1; max-width: 290px; }
    .gimsa-intake-root .profile-email,
    .gimsa-intake-root .profile-municipality,
    .gimsa-intake-root .profile-phone { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
    .gimsa-intake-root .profile-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .gimsa-intake-root .profile-name,
    .gimsa-intake-root .profile-sex,
    .gimsa-intake-root .profile-age,
    .gimsa-intake-root .profile-email,
    .gimsa-intake-root .profile-municipality,
    .gimsa-intake-root .profile-phone,
    .gimsa-intake-root .profile-phone-field,
    .gimsa-intake-root .profile-grid > .existing-record-notice { grid-column: 1 / -1; }
    .gimsa-intake-root .profile-age .age-control { grid-template-columns: 56px minmax(0, 1fr) 56px; gap: 8px; }
    .gimsa-intake-root .age-step { width: 56px; }
    .gimsa-intake-root .segment > span { min-height: 60px; padding: 8px 6px; gap: 6px; }
    .gimsa-intake-root .segment > span i { font-size: 22px; }
    .gimsa-intake-root .segment > span b { font-size: 16px; }
}

@media (max-width: 380px) {
    .gimsa-intake-root .segment > span i { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .gimsa-intake-root .segmented-group.is-attention { animation: none; }
    .gimsa-intake-root .segment > span,
    .gimsa-intake-root .age-step,
    .gimsa-intake-root .email-domain { transition: none; }
}
