/* Estilos compartidos: registro, login y recuperar del Portal del Paciente. */

:root {
    --pc-bg-1: #e9f6ff;
    --pc-bg-2: #d9f0ff;
    --pc-bg-3: #bfe7ff;

    --pc-primary: #1f7fd6;
    --pc-primary-2: #2aa7ff;
    --pc-white: #ffffff;
    --pc-ink: #000000b3;
    --pc-muted: #5b6b7a;

    --pc-border: rgba(11, 18, 32, .12);
    --pc-border-2: rgba(11, 18, 32, .16);

    --pc-shadow: 0 14px 40px rgba(0, 0, 0, .12);
    --pc-shadow-soft: 0 8px 22px rgba(0, 0, 0, .10);

    --pc-radius: 20px;
    --pc-radius-sm: 14px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Noto Sans", sans-serif;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: clamp(16px, 3vh, 32px) 16px;
    color: var(--pc-ink);
    background: linear-gradient(to top, #2980b9, #6dd5fa, #ffffff);
    background-attachment: fixed;
}

.wrap {
    width: min(1040px, 100%);
    display: grid;
    grid-template-columns: .92fr 1.08fr;
    gap: 20px;
    align-items: stretch;
}

@media (max-width:900px) {
    .wrap {
        grid-template-columns: 1fr;
    }
}

.panel {
    border-radius: var(--pc-radius);
    border: 1px solid var(--pc-border);
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--pc-shadow);
    overflow: hidden;
}

.left {
    padding: clamp(20px, 2.6vw, 30px);
    position: relative;
}

.right {
    padding: clamp(20px, 2.6vw, 30px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ---------- Marca ---------- */

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(42, 167, 255, .10);
    border: 1px solid rgba(31, 127, 214, .18);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 0 0 auto;
}

.logo img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .10));
}

.brand h1 {
    font-size: 16px;
    line-height: 1.1;
    margin: 0;
    font-weight: 800;
    letter-spacing: .2px;
}

.brand p {
    margin: 3px 0 0;
    font-size: 12.5px;
    color: var(--pc-primary);
    font-weight: 700;
}

/* ---------- Titulares ---------- */

.headline {
    margin: 0 0 16px;
}

.headline h2 {
    margin: 0;
    font-size: clamp(24px, 2.4vw, 30px);
    font-weight: 800;
    letter-spacing: -.2px;
    color: #0b1220;
}

.headline .sub {
    margin: 10px 0 0;
    color: var(--pc-muted);
    font-size: 14.5px;
    line-height: 1.5;
    max-width: 46ch;
}

/* ---------- Banner de seguridad (tarjeta, no badge chico) ---------- */

.security-banner {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-top: 18px;
    padding: 16px;
    border-radius: var(--pc-radius-sm);
    background: linear-gradient(135deg, rgba(42, 167, 255, .12), rgba(31, 127, 214, .06));
    border: 1px solid rgba(31, 127, 214, .22);
}

.security-banner .ico {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .8);
    border: 1px solid rgba(31, 127, 214, .25);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.security-banner .ico img {
    width: 22px;
    height: 22px;
    filter: brightness(0) saturate(100%) invert(35%) sepia(80%) saturate(1200%) hue-rotate(180deg);
}

.security-banner b {
    display: block;
    font-size: 14px;
    font-weight: 800;
    color: #0b1220;
    margin-bottom: 3px;
}

.security-banner span {
    display: block;
    font-size: 13px;
    color: var(--pc-muted);
    line-height: 1.45;
}

/* ---------- Stepper vertical (1-2-3) ---------- */

.steps {
    margin-top: 20px;
    display: grid;
    gap: 0;
}

.step {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 14px;
    position: relative;
    padding-bottom: 16px;
}

.step:last-child {
    padding-bottom: 0;
}

.step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--pc-primary);
    color: #fff;
    font-weight: 800;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    z-index: 1;
    box-shadow: 0 0 0 4px rgba(42, 167, 255, .14);
}

.step:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 15px;
    top: 32px;
    bottom: -2px;
    width: 2px;
    background: rgba(31, 127, 214, .22);
}

.step-card {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: var(--pc-radius-sm);
    border: 1px solid var(--pc-border);
    background: rgba(255, 255, 255, .9);
    box-shadow: var(--pc-shadow-soft);
    margin-top: -3px;
}

