/* ==========================================================================
   Pantallas de autenticación: login, recuperar y restablecer contraseña
   ========================================================================== */

:root {
    --auth-primary: #1f5fff;
    --auth-primary-2: #0ea5ff;
    --auth-primary-soft: rgba(31, 95, 255, 0.14);
    --auth-ink: #1b2537;
    --auth-muted: #6b7a90;
    --auth-line: #e4e9f2;
    --auth-field: #f4f6fb;
    --auth-danger: #d93f4c;
    --auth-radius: 12px;
    --auth-visual-radius: 24px;
    --auth-gutter: 14px;
}

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

html,
body {
    height: 100%;
}

body.auth-body {
    margin: 0;
    font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--auth-ink);
    background: #fff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.auth {
    display: grid;
    grid-template-columns: minmax(0, 11fr) minmax(400px, 9fr);
    min-height: 100vh;
    min-height: 100dvh;
}

/* --------------------------------------------------------------------------
   Panel visual (imagen con texto)
   -------------------------------------------------------------------------- */

.auth__visual {
    position: relative;
    margin: var(--auth-gutter) 0 var(--auth-gutter) var(--auth-gutter);
    border-radius: var(--auth-visual-radius);
    overflow: hidden;
    background: #0b2a6b;
    isolation: isolate;
}

.auth__visual-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.auth__visual::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(8, 24, 64, 0.08) 0%, rgba(8, 24, 64, 0.12) 45%, rgba(8, 24, 64, 0.85) 100%),
        linear-gradient(135deg, rgba(31, 95, 255, 0.28), rgba(0, 229, 255, 0.06));
}

.auth__caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    max-width: 600px;
    padding: 40px 44px;
    color: #fff;
}

.auth__caption h2 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.auth__caption p {
    margin: 0;
    font-size: 15px;
    opacity: 0.92;
}

/* --------------------------------------------------------------------------
   Panel del formulario
   -------------------------------------------------------------------------- */

.auth__panel {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 36px 48px 24px;
}

.auth__brand a {
    display: inline-block;
    line-height: 0;
}

.auth__brand img {
    height: 64px;
    width: auto;
    display: block;
}

.auth__content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 0;
}

.auth__form {
    width: 100%;
    max-width: 380px;
}

.auth__title {
    margin: 0 0 8px;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.auth__subtitle {
    margin: 0 0 28px;
    font-size: 14.5px;
    color: var(--auth-muted);
}

.auth__alt {
    margin: 24px 0 0;
    text-align: center;
    font-size: 13.5px;
    color: var(--auth-muted);
}

.auth__footer {
    text-align: center;
    font-size: 12.5px;
    color: #98a3b5;
}

.auth__link {
    color: var(--auth-primary);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
}

.auth__link:hover {
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Campos
   -------------------------------------------------------------------------- */

.field {
    margin-bottom: 18px;
}

.field__label {
    display: block;
    margin-bottom: 7px;
    font-size: 13.5px;
    font-weight: 700;
}

.field__control {
    position: relative;
    display: flex;
    align-items: center;
}

.field__icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    color: #9aa6b8;
    pointer-events: none;
    transition: color 0.15s ease;
}

.field__icon svg,
.field__toggle svg,
.btn svg,
.alert svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: none;
}

.field__input {
    width: 100%;
    height: 48px;
    padding: 0 14px 0 44px;
    font: inherit;
    color: var(--auth-ink);
    background: var(--auth-field);
    border: 1.5px solid var(--auth-line);
    border-radius: var(--auth-radius);
    outline: none;
    appearance: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.field__input::placeholder {
    color: #a6b0c0;
}

.field__input:focus {
    background: #fff;
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 4px var(--auth-primary-soft);
}

.field__control:focus-within .field__icon {
    color: var(--auth-primary);
}

.field__input--toggle {
    padding-right: 48px;
}

.field__toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #9aa6b8;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.field__toggle:hover {
    color: var(--auth-primary);
    background: rgba(31, 95, 255, 0.08);
}

