﻿/* ============================================================
 * auth-v2 · Pantallas anónimas (CON-965)
 * Scope: .auth-v2 (Views/Account)
 *
 * El documento legal y su popup están en Content/legal-v2.css,
 * porque se usan también desde la app logueada.
 *
 * Depende de rrhh-v2-tokens.css para los tokens --rrhh-*.
 * No pisa nada de main.css / mainown.css: las reglas viejas
 * (.mainFirst .login ...) siguen vivas para las vistas que aún
 * las usan.
 *
 * Assets de marca INTOCABLES:
 *   /Images/img/design/fondo_login.png          fondo de la card
 *   /Images/img/design/logo_login.png           logotipo
 *   /Images/img/design/logo_dti_publicacion.png logotipo dticenter
 *   /Images/img/google-play.svg, app-store.svg  badges
 *   /Images/fiestas/login-card.png              banner navideño
 * ============================================================ */

:root {
    /* Degradé de fondo_login.png, medido sobre el propio bitmap.
       Se usa SOLO como respaldo si la imagen no carga. */
    --auth-grad: linear-gradient(135deg, #006EB8 0%, #00EDB9 100%);
    --auth-card-img: url('/Images/img/design/fondo_login.png');

    --auth-ink: #06333B; /* legible sobre la mitad verde del degradé */
    --auth-btn: #16232B;
    --auth-shadow: 0 24px 60px rgba(0,0,0,.42);
}

/* ============================================================
   Página

   Estas vistas no cargan main.css, así que no heredan ningún reset.
   Acotado al scope nuevo para no tocar el resto del sitio.
   ============================================================ */
body.auth-page,
body.auth-page *,
body.auth-page *::before,
body.auth-page *::after {
    box-sizing: border-box;
}

body.auth-page {
    margin: 0;
    min-height: 100vh;
    background: #0f2330;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    font-size: 14px;
    line-height: 1.45;
    color: var(--rrhh-ink-900);
}

.auth-stage {
    position: relative;
    min-height: 100vh;
    display: flex;
    overflow: hidden;
}

/* Fondo fotográfico: lo elige GetImageBackGroundLogin() y lo aplica
   auth-v2.js sobre este elemento.

   Sólo Login y Register reciben esa foto — son las dos acciones que
   ya la pedían. Las pantallas de recupero y Lockout no la piden, y
   no se las hace pedir: GetImageBackGroundLogin() escribe en
   AppInternalTable, así que llamarla desde acciones que antes no lo
   hacían cambiaría el comportamiento. Para esas, el degradé de abajo
   es el fondo definitivo, no un respaldo. */
.auth-bg {
    position: absolute;
    inset: 0;
    background-color: #0f2330;
    background-image: radial-gradient(120% 90% at 78% 18%, #1b4557 0%, #0f2330 58%, #08161f 100%);
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
}

/* velo: el contraste del texto no puede depender de cuál de las 57
   fotos salió sorteada hoy */
.auth-veil {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(4,14,20,.08) 0%, rgba(4,14,20,.28) 55%, rgba(4,14,20,.48) 100%);
}

/* ============================================================
   Card
   ============================================================ */
.auth-v2 {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 32px 9% 32px 32px;
}

.auth-card {
    position: relative;
    width: 344px;
    max-width: 100%;
    background-image: var(--auth-card-img), var(--auth-grad);
    background-size: cover, cover;
    background-position: center center;
    background-repeat: no-repeat;
    border-radius: 20px;
    box-shadow: var(--auth-shadow);
    padding: 28px 24px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}

/* Oscurecido leve del último tramo: el pie lleva dos logotipos
   BLANCOS y el degradé termina en verde claro. No altera los
   assets, sólo la superficie que los recibe. */
.auth-card::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 38%;
    background: linear-gradient(180deg, rgba(0,32,38,0) 0%, rgba(0,32,38,.30) 100%);
    pointer-events: none;
}

.auth-card > * {
    position: relative;
    z-index: 1;
}

.auth-logo {
    width: 150px;
    height: auto;
    display: block;
    margin-bottom: 12px;
}

