:root {
    --azul-1: #0b3d84;
    --azul-2: #0a4f9d;
    --azul-3: #153f80;
    --azul-texto: #17395e;
    --gris-borde: #c7d4e2;
    --gris-linea: #d7e0ea;
    --gris-input: #f8fafc;
    --gris-icono: #7a88a6;
    --blanco-card: rgba(242, 246, 250, 0.93);
    --naranja-1: #f59b15;
    --naranja-2: #f27c00;
    --sombra: 0 10px 28px rgba(0, 0, 0, 0.18);
    --radio: 14px;
    --radio-sm: 9px;
    --alto-touch: 50px;
    --transicion: 0.18s ease;
}

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

html {
    min-height: 100%;
    width: 100%;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--azul-texto);
    background-image:
        linear-gradient(rgba(7, 36, 79, 0.24), rgba(7, 36, 79, 0.24)),
        url('../img/UNAM.jpg');
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
}

/* =========================
   HEADER
========================= */
.topbar {
    width: 100%;
    background: linear-gradient(180deg, var(--azul-1) 0%, var(--azul-2) 100%);
    border-bottom: 6px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
}

.topbar__inner {
    width: 100%;
    max-width: 1420px;
    min-height: 92px;
    margin: 0 auto;
    padding: 10px 16px;
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr) 210px;
    align-items: center;
    gap: 14px;
}

.topbar__logo {
    display: flex;
    align-items: center;
}

.topbar__logo--left {
    justify-content: flex-start;
}

.topbar__logo--right {
    justify-content: flex-end;
}

.topbar__logo img {
    display: block;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.topbar__logo--left img {
    max-height: 66px;
}

.topbar__logo--right img {
    max-height: 76px;
}

.topbar__title {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.topbar__title h1 {
    color: #ffffff;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
}

/* =========================
   CONTENIDO
========================= */
.page {
    width: 100%;
    min-height: calc(100vh - 98px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px 16px 28px;
}

.register-card {
    width: 100%;
    max-width: 780px;
    background: var(--blanco-card);
    border: 1px solid rgba(194, 206, 221, 0.96);
    border-radius: 16px;
    box-shadow: var(--sombra);
    backdrop-filter: blur(2px);
    overflow: hidden;
}

.register-card__header {
    padding: 28px 32px 14px;
    text-align: center;
}

.register-card__header h2 {
    color: var(--azul-3);
    font-size: 2.05rem;
    font-weight: 800;
    line-height: 1.15;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--gris-linea);
}

.register-card__body {
    padding: 18px 32px 28px;
}

.register-form {
    width: 100%;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    color: var(--azul-3);
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1.2;
}

.input-shell {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    min-height: var(--alto-touch);
    border: 1px solid var(--gris-borde);
    border-radius: var(--radio-sm);
    background: #ffffff;
    overflow: hidden;
    transition: border-color var(--transicion), box-shadow var(--transicion), transform var(--transicion);
}

.input-shell:focus-within {
    border-color: #d98f17;
    box-shadow: 0 0 0 4px rgba(217, 143, 23, 0.12);
    transform: translateY(-1px);
}

.input-shell__icon {
    width: 52px;
    min-width: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gris-icono);
    font-size: 1.2rem;
}

.input-shell input,
.input-shell select {
    width: 100%;
    height: var(--alto-touch);
    border: none;
    outline: none;
    background: transparent;
    padding: 0 14px 0 0;
    color: var(--azul-texto);
    font-size: 1rem;
    font-weight: 600;
}

.input-shell input::placeholder {
    color: #8b97b0;
    font-weight: 600;
}

.input-shell--password input {
    padding-right: 50px;
}

.input-shell--select select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    padding-right: 44px;
}

.input-shell--select::after {
    content: "⌄";
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #6d7e99;
    font-size: 1.2rem;
    font-weight: 700;
    pointer-events: none;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    color: #7a88a6;
    font-size: 1.05rem;
    cursor: pointer;
    border-radius: 50%;
    transition: background var(--transicion), color var(--transicion);
}

.toggle-password:hover,
.toggle-password.is-active {
    background: rgba(21, 63, 128, 0.08);
    color: var(--azul-3);
}

.password-message {
    display: none;
    margin-top: 7px;
    color: #c62828;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.35;
}

.password-message.is-visible {
    display: block;
}

.form-actions {
    margin-top: 10px;
}

#enter {
    width: 100%;
    height: 54px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(180deg, var(--naranja-1) 0%, var(--naranja-2) 100%);
    color: #ffffff;
    font-size: 1.12rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition: filter var(--transicion), transform var(--transicion);
}

#enter:hover {
    filter: brightness(1.03);
}

#enter:active {
    transform: translateY(1px);
}

/* =========================
   TABLET
========================= */
@media (max-width: 1024px) {
    .topbar__inner {
        grid-template-columns: 160px minmax(0, 1fr) 160px;
        min-height: 84px;
    }

    .topbar__logo--left img {
        max-height: 54px;
    }

    .topbar__logo--right img {
        max-height: 64px;
    }

    .topbar__title h1 {
        font-size: 1.65rem;
    }

    .page {
        padding: 18px 14px 24px;
    }

    .register-card {
        max-width: 720px;
    }

    .register-card__header {
        padding: 24px 24px 12px;
    }

    .register-card__header h2 {
        font-size: 1.85rem;
    }

    .register-card__body {
        padding: 16px 24px 24px;
    }
}

/* =========================
   CELULAR
========================= */
@media (max-width: 680px) {
    .topbar__inner {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        gap: 8px;
        padding: 12px;
    }

    .topbar__logo--left,
    .topbar__logo--right {
        justify-content: center;
    }

    .topbar__logo--left img {
        max-height: 42px;
    }

    .topbar__logo--right img {
        max-height: 48px;
    }

    .topbar__title h1 {
        font-size: 1.2rem;
    }

    .page {
        min-height: auto;
        padding: 14px 10px 22px;
    }

    .register-card {
        border-radius: 14px;
    }

    .register-card__header {
        padding: 20px 16px 10px;
    }

    .register-card__header h2 {
        font-size: 1.5rem;
        padding-bottom: 10px;
    }

    .register-card__body {
        padding: 14px 16px 20px;
    }

    .form-group label {
        font-size: 0.92rem;
    }

    .input-shell__icon {
        width: 46px;
        min-width: 46px;
        font-size: 1.05rem;
    }

    .input-shell input,
    .input-shell select {
        height: 46px;
        font-size: 0.96rem;
    }

    #enter {
        height: 50px;
        font-size: 1rem;
    }
}