.step-card .ico {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: rgba(42, 167, 255, .14);
    border: 1px solid rgba(31, 127, 214, .2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.step-card .ico img {
    width: 17px;
    height: 17px;
    filter: brightness(0) saturate(100%);
    opacity: .82;
}

.step-card b {
    display: block;
    font-size: 13.5px;
    font-weight: 800;
    color: #0b1220;
    margin-bottom: 2px;
}

.step-card span {
    display: block;
    font-size: 12.5px;
    color: var(--pc-muted);
    line-height: 1.4;
}

/* ---------- Features (login / recuperar, sin numerar) ---------- */

.features {
    margin-top: 20px;
    display: grid;
    gap: 10px;
}

.feature {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: var(--pc-radius-sm);
    border: 1px solid var(--pc-border);
    background: rgba(255, 255, 255, .9);
    box-shadow: var(--pc-shadow-soft);
}

.feature .ico {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(42, 167, 255, .14);
    border: 1px solid rgba(31, 127, 214, .2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.feature .ico img {
    width: 17px;
    height: 17px;
    filter: brightness(0) saturate(100%);
    opacity: .82;
}

.feature .txt b {
    display: block;
    font-size: 13.5px;
    font-weight: 800;
    color: #0b1220;
    margin-bottom: 2px;
}

.feature .txt span {
    display: block;
    font-size: 12.5px;
    color: var(--pc-muted);
    line-height: 1.4;
}

/* ---------- Indicadores de confianza (fila de iconos chicos) ---------- */

.trust-row {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--pc-border);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 14px;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--pc-muted);
    font-weight: 700;
}

.trust-item img {
    width: 14px;
    height: 14px;
    filter: brightness(0) saturate(100%);
    opacity: .55;
    flex: 0 0 auto;
}

/* ---------- Tarjeta del formulario ---------- */

.card-title {
    margin: 0 0 6px;
    font-size: clamp(19px, 2vw, 22px);
    font-weight: 800;
    letter-spacing: -.1px;
    color: #0b1220;
}

.card-sub {
    margin: 0 0 20px;
    color: var(--pc-muted);
    font-size: 13.5px;
    line-height: 1.5;
}

.form {
    display: grid;
    gap: 14px;
}

.row {
    display: grid;
    gap: 7px;
}

label {
    display: block;
    font-size: 12.5px;
    color: rgba(11, 18, 32, .82);
    font-weight: 700;
    letter-spacing: .1px;
}

.control {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.control .field-ico {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    pointer-events: none;
    filter: brightness(0) saturate(100%);
    opacity: .38;
}

select,
input {
    width: 100%;
    border-radius: var(--pc-radius-sm);
    border: 1px solid var(--pc-border-2);
    background: rgba(255, 255, 255, .97);
    padding: 12.5px 14px 12.5px 40px;
    color: var(--pc-ink);
    outline: none;
    font-size: 14.5px;
    font-family: inherit;
    min-height: 48px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

select:focus,
input:focus {
    border-color: rgba(31, 127, 214, .5);
    box-shadow: 0 0 0 4px rgba(42, 167, 255, .16);
    background: #fff;
}

input::placeholder {
    color: rgba(11, 18, 32, .4);
}

select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: none;
    padding-right: 38px;
}

.select-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--pc-primary);
    pointer-events: none;
    opacity: .85;
}

.hint {
    font-size: 12px;
    color: var(--pc-muted);
    line-height: 1.4;
}

.hint b {
    color: rgba(11, 18, 32, .7);
}

.captcha-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--pc-radius-sm);
    border: 1px dashed rgba(31, 127, 214, .35);
    background: rgba(42, 167, 255, .08);
    color: rgba(11, 18, 32, .92);
    font-size: 14px;
    font-weight: 800;
}

.captcha-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 78px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(31, 127, 214, .14);
    color: var(--pc-primary);
    font-size: 11px;
    letter-spacing: .5px;
    text-transform: uppercase;
}

/* ---------- Botones ---------- */

.actions {
    display: grid;
    gap: 10px;
    margin-top: 4px;
}

.btn {
    border: none;
    cursor: pointer;
    height: 52px;
    padding: 0 18px;
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: .1px;
    font-size: 15px;
    font-family: inherit;
    transition: transform .08s ease, filter .18s ease, box-shadow .18s ease;
    color: #fff;
    background: linear-gradient(90deg, var(--pc-primary), var(--pc-primary-2));
    box-shadow: 0 10px 24px rgba(31, 127, 214, .28);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    text-decoration: none;
    width: 100%;
}

.btn img {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
}

.btn:hover {
    filter: brightness(1.05);
    box-shadow: 0 12px 28px rgba(31, 127, 214, .36);
}

.btn:active {
    transform: scale(.99);
}

.btn:disabled {
    opacity: .75;
    cursor: default;
    transform: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, .95);
    color: var(--pc-ink);
    border: 1px solid var(--pc-border-2);
    box-shadow: none;
    text-align: center;
}

.btn-secondary:hover {
    filter: none;
    background: #fff;
    border-color: rgba(31, 127, 214, .35);
    box-shadow: var(--pc-shadow-soft);
}

/* ---------- Nota de seguridad bajo el botón ---------- */