.auth-tagline {
    font-size: 12.5px;
    line-height: 1.55;
    text-align: center;
    color: #fff;
    letter-spacing: .2px;
    margin: 0 0 18px;
    max-width: 270px;
    text-shadow: 0 1px 2px rgba(0,40,60,.25);
}

/* ============================================================
   Formulario
   ============================================================ */
.auth-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-field {
    position: relative;
    display: flex;
    flex-direction: column;
}

.auth-field .ico {
    position: absolute;
    left: 13px;
    top: 13px;
    width: 17px;
    height: 17px;
    stroke: var(--rrhh-ink-400);
    fill: none;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
    transition: stroke .15s ease;
}

.auth-field input[type="text"],
.auth-field input[type="email"],
.auth-field input[type="password"] {
    width: 100%;
    height: 44px;
    padding: 0 14px 0 40px;
    background: #fff;
    color: var(--rrhh-ink-900);
    border: 1.5px solid transparent;
    border-radius: var(--rrhh-radius-md);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    letter-spacing: .2px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.auth-field input::placeholder {
    color: var(--rrhh-ink-400);
    font-weight: 400;
}

.auth-field input:focus {
    border-color: #fff;
    box-shadow: 0 0 0 3px rgba(255,255,255,.55);
}

.auth-field input:focus ~ .ico {
    stroke: var(--auth-ink);
}

.auth-field.has-toggle input {
    padding-right: 42px;
}

/* clases que emite Html.ValidationMessageFor / los helpers de input */
.auth-field input.input-validation-error {
    border-color: var(--rrhh-danger-500);
    box-shadow: 0 0 0 3px rgba(255,64,75,.32);
}

.auth-field input.input-validation-error ~ .ico {
    stroke: var(--rrhh-danger-500);
}

/* botón ver / ocultar contraseña */
.auth-eye {
    position: absolute;
    right: 6px;
    top: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--rrhh-radius-sm);
    padding: 0;
}

.auth-eye:hover {
    background: var(--rrhh-ink-100);
}

.auth-eye svg {
    width: 17px;
    height: 17px;
    stroke: var(--rrhh-ink-500);
    fill: none;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-eye .off {
    display: none;
}

.auth-eye.is-on .on {
    display: none;
}

.auth-eye.is-on .off {
    display: block;
}

/* ============================================================
   Validación de campo — Html.ValidationMessageFor
   El span sale con .field-validation-valid cuando no hay error y
   con .field-validation-error cuando lo hay; no hace falta togglear
   nada por JS ni usar el atributo `hidden`.
   ============================================================ */
.auth-field .field-validation-valid {
    display: none;
}

.auth-field .field-validation-error {
    display: inline-block;
    align-self: flex-start;
    background: rgba(255,255,255,.94) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C41C27' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5'/%3E%3Cpath d='M12 16.2v.2'/%3E%3C/svg%3E") no-repeat 8px center;
    background-size: 12px 12px;
    border-radius: var(--rrhh-radius-sm);
    padding: 3px 8px 3px 25px;
    margin: 5px 0 0;
    font-size: 11.5px;
    font-weight: 600;
    color: #C41C27;
    letter-spacing: .1px;
}

/* aviso Bloq Mayús (lo muestra auth-v2.js) */
.auth-hint {
    display: none;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    background: rgba(255,255,255,.94);
    border-radius: var(--rrhh-radius-sm);
    padding: 3px 8px;
    margin: 6px 0 0;
    font-size: 11.5px;
    font-weight: 600;
    color: #8A4B00;
    letter-spacing: .1px;
}

.auth-hint.show {
    display: flex;
}

.auth-hint svg {
    width: 13px;
    height: 13px;
    flex: none;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* fila de utilidades */
.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 2px;
    flex-wrap: wrap;
}

.auth-check {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 600;
    color: var(--auth-ink);
    user-select: none;
}

.auth-check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    width: 15px;
    height: 15px;
    flex: none;
    border: 1.5px solid rgba(6,51,59,.5);
    border-radius: 4px;
    background: rgba(255,255,255,.6);
    cursor: pointer;
    position: relative;
    transition: background .15s ease, border-color .15s ease;
}

.auth-check input[type="checkbox"]:checked {
    background: var(--auth-btn);
    border-color: var(--auth-btn);
}

