﻿/* ================================================================
   login.css — DIBAN· Pantalla de inicio de sesión
   Ruta: wwwroot/css/account/login.css
   ================================================================ */

:root {
    --brand: #c01820;
    --brand-dark: #8f1015;
    --brand-hover: #a8181e;
    --left-bg: #FEE4D6;
    --right-bg: #ffffff;
    --text-main: #111827;
    --text-soft: #6b7280;
    --border: #e5e7eb;
    --input-focus: rgba(192, 24, 32, 0.18);
    --shadow-card: 0 20px 60px rgba(0,0,0,.10);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden; /* Sin scroll en pantallas normales */
    font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
    color: var(--text-main);
    background: var(--right-bg);
}

/* ── Layout split ─────────────────────────────────────────────── */
.login-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100vh;
    width: 100%; 
    overflow: hidden;
}

/* ── Panel izquierdo (ilustración) ───────────────────────────── */
.login-left {
    background: var(--left-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    overflow: hidden;
    position: relative;
}

    .login-left::before {
        content: '';
        position: absolute;
        bottom: -80px;
        left: -80px;
        width: 340px;
        height: 340px;
        border-radius: 50%;
        background: rgba(192, 24, 32, .07);
        pointer-events: none;
    }

    .login-left::after {
        content: '';
        position: absolute;
        top: -60px;
        right: -60px;
        width: 260px;
        height: 260px;
        border-radius: 50%;
        background: rgba(192, 24, 32, .05);
        pointer-events: none;
    }

.login-left-image-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.login-left-image {
    max-width: 88%;
    max-height: 78vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 24px 48px rgba(192,24,32,.13));
}

.login-left-tagline {
    margin-top: 20px;
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--brand);
    opacity: .75;
    position: relative;
    z-index: 1;
}

/* ── Panel derecho (formulario) ──────────────────────────────── */
.login-right {
    background: var(--right-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 64px;
    overflow-y: auto; /* Sólo el panel derecho se desplaza si es necesario */
    scrollbar-width: none; /* Para Firefox */
    -ms-overflow-style: none; /* Para Internet Explorer y Edge antiguo */s
}

.login-right::-webkit-scrollbar {
    display: none;
}

.login-panel {
    width: 100%;
    max-width: 420px;
}

/* ── Cabecera del panel ──────────────────────────────────────── */
.panel-header {
    text-align: center;
    margin-bottom: 32px;
}

.panel-logo-image-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 5px;
}

.panel-logo-image {
    width: 140px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.panel-title {
    margin: 0 0 8px;
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
}

.panel-subtitle {
    margin: 0;
    color: var(--text-soft);
    font-size: .94rem;
    line-height: 1.65;
}

/* ── Separador decorativo ────────────────────────────────────── */
.panel-divider {
    height: 3px;
    width: 40px;
    background: var(--brand);
    border-radius: 2px;
    margin: 12px auto 28px;
}

/* ── Labels ──────────────────────────────────────────────────── */
.form-label {
    font-weight: 600;
    font-size: .875rem;
    margin-bottom: 6px;
    color: #374151;
    display: block;
}

/* ── Input con ícono ─────────────────────────────────────────── */
.input-icon-group {
    position: relative;
}

    .input-icon-group .input-icon {
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        color: #94a3b8;
        font-size: .95rem;
        z-index: 2;
        pointer-events: none;
    }

.form-control {
    height: 50px;
    border-radius: 0 !important;
    border: 1px solid var(--border);
    padding-left: 42px;
    padding-right: 42px;
    font-size: .95rem;
    color: var(--text-main);
    background: #fafafa;
    transition: border-color .2s, box-shadow .2s, background .2s;
    width: 100%;
}

.form-control:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--input-focus);
    background: #fff;
}

.form-control.is-invalid {
    border-color: #dc2626;
    box-shadow: none;
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .15);
}

#Clave.is-invalid,
#Clave.is-valid {
    padding-right: 75px !important;
    background-position: right 45px center !important;
}

/* Estilos profesionales para el botón del ojito */
.btn-eye {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    height: 42px;
    width: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 5;
}

.btn-eye:hover {
    color: var(--brand);
}

/* ── Texto de validación ─────────────────────────────────────── */
.text-danger {
    font-size: .82rem;
    margin-top: 4px;
    display: block;
}

/* ── Recordarme ──────────────────────────────────────────────── */
.form-check-input:checked {
    background-color: var(--brand);
    border-color: var(--brand);
}

.form-check-label {
    font-size: .9rem;
    color: var(--text-soft);
}

