/*
 * Registro público — modal de la landing y de las páginas SEO.
 *
 * Depende de LandingPage.css, que define la paleta en :root (--p1, --p2,
 * --accent, --navy, --slate) y el reset.
 *
 * Escrito a mano igual que LandingPage.css: NO pasa por webpack, no hay que
 * compilar nada para verlo.
 */

:root {
    --rg-borde: #dbe3f0;
    --rg-fondo: #f4f7fc;
    --rg-suave: #5a6b85;
    --rg-error: #c0392b;
    --rg-error-bg: #fdecea;
    --rg-ok: #1e7d43;
    --rg-ok-bg: #e8f6ed;
}

/* ─── MODAL ─── */
.rg-sin-scroll { overflow: hidden; }

.rg-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2.5rem 1rem;
    overflow-y: auto;
}
.rg-modal[hidden] { display: none; }

.rg-modal-fondo {
    position: fixed;
    inset: 0;
    background: rgba(6, 15, 30, .62);
    backdrop-filter: blur(3px);
}

.rg-modal-caja {
    position: relative;
    width: 100%;
    max-width: 720px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(6, 15, 30, .35);
    overflow: hidden;
    animation: rg-entrar .18s ease-out;
}
@keyframes rg-entrar {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.rg-modal-encabezado {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.4rem 1.6rem;
    background: linear-gradient(135deg, var(--p1), var(--p3));
    color: #fff;
}
.rg-modal-encabezado h2 { font-size: 1.15rem; font-weight: 800; margin: 0; }
.rg-modal-encabezado p {
    margin: .35rem 0 0;
    font-size: .84rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, .82);
}
.rg-modal-cerrar {
    background: rgba(255, 255, 255, .14);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    flex: 0 0 auto;
}
.rg-modal-cerrar:hover { background: rgba(255, 255, 255, .28); }

.rg-modal-cuerpo {
    padding: 1.5rem 1.6rem 1.75rem;
    max-height: calc(100vh - 12rem);
    overflow-y: auto;
}

/* ─── BLOQUES DEL FORMULARIO ─── */
.rg-bloque { margin-bottom: 1.4rem; }
.rg-bloque:last-of-type { margin-bottom: 0; }

.rg-bloque-titulo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: #94a3b8;
    padding-bottom: .5rem;
    margin-bottom: .9rem;
    border-bottom: 1px solid var(--rg-borde);
}

.rg-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem;
}
.rg-col-2 { grid-column: 1 / -1; }

