/* ============================================================
   Bionet · Login Pacientes - Inicio sesión
   CSS puro, mobile-first, nomenclatura BEM. Vista sin header.
   ============================================================ */

:root {
    --font: 'Montserrat', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

    --blue: #007CB7;
    --blue-bright: #067FEE;
    --blue-light: #45C7FF;
    --blue-dark: #002440;
    --orange: #F58220;
    --yellow: #FDB515;
    --white: #FFFFFF;

    --gray-1: #F9FAFB;
    --gray-2: #F1F1F1;
    --gray-3: #E6E7E8;
    --gray-4: #808285;
    --gray-5: #414042;

    --bg: var(--gray-1);
    --text: var(--blue-dark);
    --text-soft: #002447;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-input: 14px;

    --container: 1200px;
    --space: clamp(16px, 4vw, 32px);
    --color-success: #1fb430;
    --color-danger: #dc3545;
    --color-warning: #ffc107;
    --color-info: #0d6efd;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    color: var(--text);
    background-color: var(--bg);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
}

/* Texto solo para lectores de pantalla */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Layout base ---------- */
.page {
    flex: 1 0 auto;
    width: 100%;
}

/* ============================================================
   HERO  ·  Mobile: una columna (contenido y luego imagen).
   ============================================================ */
.hero {
    display: flex;
    flex-direction: column;
    gap: clamp(24px, 6vw, 48px);
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: clamp(24px, 6vw, 56px) var(--space) 0;
}

.hero__content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    width: 100%;
    max-width: 520px;
}

/* Chip "Pacientes" */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background-color: rgba(69, 199, 255, 0.25);
    border-radius: var(--radius-md);
    color: var(--blue-bright);
    font-weight: 700;
    font-size: 0.75rem;
    line-height: 1.2;
}

.chip__icon {
    width: 17px;
    height: 17px;
    flex: none;
}

.chip__text {
    color: inherit;
}

/* Título */
.hero__title {
    color: var(--blue-dark);
    font-weight: 700;
    font-size: clamp(1.75rem, 5vw, 2.25rem);
    line-height: 1.15;
    letter-spacing: -0.01em;
}

/* ============================================================
   FORMULARIO
   ============================================================ */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
}

.field {
    width: 100%;
    position: relative;
}

.select {
    width: 100%;
    padding: 16px 20px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--gray-4);
    background-color: var(--white);
    border: 1px solid var(--gray-4);
    border-radius: var(--radius-input);
    transition: border-color .18s ease, box-shadow .18s ease;

    /* Quitar estilo nativo del combobox */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    /* Espacio para el icono */
    padding-right: 50px;

    /* Opcional: quitar el estilo de enfoque por defecto en algunos navegadores */
    outline: none;
}

/* Contenedor para el select y el icono */
.select-wrapper {
    position: relative;
    width: 100%;
}

.select-wrapper::after {
    content: "\F282";
    font-family: "bootstrap-icons";
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 0.8rem;
    color: var(--blue-dark);
    font-weight: bold;
}

.select option,
.select--selected {
    color: var(--blue-dark);
}


.select:focus {
    border-color: var(--blue-bright);
    box-shadow: 0 0 0 3px rgba(6, 127, 238, .15);
}


.input {
    width: 100%;
    padding: 16px 20px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--blue-dark);
    background-color: var(--white);
    border: 1px solid var(--gray-4);
    border-radius: var(--radius-input);
    transition: border-color .18s ease, box-shadow .18s ease;
}

.input::placeholder {
    color: var(--gray-4);
}

.input:focus {
    outline: none;
    border-color: var(--blue-bright);
    box-shadow: 0 0 0 3px rgba(6, 127, 238, .15);
}

.input--with-action {
    padding-right: 56px;
}

/* Campo con botón interno (ojo de contraseña) */
.input-group {
    position: relative;
    width: 100%;
}

.input-action {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    color: var(--gray-5);
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.input-action:hover {
    color: var(--blue-bright);
}

.input-action:focus-visible {
    outline: 2px solid rgba(6, 127, 238, .4);
    outline-offset: 2px;
}

/* Por defecto la contraseña está oculta -> se ve el ojo tachado */
.input-action .icon-eye {
    display: none;
}

.input-action[aria-pressed="true"] .icon-eye {
    display: block;
}

.input-action[aria-pressed="true"] .icon-eye-off {
    display: none;
}

/* Checkbox de términos */
.checkbox {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 12px;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--gray-4);
    line-height: 1.4;
}

.checkbox__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox__box {
    width: 22px;
    height: 22px;
    flex: none;
    border: 2px solid var(--gray-4);
    border-radius: 6px;
    background-color: var(--white);
    position: relative;
    transition: background-color .15s ease, border-color .15s ease;
}

.checkbox__input:checked+.checkbox__box {
    background-color: var(--blue-bright);
    border-color: var(--blue-bright);
}

.checkbox__input:checked+.checkbox__box::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 11px;
    border: solid var(--white);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox__input:focus-visible+.checkbox__box {
    outline: 2px solid rgba(6, 127, 238, .4);
    outline-offset: 2px;
}