.field__toggle:focus-visible {
    outline: 2px solid var(--auth-primary);
    outline-offset: 1px;
}

.field__toggle .icon-eye-off {
    display: none;
}

.field__toggle.is-visible .icon-eye {
    display: none;
}

.field__toggle.is-visible .icon-eye-off {
    display: block;
}

/* Errores: @error de Laravel y jquery-form-validator (.has-error / .error) */

.field__error .help-block,
.field__error .form-error {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--auth-danger);
}

.field__control.has-error .field__input,
.field__input.error,
.field__input.is-invalid {
    border-color: var(--auth-danger);
    background: #fff;
}

.field__control.has-error .field__input:focus,
.field__input.error:focus,
.field__input.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(217, 63, 76, 0.14);
}

.field__control.has-error .field__icon {
    color: var(--auth-danger);
}

/* Fila "Recordarme / ¿Olvidaste tu contraseña?" */

.auth-form__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -4px 0 22px;
}

.check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: var(--auth-muted);
    cursor: pointer;
    user-select: none;
}

.check input {
    appearance: none;
    width: 18px;
    height: 18px;
    margin: 0;
    display: grid;
    place-content: center;
    border: 1.5px solid #c9d2e0;
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.check input::before {
    content: '';
    width: 10px;
    height: 10px;
    background: #fff;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
    transform: scale(0);
    transition: transform 0.12s ease-in-out;
}

.check input:checked {
    background: var(--auth-primary);
    border-color: var(--auth-primary);
}

.check input:checked::before {
    transform: scale(1);
}

.check input:focus-visible {
    outline: 2px solid var(--auth-primary);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Botones y alertas
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 20px;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    border: 0;
    border-radius: var(--auth-radius);
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn svg {
    stroke-width: 2;
    transition: transform 0.15s ease;
}

.btn--block {
    width: 100%;
}

.btn--primary {
    color: #fff;
    background: linear-gradient(90deg, var(--auth-primary) 0%, var(--auth-primary-2) 100%);
    box-shadow: 0 10px 22px -10px rgba(31, 95, 255, 0.7);
}

.btn--primary:hover {
    filter: brightness(1.06);
    box-shadow: 0 14px 26px -10px rgba(31, 95, 255, 0.8);
}

.btn--primary:hover svg {
    transform: translateX(3px);
}

.btn--primary:active {
    transform: translateY(1px);
}

.btn--primary:focus-visible {
    outline: 3px solid var(--auth-primary-soft);
    outline-offset: 2px;
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13.5px;
}

.alert svg {
    margin-top: 1px;
}

.alert--success {
    color: #166b48;
    background: #e8f8f0;
    border: 1px solid #bfead6;
}

.alert--danger {
    color: #9b2c35;
    background: #fdeeef;
    border: 1px solid #f5c6ca;
}

/* Barra de progreso (Pace) */

.pace .pace-progress {
    background: var(--auth-primary);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
    .auth__panel {
        padding: 28px 36px 20px;
    }

    .auth__caption {
        padding: 32px;
    }

    .auth__caption h2 {
        font-size: 24px;
    }
}

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

    .auth__visual {
        margin: var(--auth-gutter) var(--auth-gutter) 0;
        border-radius: 20px;
    }

    .auth__caption {
        padding: 22px 24px;
    }

    .auth__caption h2 {
        font-size: 20px;
    }

    .auth__caption p {
        font-size: 13.5px;
    }

    .auth__panel {
        padding: 24px 24px 16px;
    }

    .auth__brand img {
        height: 52px;
    }

    .auth__content {
        align-items: flex-start;
        padding: 24px 0;
    }
}

@media (max-width: 480px) {
    .auth {
        grid-template-rows: 190px 1fr;
    }

    .auth__caption p {
        display: none;
    }

    .auth__panel {
        padding: 20px 18px 14px;
    }

    .auth-form__row {
        flex-wrap: wrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
    }
}
