/* =============================================================================
   Seguro de Documentos - página pública de autoservicio (canal Correos)
   Tarea Bitrix #287114

   Reconstrucción en HTML/CSS vivo de la maqueta entregada por el negocio.
   La maqueta traía las coberturas, la línea de beneficios y el botón del hero
   como imágenes; acá van como texto real para que sean responsive, accesibles
   y para que los precios se puedan cambiar desde la base de datos.

   Solo se conservan como imagen las piezas de arte: el fondo, los documentos
   flotantes, los tres documentos de las tarjetas y los logos.
   ============================================================================= */

:root {
    --navy: #0B3B8C;
    --navy-d: #082C6B;
    --green: #5CB335;
    --green-d: #4C9A2A;
    --ink: #12294F;
    --slate: #33415C;
    --muted: #7A879C;
    --line: #E3E8F0;
    --page: #F4F7FB;
    --danger: #C0392B;
    --danger-bg: #FDEDEC;
    --ok: #1E8449;
    --ok-bg: #EAF7EF;
    --warn: #9C6500;
    --warn-bg: #FFF4E0;
}

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

html { scroll-behavior: smooth; }

body.sd-body {
    font-family: 'Poppins', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--slate);
    background: var(--page);
    line-height: 1.6;
}

.sd-body img { display: block; max-width: 100%; }

.sd-wrap { max-width: 1000px; margin: 0 auto; padding: 0 20px; }

/* ------------------------------------------------------------------ Hero -- */
.sd-hero {
    position: relative;
    background: var(--navy) url('../img/Documentos/fondo.png') center/cover no-repeat;
}

.sd-hero-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 46px 40px 92px;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 30px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.sd-hright { display: flex; justify-content: center; align-items: center; }
.sd-hright img { width: 100%; max-width: 540px; }

.sd-lockup { display: flex; align-items: center; gap: 16px; height: 42px; margin-bottom: 30px; }
.sd-lockup img { height: 100%; width: auto; }
.sd-lockup .sd-ins { height: 88%; }
.sd-lockup .sd-bar { width: 1px; height: 78%; background: rgba(255,255,255,.45); }

.sd-h1 {
    font-size: clamp(28px, 3.4vw, 50px);
    line-height: 1.12;
    font-weight: 600;
    color: #fff;
    letter-spacing: -.5px;
}

.sd-sub {
    font-size: clamp(15px, 1.35vw, 20px);
    color: rgba(255,255,255,.92);
    margin-top: 15px;
    max-width: 30em;
    font-weight: 400;
}

/* Pastillas de coberturas: en la maqueta venían como imagen. */
.sd-perils { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }

.sd-peril {
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.32);
    color: #fff;
    border-radius: 999px;
    padding: 6px 18px;
    font-size: 14px;
    font-weight: 500;
}

/* Línea de beneficios: también era imagen en la maqueta. */
.sd-benefits {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    margin-top: 16px;
    color: rgba(255,255,255,.9);
    font-size: 13.5px;
}

.sd-benefits span::before { content: "\2713"; color: #9FE870; font-weight: 700; margin-right: 7px; }

.sd-btn-hero {
    display: inline-block;
    margin-top: 24px;
    background: var(--green);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    padding: 14px 34px;
    border-radius: 999px;
    transition: transform .15s, background .15s;
}

.sd-btn-hero:hover { transform: translateY(-2px); background: var(--green-d); color: #fff; }

.sd-hero-curve {
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    width: 100%; height: 78px;
    display: block;
    z-index: 2;
}

/* ----------------------------------------------------------------- Planes -- */
.sd-plans { padding: 52px 0 20px; text-align: center; }
.sd-eyebrow { color: var(--green-d); font-size: 14px; font-weight: 600; }
.sd-plans h2, .sd-formsec h2 { font-size: 26px; color: var(--ink); font-weight: 700; margin: 6px 0; }
.sd-lead { color: var(--muted); font-size: 15px; max-width: 620px; margin: 0 auto 8px; }

.sd-pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 26px; }

.sd-pcard {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-align: center;
    transition: transform .16s, box-shadow .16s, border-color .16s;
    cursor: pointer;
}

.sd-pcard:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(11,59,140,.15); }

/* Plan elegido: se marca con borde y no solo con color, para que se distinga
   también en pantallas con poco contraste o en escala de grises. */
.sd-pcard.sd-selected { border-color: var(--green); box-shadow: 0 10px 26px rgba(92,179,53,.22); }
.sd-pcard.sd-selected .sd-pick { background: var(--green); }
.sd-pcard.sd-selected .sd-pick::before { content: "\2713  "; }