.rg-field { display: flex; flex-direction: column; min-width: 0; }
.rg-field label {
    font-size: .82rem;
    font-weight: 600;
    color: var(--slate);
    margin-bottom: .3rem;
}
.rg-opcional { font-weight: 400; color: #94a3b8; }

.rg-field input[type="text"],
.rg-field input[type="email"],
.rg-field input[type="password"],
.rg-field select {
    width: 100%;
    padding: .55rem .7rem;
    border: 1px solid var(--rg-borde);
    border-radius: 8px;
    font-family: inherit;
    font-size: .92rem;
    color: var(--navy);
    background: #fff;
}
.rg-field input:focus,
.rg-field select:focus {
    outline: none;
    border-color: var(--p3);
    box-shadow: 0 0 0 3px rgba(21, 101, 192, .13);
}
.rg-field select:disabled { background: #f1f4f9; color: #93a1b8; }

/* ─── SELECT CON BUSCADOR ───
   El <select> nativo se esconde pero sigue en el DOM: es el que viaja en el POST.
   Lo que se ve y se tipea es .rg-combo-entrada. */
.rg-combo { position: relative; }
.rg-combo-nativo { display: none; }

.rg-combo-entrada {
    width: 100%;
    padding: .55rem 2rem .55rem .7rem;
    border: 1px solid var(--rg-borde);
    border-radius: 8px;
    font-family: inherit;
    font-size: .92rem;
    color: var(--navy);
    background: #fff;
    cursor: text;
}
.rg-combo-entrada:focus {
    outline: none;
    border-color: var(--p3);
    box-shadow: 0 0 0 3px rgba(21, 101, 192, .13);
}
.rg-combo-entrada:disabled { background: #f1f4f9; color: #93a1b8; cursor: not-allowed; }
.rg-combo-entrada::placeholder { color: #9aa8bd; }

/* Chevron dibujado con bordes: sin imágenes ni fuentes de iconos. */
.rg-combo::after {
    content: '';
    position: absolute;
    right: .8rem;
    top: 50%;
    width: 7px;
    height: 7px;
    margin-top: -5px;
    border-right: 2px solid #9aa8bd;
    border-bottom: 2px solid #9aa8bd;
    transform: rotate(45deg);
    pointer-events: none;
    transition: transform .15s;
}
.rg-combo.esta-abierto::after { transform: rotate(-135deg); margin-top: -2px; }

.rg-combo-lista {
    position: absolute;
    z-index: 20;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 240px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--rg-borde);
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(6, 15, 30, .16);
    padding: .3rem;
}
.rg-combo-lista[hidden] { display: none; }

.rg-combo-item {
    padding: .45rem .6rem;
    border-radius: 6px;
    font-size: .9rem;
    color: var(--navy);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rg-combo-item:hover,
.rg-combo-item.esta-marcado { background: #eef3fc; color: var(--p2); }
.rg-combo-item.es-actual { font-weight: 700; color: var(--p2); }

.rg-combo-vacio {
    padding: .5rem .6rem;
    font-size: .82rem;
    color: var(--rg-suave);
}

/* ─── CONTRASEÑA ─── */
.rg-clave { position: relative; }
.rg-clave input { width: 100%; padding-right: 2.4rem; }

.rg-ojo {
    position: absolute;
    right: .2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    border: none;
    background: none;
    color: #9aa8bd;
    cursor: pointer;
    font-size: .9rem;
    border-radius: 6px;
}
.rg-ojo:hover { color: var(--p2); background: #eef3fc; }

.rg-requisitos {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .3rem .9rem;
    margin-top: .2rem;
    padding: .6rem .75rem;
    background: #f8fafc;
    border: 1px solid var(--rg-borde);
    border-radius: 8px;
}
.rg-requisitos li {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .8rem;
    color: var(--rg-suave);
}
.rg-requisitos li i { font-size: .78rem; width: 1rem; text-align: center; }
.rg-requisitos li.esta-ok { color: var(--rg-ok); }
.rg-requisitos li.esta-ok i { color: var(--rg-ok); }

/* NIT + dígito de verificación calculado */
.rg-nit { display: flex; align-items: stretch; gap: .4rem; }
.rg-nit input { flex: 1 1 auto; min-width: 0; }
.rg-nit-dv {
    display: flex;
    align-items: center;
    padding: 0 .6rem;
    border: 1px dashed var(--rg-borde);
    border-radius: 8px;
    font-size: .8rem;
    font-weight: 700;
    color: #9aa8bd;
    background: #f8fafc;
    white-space: nowrap;
}
.rg-nit-dv.tiene-valor { color: var(--p2); border-style: solid; border-color: #cfe0f7; background: #eef3fc; }

.rg-rut-clave { margin-bottom: .9rem; }
.rg-rut-clave input {
    width: 100%;
    padding: .45rem .7rem;
    border: 1px dashed var(--rg-borde);
    border-radius: 8px;
    font-family: inherit;
    font-size: .84rem;
    color: var(--navy);
    background: #fbfcfe;
}
.rg-rut-clave input:focus {
    outline: none;
    border-style: solid;
    border-color: var(--p3);
    box-shadow: 0 0 0 3px rgba(21, 101, 192, .13);
}

.rg-subdominio { display: flex; align-items: center; gap: .4rem; }
.rg-subdominio input { flex: 1 1 auto; }
.rg-subdominio span { font-size: .85rem; color: var(--rg-suave); white-space: nowrap; }

.rg-resumen-linea {
    margin-top: .6rem;
    font-size: .82rem;
    color: var(--p2);
    font-weight: 600;
}

/* ─── RUT ─── */
.rg-rut-link {
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    color: var(--p2);
    background: #eef3fc;
    border: 1px solid #cfe0f7;
    border-radius: 999px;
    padding: .28rem .7rem;
    cursor: pointer;
}
.rg-rut-link:hover { background: var(--p3); color: #fff; border-color: var(--p3); }

.rg-rut-estado {
    font-size: .82rem;
    padding: .5rem .75rem;
    border-radius: 8px;
    margin-bottom: .9rem;
}
.rg-rut-cargando { background: #eef3fc; color: var(--p2); }
.rg-rut-ok { background: var(--rg-ok-bg); color: var(--rg-ok); }
.rg-rut-error { background: var(--rg-error-bg); color: var(--rg-error); }

/* ─── Errores ─── */
.rg-alert {
    padding: .85rem 1rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    font-size: .88rem;
    line-height: 1.5;
}
.rg-alert-error {
    background: var(--rg-error-bg);
    color: var(--rg-error);
    border: 1px solid #f5c6c2;
}
.rg-alert ul { margin: .35rem 0 0 1.1rem; }

/* ─── Términos ─── */
.rg-check {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    margin-top: 1rem;
    font-size: .85rem;
    color: var(--slate);
    line-height: 1.5;
}
.rg-check input { margin-top: .2rem; flex: 0 0 auto; }
.rg-check a { color: var(--p2); font-weight: 600; }

/* ─── Acciones ─── */
.rg-acciones {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--rg-borde);
}
.rg-btn-primario {
    width: 100%;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 9px;
    padding: .8rem 1rem;
    font-family: inherit;
    font-size: .98rem;
    font-weight: 800;
    cursor: pointer;
}
.rg-btn-primario:hover { background: var(--accent2); }
.rg-btn-primario:disabled { background: #b9c4d6; cursor: not-allowed; }

.rg-nota {
    font-size: .78rem;
    color: var(--rg-suave);
    margin-top: .7rem;
    line-height: 1.45;
    text-align: center;
}

/* ─── Responsive ─── */
@media (max-width: 620px) {
    .rg-modal { padding: 0; align-items: stretch; }
    .rg-modal-caja { max-width: none; border-radius: 0; min-height: 100vh; }
    .rg-modal-cuerpo { max-height: none; }
    .rg-grid { grid-template-columns: minmax(0, 1fr); }
}