.security-note {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 12px;
    color: var(--pc-muted);
    line-height: 1.45;
    margin-top: 2px;
}

.security-note img {
    width: 14px;
    height: 14px;
    margin-top: 1px;
    filter: brightness(0) saturate(100%);
    opacity: .5;
    flex: 0 0 auto;
}

/* ---------- Tarjeta "¿ya tienes cuenta?" ---------- */

.switch-card {
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--pc-radius-sm);
    background: rgba(42, 167, 255, .07);
    border: 1px solid rgba(31, 127, 214, .18);
}

.switch-card .txt b {
    display: block;
    font-size: 13px;
    font-weight: 800;
    color: #0b1220;
}

.switch-card .txt span {
    display: block;
    font-size: 12px;
    color: var(--pc-muted);
    margin-top: 2px;
}

.switch-card a {
    flex: 0 0 auto;
    color: var(--pc-primary);
    text-decoration: none;
    font-weight: 800;
    font-size: 13px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.switch-card a:hover {
    text-decoration: underline;
}

.links {
    margin-top: 6px;
    display: flex;
    justify-content: center;
    gap: 10px;
    font-size: 12.5px;
    color: var(--pc-muted);
}

.links a {
    color: var(--pc-primary);
    text-decoration: none;
    font-weight: 700;
    white-space: nowrap;
}

.links a:hover {
    text-decoration: underline;
}

/* ---------- Alertas / flash ---------- */

.alerts {
    display: grid;
    gap: 10px;
    margin: 0 0 14px;
}

.alert {
    border-radius: var(--pc-radius-sm);
    padding: 12px 14px;
    border: 1px solid var(--pc-border);
    background: rgba(255, 255, 255, .95);
    display: flex;
    gap: 10px;
    align-items: flex-start;
    box-shadow: var(--pc-shadow-soft);
}

.alert-title {
    font-size: 11px;
    letter-spacing: .6px;
    font-weight: 800;
    opacity: .9;
    min-width: 50px;
}

.alert-text {
    font-size: 13px;
    line-height: 1.4;
    color: rgba(11, 18, 32, .92);
}

.alert.is-error {
    border-color: rgba(231, 76, 60, .35);
    background: rgba(231, 76, 60, .09);
    color: #a82315;
}

.alert.is-ok {
    border-color: rgba(34, 197, 94, .35);
    background: rgba(34, 197, 94, .09);
}

.alert.is-info {
    border-color: rgba(42, 167, 255, .35);
    background: rgba(42, 167, 255, .09);
}

/* ---------- Pie del panel izquierdo (badges cortos) ---------- */

.panel-footer {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--pc-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    color: var(--pc-muted);
}

.pill-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pill {
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(42, 167, 255, .1);
    border: 1px solid rgba(31, 127, 214, .16);
    color: var(--pc-primary);
    font-size: 11.5px;
    font-weight: 700;
}

/* ---------- Footer global (bajo las dos tarjetas) ---------- */

.global-footer {
    width: min(1040px, 100%);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 28px;
    padding: 4px 8px;
}

.global-footer .item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: rgba(255, 255, 255, .92);
    font-weight: 600;
}

.global-footer .item .ico {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.global-footer .item .ico img {
    width: 14px;
    height: 14px;
    filter: brightness(0) saturate(100%) invert(1);
    opacity: .95;
}

.global-footer .item .txt b {
    display: block;
    font-size: 12.5px;
    color: #fff;
}

.global-footer .item .txt span {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, .75);
}

/* ---------- Loader ---------- */

.loader-overlay {
    position: fixed;
    inset: 0;
    background: rgba(240, 247, 255, .82);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loader-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 28px 34px;
    border-radius: 22px;
    background: #ffffff;
    border: 1px solid rgba(11, 18, 32, .1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .16);
    min-width: 260px;
    text-align: center;
}

.loader-spinner {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 3px solid rgba(31, 127, 214, .18);
    border-top-color: var(--pc-primary);
    animation: pc-spin 0.9s linear infinite;
    flex: 0 0 auto;
}

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

.loader-text {
    font-size: 14.5px;
    color: #0b1220;
    font-weight: 800;
    letter-spacing: .1px;
    min-height: 20px;
}

.loader-sub {
    font-size: 12.5px;
    color: var(--pc-muted);
    min-height: 16px;
}

/* Ajuste para notebooks de altura baja (1366x768) */
@media (min-width: 900px) and (max-height: 820px) {
    .wrap {
        gap: 14px;
    }

    .left,
    .right {
        padding: 18px;
    }

    .headline {
        margin-bottom: 10px;
    }

    .security-banner {
        margin-top: 12px;
        padding: 12px;
    }

    .steps,
    .features {
        margin-top: 12px;
        gap: 8px;
    }

    .trust-row {
        margin-top: 12px;
        padding-top: 10px;
    }
}