.auth-check input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(43deg);
}

.auth-link {
    font-size: 12px;
    font-weight: 600;
    color: var(--auth-ink);
    text-decoration: none;
    white-space: nowrap;
    margin-left: auto;
    border-bottom: 1px solid transparent;
    transition: border-color .15s ease;
}

.auth-link:hover,
.auth-link:focus {
    color: var(--auth-ink);
    border-bottom-color: rgba(6,51,59,.55);
    text-decoration: none;
}

/* ============================================================
   Alert de errores de modelo

   Lo renderiza Views/Shared/_AuthAlert.cshtml y NO
   Html.ValidationSummary: el helper marca el contenedor como
   .validation-summary-errors ante cualquier error del ModelState,
   incluso cuando todos son de propiedad y quedan excluidos, y ahí
   dibujaba una caja roja vacía. Por eso acá el alert se muestra sólo
   con la clase .show, que el partial pone cuando hay algo que decir.
   ============================================================ */
.auth-alert {
    display: none;
    background: rgba(255,255,255,.95) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E6323D' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5'/%3E%3Cpath d='M12 16.2v.2'/%3E%3C/svg%3E") no-repeat 12px 12px;
    background-size: 16px 16px;
    border-left: 3px solid var(--rrhh-danger-500);
    border-radius: var(--rrhh-radius-md);
    padding: 10px 12px 10px 37px;
    margin: 0 0 2px;
    font-size: 12.5px;
    line-height: 1.45;
    color: #8E1720;
    font-weight: 600;
    letter-spacing: .1px;
    box-shadow: 0 2px 8px rgba(0,30,40,.18);
    animation: auth-alert-in .22s ease;
}

.auth-alert.show {
    display: block;
}

.auth-alert ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.auth-alert li {
    margin: 0;
}

.auth-alert li + li {
    margin-top: 4px;
}

@keyframes auth-alert-in {
    from { opacity: 0; transform: translateY(-5px); }
    to   { opacity: 1; transform: none; }
}

/* variante informativa / de éxito (confirmaciones) */
.auth-alert.info {
    display: block;
    border-left-color: #0084B8;
    color: #0B4A63;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230084B8' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5.5'/%3E%3Cpath d='M12 7.6v.2'/%3E%3C/svg%3E");
}

.auth-alert.success {
    display: block;
    border-left-color: var(--rrhh-brand-teal-600);
    color: #06554A;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23009A86' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M8 12.4l2.6 2.6L16 9.6'/%3E%3C/svg%3E");
}

/* ============================================================
   Botón
   ============================================================ */
.auth-btn {
    height: 46px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    background: var(--auth-btn);
    color: #fff;
    border: none;
    border-radius: var(--rrhh-radius-md);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.6px;
    cursor: pointer;
    transition: background .15s ease, transform .06s ease;
}

.auth-btn:hover {
    background: #0B161C;
    color: #fff;
}

.auth-btn:active {
    transform: translateY(1px);
}

.auth-btn:disabled {
    cursor: default;
    opacity: .9;
}

.auth-btn .spin {
    display: none;
    width: 17px;
    height: 17px;
    flex: none;
    border: 2.2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin .7s linear infinite;
}

.auth-btn.loading .spin {
    display: block;
}

.auth-btn.loading .label {
    opacity: .8;
}

@keyframes auth-spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   Pie de la card
   ============================================================ */
.auth-sep {
    width: 100%;
    height: 1px;
    background: rgba(255,255,255,.28);
    margin: 18px 0 14px;
}

.auth-signup {
    font-size: 12.5px;
    color: var(--auth-ink);
    text-decoration: none;
    font-weight: 700;
    letter-spacing: .2px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 15px;
    border: 1px solid rgba(6,51,59,.3);
    border-radius: var(--rrhh-radius-pill);
    background: rgba(255,255,255,.24);
    transition: background .15s ease, border-color .15s ease;
}

.auth-signup:hover,
.auth-signup:focus {
    background: rgba(255,255,255,.46);
    border-color: rgba(6,51,59,.5);
    color: var(--auth-ink);
    text-decoration: none;
}