/* ── Botón login ─────────────────────────────────────────────── */
.btn-login {
    height: 50px;
    border-radius: 0 !important;
    border: none;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    font-size: .98rem;
    letter-spacing: .02em;
    width: 100%;
    cursor: pointer;
    transition: background .2s, transform .15s;
    position: relative;
    overflow: hidden;
}

    .btn-login::after {
        content: '';
        position: absolute;
        inset: 0;
        background: rgba(255,255,255,0);
        transition: background .2s;
    }

    .btn-login:hover {
        background: var(--brand-hover);
    }

    .btn-login:active {
        background: var(--brand-dark);
        transform: scaleY(.98);
    }

    .btn-login:disabled {
        opacity: .7;
        cursor: not-allowed;
    }

    /* spinner dentro del botón */
    .btn-login .spinner {
        display: none;
        width: 18px;
        height: 18px;
        border: 2px solid rgba(255,255,255,.4);
        border-top-color: #fff;
        border-radius: 50%;
        animation: spin .7s linear infinite;
        margin-right: 8px;
    }

    .btn-login.loading .spinner {
        display: inline-block;
    }

    .btn-login.loading .btn-text {
        opacity: .8;
    }

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ════════════════════════════════════════════════════
   CHECKBOX DIBAN — borde recto cuadrado
════════════════════════════════════════════════════ */
.diban-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    position: relative;
    margin: 0;
    padding: 2px 0;
}

    .diban-checkbox input[type="checkbox"] {
        position: absolute;
        opacity: 0;
        cursor: pointer;
        height: 0;
        width: 0;
        pointer-events: none;
    }

    .diban-checkbox .checkmark {
        width: 20px;
        height: 20px;
        min-width: 20px;
        background-color: #fff;
        border: 2px solid #ced4da;
        border-radius: 0 !important;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all .2s cubic-bezier(.4,0,.2,1);
        flex-shrink: 0;
    }

    .diban-checkbox:hover input ~ .checkmark {
        border-color: var(--brand);
    }

    .diban-checkbox input:checked ~ .checkmark {
        background-color: var(--brand);
        border-color: var(--brand);
    }

    .diban-checkbox .checkmark::after {
        content: '\f00c';
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        color: white;
        font-size: 11px;
        opacity: 0;
        transform: scale(0.4);
        transition: all .2s cubic-bezier(.4,0,.2,1);
        line-height: 1;
    }

    .diban-checkbox input:checked ~ .checkmark::after {
        opacity: 1;
        transform: scale(1);
    }

    .diban-checkbox .chk-label {
        font-size: .85rem;
        font-weight: 600;
        color: var(--gray-600);
        line-height: 1.4;
    }

    /* Versión pequeña para tablas y formularios compactos */
    .diban-checkbox.sm .checkmark {
        width: 17px;
        height: 17px;
        min-width: 17px;
    }

        .diban-checkbox.sm .checkmark::after {
            font-size: 9px;
        }

    .diban-checkbox.sm .chk-label {
        font-size: .8rem;
    }

/* ── Nota inferior ───────────────────────────────────────────── */
.login-note {
    margin-top: 20px;
    color: #94a3b8;
    font-size: .82rem;
    text-align: center;
}

/* ── Snackbar / Toast ────────────────────────────────────────── */
#snackContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 340px;
    width: calc(100vw - 40px);
}

.snack {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: .85rem 1rem;
    color: #fff;
    font-size: .875rem;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
    border-left: 4px solid rgba(255,255,255,.4);
    animation: snackIn .3s cubic-bezier(.4,0,.2,1);
    position: relative;
}

    .snack.success {
        background: #16a34a;
    }

    .snack.error {
        background: var(--brand);
    }

    .snack.info {
        background: #2563eb;
    }

    .snack.warning {
        background: #d97706;
    }

    .snack i {
        font-size: 1.1rem;
        flex-shrink: 0;
    }

.snack-msg {
    flex: 1;
}

.snack-close {
    background: none;
    border: none;
    color: rgba(255,255,255,.8);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

.snack.hide {
    animation: snackOut .25s forwards;
}

@keyframes snackIn {
    from {
        transform: translateX(30px);
        opacity: 0;
    }

    to {
        transform: none;
        opacity: 1;
    }
}

@keyframes snackOut {
    to {
        transform: translateX(30px);
        opacity: 0;
    }
}

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════ */

/* Tablet apaisada */
@media (max-width: 1199.98px) {
    .login-right {
        padding: 40px 48px;
    }

    .login-left {
        padding: 24px;
    }
}

/* Tablet retrato — apilado vertical */
@media (max-width: 991.98px) {
    html, body {
        overflow: auto; /* Permite scroll vertical si la pantalla es muy bajita */
    }

    .login-layout {
        display: flex; /* Cambiamos de Grid a Flex para centrar */
        align-items: center;
        justify-content: center;
        min-height: 100vh;
        height: auto;
    }

    .login-left {
        display: none !important; /* Desaparece la imagen completamente */
    }

    .login-right {
        width: 100%;
        padding: 40px 24px;
        align-items: center;
        background: var(--right-bg);
    }

    .login-panel {
        max-width: 400px;
        width: 100%;
    }
}

/* Móvil */
@media (max-width: 575.98px) {
    .login-right {
        padding: 24px 16px;
    }

    .panel-logo-image {
        width: 120px;
    }

    .panel-title {
        font-size: 1.6rem;
    }
}