.sd-ptop { height: 5px; }
.sd-imgzone { height: 158px; display: flex; align-items: center; justify-content: center; padding: 20px 16px 6px; }
.sd-imgzone img { max-height: 100%; max-width: 90%; width: auto; filter: drop-shadow(0 6px 14px rgba(0,0,0,.18)); }

.sd-pbody { padding: 6px 20px 22px; display: flex; flex-direction: column; flex: 1; }
.sd-doc { font-size: 12px; font-weight: 600; letter-spacing: .3px; text-transform: uppercase; }

.sd-pcard h3 {
    font-size: 18px;
    color: var(--ink);
    font-weight: 700;
    margin: 4px 0 14px;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sd-cov { font-size: 12px; color: var(--muted); }
.sd-cov b { color: var(--slate); font-weight: 600; font-size: 15px; }
.sd-price { font-size: 30px; color: var(--ink); font-weight: 700; margin: 8px 0 0; }
.sd-per { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.sd-meta { font-size: 11.5px; color: #9AA4B5; margin-bottom: 18px; line-height: 1.5; }

.sd-pick {
    margin-top: auto;
    background: var(--navy);
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    width: 100%;
}

.sd-pick:hover { background: var(--navy-d); }

/* --------------------------------------------------------------- Formulario -- */
.sd-formsec { padding: 44px 0 10px; }

.sd-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    max-width: 900px;
    margin: 26px auto 0;
}

.sd-banner {
    background: #F0F6EC;
    border-bottom: 1px solid #DDEED0;
    padding: 15px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.sd-banner .sd-l { font-size: 14px; color: var(--slate); }
.sd-banner .sd-l b { color: var(--ink); }
.sd-banner .sd-p { font-size: 22px; color: var(--ink); font-weight: 700; }
.sd-banner .sd-p small { font-size: 13px; color: var(--muted); font-weight: 400; }

.sd-form-body { padding: 28px 26px; }
.sd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 26px; }
.sd-grid .sd-full { grid-column: 1 / -1; }

/* min-width:0 es obligatorio: los ítems de una rejilla nacen con min-width:auto,
   así que un hijo ancho ensancha la columna y descuadra las dos columnas enteras. */
.sd-field { min-width: 0; }
.sd-field label { display: block; font-size: 12.5px; font-weight: 500; color: var(--slate); margin-bottom: 6px; }

.sd-body input[type="text"],
.sd-body input[type="email"],
.sd-body input[type="tel"],
.sd-body input[type="date"],
.sd-body input[type="password"],
.sd-body select {
    height: 44px;
    border: 1px solid #CFD6E2;
    border-radius: 10px;
    background: #fff;
    padding: 0 13px;
    font-size: 14px;
    font-family: inherit;
    color: var(--slate);
    width: 100%;
}

.sd-body input:focus, .sd-body select:focus { outline: 2px solid rgba(11,59,140,.35); outline-offset: 1px; }
.sd-body input[readonly], .sd-body input:disabled, .sd-body select:disabled { background: #F2F4F8; color: #5C6B82; }

.sd-row { display: flex; gap: 9px; align-items: center; }

/* El campo que acompaña al prefijo o al botón reparte el espacio sobrante.
   Sin esto hereda el width:100% de la regla general, que en un contenedor flex
   se suma al ancho fijo del vecino y desborda la celda de la rejilla. */
.sd-body .sd-row input,
.sd-body .sd-row select {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
}

/* Se califica con .sd-body y el tipo para ganarle en especificidad a
   `.sd-body input[type="text"]`, que si no impone width:100% al prefijo. */
.sd-body .sd-row input.sd-cc {
    flex: 0 0 96px;
    width: 96px;
    background: #F2F4F8;
    color: #5C6B82;
    text-align: center;
    padding: 0 6px;
}

.sd-consult {
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0 20px;
    height: 44px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    flex: none;
    cursor: pointer;
}

.sd-consult:hover { background: var(--green-d); }

/* Chrome y Edge le meten al date su propio alto y su icono de calendario;
   sin esto el campo queda más bajo que el resto de la fila. */
.sd-body input[type="date"] { -webkit-appearance: none; appearance: none; line-height: 42px; }
.sd-body input[type="date"]::-webkit-calendar-picker-indicator { margin-left: 4px; cursor: pointer; }

.sd-cta {
    margin-top: 26px;
    width: 100%;
    background: var(--navy);
    color: #fff;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.sd-cta:hover { background: var(--navy-d); }
.sd-cta:disabled { background: #90A0BC; cursor: progress; }

.sd-secondary {
    margin-top: 12px;
    width: 100%;
    background: #fff;
    color: var(--slate);
    border: 1px solid #CFD6E2;
    padding: 13px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}

.sd-secure { text-align: center; font-size: 12px; color: var(--muted); margin-top: 14px; }

/* ------------------------------------------------------------------ Avisos -- */
.sd-msg { border-radius: 12px; padding: 14px 18px; font-size: 14px; margin-bottom: 18px; }
.sd-msg-error { background: var(--danger-bg); color: var(--danger); border: 1px solid #F5B7B1; }
.sd-msg-ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #A9DFBF; }
.sd-msg-warn { background: var(--warn-bg); color: var(--warn); border: 1px solid #F5D9A0; }

.sd-resumen { list-style: none; margin: 18px 0 0; }
.sd-resumen li { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.sd-resumen li span:first-child { color: var(--muted); }
.sd-resumen li span:last-child { color: var(--ink); font-weight: 600; text-align: right; }

/* Capa de espera: la emisión de la póliza es asíncrona y puede tardar cerca de
   un minuto, así que hay que impedir que la persona vuelva a enviar el pago. */
.sd-overlay {
    position: fixed;
    inset: 0;
    background: rgba(18,41,79,.72);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 60;
    padding: 20px;
}

.sd-overlay-box { background: #fff; border-radius: 16px; padding: 30px 34px; max-width: 420px; text-align: center; }
.sd-overlay-box h3 { color: var(--ink); font-size: 18px; margin-bottom: 8px; }
.sd-overlay-box p { font-size: 14px; color: var(--slate); }

.sd-spinner {
    width: 38px; height: 38px;
    margin: 0 auto 16px;
    border: 4px solid var(--line);
    border-top-color: var(--navy);
    border-radius: 50%;
    animation: sd-spin 1s linear infinite;
}

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

/* ------------------------------------------------------------------ Footer -- */
.sd-footer { background: var(--navy-d); color: rgba(255,255,255,.8); padding: 30px 0; margin-top: 20px; }
.sd-footer .sd-wrap { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.sd-footer .sd-op { display: flex; align-items: center; gap: 10px; font-size: 12px; color: rgba(255,255,255,.6); }
.sd-footer .sd-op img { height: 24px; opacity: .9; }
.sd-footer .sd-legal { font-size: 12px; color: rgba(255,255,255,.6); max-width: 540px; text-align: right; }

/* ------------------------------------------- Campo bloqueado y ayuda del campo */

/* "Tipo de documento" lo decide la tarjeta de plan, no la persona. Se ve apagado
   y no recibe el foco, pero NO se deshabilita en el marcado: un control
   deshabilitado no viaja en el POST. El valor real va en un campo oculto. */
.sd-body input.sd-locked { background: #F2F4F8; color: #5C6B82; cursor: not-allowed; }

.sd-info {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border: 1px solid #CFD6E2;
    border-radius: 50%;
    background: #fff;
    color: var(--navy);
    font-size: 16px;
    line-height: 1;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
}

.sd-info:hover { background: #EEF3FC; }
.sd-info:focus { outline: 2px solid rgba(11,59,140,.35); outline-offset: 1px; }

/* La ayuda se abre con clic (no solo con el mouse encima): en celular no hay
   puntero y un tooltip de :hover sería invisible justo donde más se necesita. */
.sd-tip {
    display: none;
    margin-top: 8px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--navy);
    border-radius: 8px;
    background: #EEF3FC;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--slate);
}

.sd-field.sd-tip-open .sd-tip { display: block; }

/* Permanent note under a field (not a toggled tip) */
.sd-nota {
    display: block;
    margin-top: 6px;
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--slate);
}

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 820px) {
    .sd-hero-inner { grid-template-columns: 1fr; padding: 34px 22px 70px; }
    .sd-hright { margin-top: 6px; }
    .sd-hright img { max-width: 420px; }
    .sd-hero-curve { height: 46px; }
    .sd-pgrid { grid-template-columns: 1fr; }
    .sd-grid { grid-template-columns: 1fr; }
    .sd-footer .sd-wrap { flex-direction: column; text-align: center; }
    .sd-footer .sd-legal { text-align: center; }
    .sd-banner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 420px) {
    .sd-lockup { height: 32px; gap: 11px; }
    .sd-form-body { padding: 22px 16px; }
    .sd-consult { padding: 0 13px; }
    .sd-body .sd-row input.sd-cc { flex: 0 0 78px; width: 78px; }
}
