/* =========================================================
   REGISTRO PÚBLICO DE PACIENTES
   Se carga después de historial1.css (mismos campos del expediente)
   ========================================================= */

body {
    background: linear-gradient(135deg, #b6e2f2, #f5faff);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

[hidden] { display: none !important; }

/* ---------- Encabezado ---------- */
.registro-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 10px 24px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.registro-logo { height: 70px; }

.registro-header-acciones {
    display: flex;
    gap: 1.2rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.link-button {
    background: none;
    border: none;
    padding: 0;
    color: #007baf;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.link-button:hover { text-decoration: underline; }

.page-background {
    flex: 1;
    padding: 70px 2rem 2rem;
    align-items: flex-start;
}

/* ---------- Pasos (barra lateral) ---------- */
.registro-pasos li {
    cursor: default;
    opacity: 0.55;
}

.registro-pasos li.visitado {
    cursor: pointer;
    opacity: 1;
}

.registro-pasos li.active { opacity: 1; }

.num-paso {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #007baf;
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.registro-pasos li.completo .num-paso { background: #10b981; }

/* ---------- Elementos comunes ---------- */
.aviso {
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    line-height: 1.45;
}

.aviso-info {
    background: #e0f2fe;
    color: #075985;
    border: 1px solid #bae6fd;
}

.tarjeta {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    max-width: 800px;
    margin: 0 auto;
}

.titulo-paso {
    display: flex;
    justify-content: center;
    align-items: center;
    color: #003344;
}

.button-row-fin { justify-content: flex-end; }
.button-row-centro { justify-content: center; }

.next-step-button { text-decoration: none; display: inline-block; }

.next-step-button:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
}

.texto-ayuda {
    color: #4b5563;
    font-size: 0.9rem;
    margin: 8px 0;
}

.mensaje {
    min-height: 1.2em;
    margin: 10px 0 0;
    font-weight: 600;
    font-size: 0.95rem;
}

.mensaje.error { color: #b91c1c; }
.mensaje.ok { color: #047857; }
.mensaje.info { color: #075985; }

.info-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 22px;
    height: 22px;
    background-color: #2563eb;
    color: white;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
    font-style: normal;
    margin-left: 8px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.info-icon:hover { background-color: #1d4ed8; }

/* ---------- Consentimiento y firma ---------- */
.consentimiento-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: left;
}

.check-grande {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05em;
    cursor: pointer;
    color: #1f2937;
}

.check-grande input {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    margin: 0;
}

.firma-box { text-align: center; }

#firmaCanvas {
    border: 2px dashed #ccc;
    border-radius: 8px;
    cursor: crosshair;
    background: #fff;
    width: 100%;
    max-width: 600px;
    height: auto;
    aspect-ratio: 3 / 1;
    touch-action: none;
}

.boton-secundario {
    margin-top: 10px;
    padding: 8px 16px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* ---------- Crear cuenta ---------- */
.tipo-cuenta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto 1.5rem;
}

.opcion-tipo {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px;
    background: white;
    border: 2px solid #dbeef6;
    border-radius: 10px;
    cursor: pointer;
    font-weight: normal;
}

.opcion-tipo:has(input:checked) {
    border-color: #007baf;
    background: #f0f9ff;
}

.opcion-tipo input {
    width: 20px;
    height: 20px;
    margin: 2px 0 0;
    flex-shrink: 0;
}

.opcion-tipo strong {
    display: block;
    color: #003344;
    margin-bottom: 4px;
}

.opcion-tipo small {
    color: #4b5563;
    line-height: 1.4;
}

.bloque-cuenta { display: flex; flex-direction: column; gap: 6px; }

.fila-accion {
    display: flex;
    gap: 10px;
    align-items: stretch;
    margin-top: 4px;
}

.fila-accion > :first-child { flex: 1; }
.fila-accion .iti { flex: 1; }

.boton-accion {
    background: #007baf;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0 16px;
    min-height: 38px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    margin-top: 4px;
}

.boton-accion:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.input-codigo {
    text-align: center;
    letter-spacing: 6px;
    font-size: 1.2rem;
    font-weight: bold;
}

.iti { width: 100%; }

input[type="tel"], .input-codigo, .campo-password input {
    min-height: 38px;
}

.dos-columnas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.campo-password { position: relative; }

.campo-password input { padding-right: 40px; }

.ver-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-40%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.metodo-tutor {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 6px;
}

.metodo-tutor label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: normal;
    cursor: pointer;
}

.metodo-tutor input { width: auto; margin: 0; }

.boton-crear { font-size: 1.05rem; padding: 0.7rem 1.6rem; }

/* ---------- Registro terminado ---------- */
.registro-listo {
    text-align: center;
    padding: 2rem 1rem;
    color: #003344;
}

.icono-listo { font-size: 56px; }

#listoTexto {
    font-size: 1.1rem;
    line-height: 1.5;
    max-width: 560px;
    margin: 0 auto;
}

/* ---------- Modales ---------- */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 16px;
}

.modal-caja {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.modal-caja h3 { color: #333; margin-top: 0; }

.icono-modal { font-size: 50px; margin-bottom: 10px; }

.modal-desc {
    color: #4b5563;
    line-height: 1.5;
    text-align: left;
    background: #f3f4f6;
    padding: 15px;
    border-radius: 8px;
}

/* ---------- Pie ---------- */
.registro-footer {
    text-align: center;
    padding: 16px;
    color: #4b5563;
    font-size: 0.85rem;
}

.registro-footer a { color: inherit; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    /* Pasos en horizontal arriba del formulario */
    .registro-pasos { box-sizing: border-box; }

    .registro-pasos ul {
        display: flex;
        margin: 0;
        gap: 4px;
    }

    .registro-pasos li {
        flex: 1;
        flex-direction: column;
        text-align: center;
        font-size: 0.75rem;
        padding: 6px 2px;
        margin: 0;
    }
}

@media (max-width: 600px) {
    .registro-header { padding: 8px 16px; }
    .registro-logo { height: 52px; }
    .registro-header-acciones { gap: 0.4rem 1rem; font-size: 0.85rem; }

    .page-background { padding: 1rem 0.5rem; }
    .folder-container { width: 100%; }

    .tipo-cuenta,
    .dos-columnas { grid-template-columns: 1fr; }

    .tarjeta { padding: 16px; }

    .fila-accion { flex-direction: column; }
    .boton-accion { min-height: 42px; }

    .datos-izq,
    .datos-der { width: 100%; }
}