.checkbox__link {
    color: var(--blue-dark);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.field.is-invalid:after {
    content: "\F62A";
    font-family: "bootstrap-icons";
    position: absolute;
    bottom: 0.4rem;
    right: 10px;
    font-size: 24px;
    color: var(--color-danger);
    z-index: 1;
}

.field.is-invalid input,
.field.is-invalid select {
    border: 1px solid var(--color-danger) !important;
}



.field.is-valid:after {
    content: "\F26E";
    font-family: "bootstrap-icons";
    position: absolute;
    bottom: 0.4rem;
    right: 10px;
    font-size: 24px;
    color: var(--color-success);
    z-index: 1;
}

.field.is-valid input,
.field.is-valid select {
    border: 1px solid var(--color-success) !important;
}



/* Link "Recuperar contraseña" */
.link-recover {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--blue-bright);
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    width: fit-content;
}

.link-recover__icon {
    width: 20px;
    height: 20px;
    flex: none;
}

.link-recover:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---------- Botón ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    font-family: inherit;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .05s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn--center {
    justify-content: center;
}

/* botón sin flecha, texto centrado */
.btn:focus-visible {
    outline: 3px solid rgba(6, 127, 238, .4);
    outline-offset: 2px;
}

/* Primario (relleno). Hover: fondo a #45C7FF (texto sigue blanco). */
.btn--primary {
    background-color: var(--blue-bright);
    border-color: var(--blue-bright);
    color: var(--white);
}

.btn--primary:hover,
.btn--primary:focus-visible {
    background-color: var(--blue-light);
    border-color: var(--blue-light);
}

/* ---------- Imagen del hero ---------- */
.hero__media {
    width: 100%;
}

.hero__image {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    object-fit: cover;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    flex-shrink: 0;
    width: 100%;
    margin-top: clamp(32px, 8vw, 64px);
    background-color: var(--blue-dark);
    padding: 16px var(--space);
}

.footer__text {
    max-width: var(--container);
    margin: 0 auto;
    text-align: center;
    color: var(--gray-1);
    font-size: 0.75rem;
    line-height: 1.5;
}

.footer__link {
    color: var(--gray-1);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.footer__link:hover {
    color: var(--yellow);
}

/* ============================================================
   TABLET ≥ 768px
   ============================================================ */
@media (max-width: 768px) {
    .hero__content {
        max-width: 100%;
    }

    .hero__title {
        font-size: clamp(2rem, 4vw, 2.5rem);
    }
}

/* ============================================================
   DESKTOP ≥ 1024px · dos columnas
   ============================================================ */
@media (max-width: 1024px) {
    .hero__content {
        max-width: 100%;
    }
}

@media (min-width: 1024px) {
    .hero {
        flex-direction: row;
        align-items: stretch;
        gap: clamp(32px, 5vw, 72px);
        padding-top: clamp(40px, 5vw, 72px);
        padding-bottom: 0;
    }

    .hero__content {
        flex: 1 1 48%;
        align-self: center;
        padding-block: 24px;
        max-width: 100%;
    }

    .hero__media {
        flex: 1 1 52%;
        align-self: stretch;
        display: flex;
        justify-content: flex-end;
    }

    .hero__image {
        width: 100%;
        max-width: 620px;
        height: 100%;
        max-height: 720px;
        border-radius: 0;
    }
}

/* ============================================================
   DESKTOP WIDE ≥ 1440px
   ============================================================ */
@media (min-width: 1440px) {
    .hero__image {
        max-width: 680px;
    }
}

/* ---------- Accesibilidad: reduce motion ---------- */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}





/* -------------- Bionet alertas --------------*/

/* Fondo oscurecido (faux viewport) */
.backdrop {
    min-height: 100vh;
    background-color: rgba(0, 36, 64, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: 999;
}

/* Tarjeta del modal */
.modal {
    width: 100%;
    max-width: 620px;
    background-color: var(--white);
    border-radius: var(--radius-lg);
    padding: clamp(24px, 4vw, 40px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
}

.modal--success {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 24px;
    max-width: 560px;
}

.success-badge {
    display: inline-flex;
}

.success-badge svg {
    width: clamp(96px, 22vw, 120px);
    height: auto;
}

.modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.modal__title {
    font-weight: 700;
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    color: var(--blue-dark);
    line-height: 1.2;
}

.modal__title--center {
    text-align: center;
    font-size: clamp(1.5rem, 4vw, 2rem);
}

.modal__close {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: var(--blue-dark);
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color .15s ease;
}

.modal__close:hover {
    background-color: var(--gray-2);
}

.modal__close:focus-visible {
    outline: 2px solid rgba(6, 127, 238, .4);
    outline-offset: 2px;
}

.modal__text {
    color: var(--text-soft);
    font-size: 1rem;
    line-height: 1.55;
}

.modal__footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 28px;
}

.modal__footer--center {
    justify-content: center;
}




/* Botón del modal (primario). Hover: fondo a #45C7FF. */
.btn-modal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 140px;
    padding: 13px 28px;
    background-color: var(--blue-bright);
    color: var(--white);
    border: 2px solid var(--blue-bright);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-weight: 700;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: background-color .18s ease, border-color .18s ease;
}

.btn-modal:hover,
.btn-modal:focus-visible {
    background-color: var(--blue-light);
    border-color: var(--blue-light);
}

.btn-modal:focus-visible {
    outline: 3px solid rgba(6, 127, 238, .4);
    outline-offset: 2px;
}

@media (max-width: 600px) {
    .modal__footer {
        justify-content: stretch;
    }

    .btn-modal {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}