.auth-signup svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-dti {
    width: 98px;
    height: auto;
    display: block;
    margin: 16px 0 13px;
    opacity: .92;
}

/* Los dos SVG de tienda NO son comparables tal cual:
     app-store.svg    viewBox 119.66x40 -> el badge ocupa todo
     google-play.svg  viewBox 206.67x80 -> el badge ocupa 180x53.33,
                                           con 13.33 de margen
                                           transparente en los 4 lados
   (medido con getBBox). Igualar el atributo height iguala los
   ARCHIVOS y deja el de Google un 33% más chico. Se normaliza por
   la altura del badge dibujado: 32px. */
.auth-stores {
    display: flex;
    gap: 9px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.auth-stores a {
    display: inline-flex;
    line-height: 0;
}

.auth-stores img {
    width: auto;
    display: block;
}

.auth-stores .as img {
    height: 32px;
}

.auth-stores .gp img {
    height: 48px;      /* 32 / 0.6667 */
    margin: -8px;      /* descuenta el clear space del asset */
}

/* términos (Register) */
.auth-terms {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 12px;
    text-align: center;
}

.auth-terms a {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--auth-ink);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.auth-terms a:hover,
.auth-terms a:focus {
    color: var(--auth-ink);
    text-decoration: none;
    border-bottom-color: rgba(6,51,59,.55);
}

/* texto suelto dentro de la card (confirmaciones) */
.auth-text {
    font-size: 12.5px;
    line-height: 1.6;
    color: #fff;
    text-align: center;
    margin: 0 0 16px;
    text-shadow: 0 1px 2px rgba(0,40,60,.25);
}

/* ============================================================
   Efemérides
   ============================================================ */

/* Escarapela — centro-bajo de la pantalla. Reemplaza a
   #patrio / login-band.png y al hack logoDti.marginBottom. */
.auth-cockade {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    z-index: 0;
    width: 140px;
    pointer-events: none;
    display: none;
    filter: drop-shadow(0 6px 14px rgba(0,0,0,.45));
}

.auth-cockade.show {
    display: block;
    animation: cockade-in .5s cubic-bezier(.2,.9,.3,1.3);
}

@keyframes cockade-in {
    from { opacity: 0; transform: translateX(-50%) translateY(26px); }
    to   { opacity: 1; transform: translateX(-50%); }
}

.ck-ribbon-l { transform-origin: 66px 60px; animation: ck-sway 4.2s ease-in-out infinite; }
.ck-ribbon-r { transform-origin: 66px 60px; animation: ck-sway 4.2s ease-in-out infinite reverse; }
.ck-rose     { transform-origin: 66px 44px; animation: ck-breathe 6s ease-in-out infinite; }

@keyframes ck-sway {
    0%, 100% { transform: rotate(-1.6deg); }
    50%      { transform: rotate(1.6deg); }
}

@keyframes ck-breathe {
    0%, 100% { transform: rotate(-1deg); }
    50%      { transform: rotate(1deg); }
}

@media (prefers-reduced-motion: reduce) {
    .ck-ribbon-l, .ck-ribbon-r, .ck-rose { animation: none; }
    .auth-cockade.show { animation: none; }
    .auth-alert { animation: none; }
}

/* Fiestas — login-card.png, sólo reposicionado */
.auth-fiestas {
    position: absolute;
    left: 7%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 0;
    width: 166px;      /* tamaño natural de login-card.png */
    display: none;
}

.auth-fiestas.show {
    display: block;
}

.auth-fiestas img {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 10px 26px rgba(0,0,0,.4));
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
    .auth-v2 {
        justify-content: center;
        align-items: flex-start;
        padding: 34px 18px 196px;
    }

    .auth-card {
        width: 100%;
        max-width: 380px;
        padding: 26px 20px 20px;
    }

    /* el banner navideño es un bitmap de 166x334 pensado para la
       columna izquierda del escritorio */
    .auth-fiestas {
        display: none !important;
    }

    .auth-cockade {
        width: 112px;
    }
}

/* El popup de documentos legales y los estilos del documento
   viven en Content/legal-v2.css: se usan tambien desde el
   sidebar de la app logueada, fuera de estas pantallas. */
