/* --- Variables globales --- */
:root {
    --primary-blue: rgb(16, 33, 63, 0.94);
    --hover-blue: rgba(0, 6, 18, 0.94);
    --border-gray: #ccc;
    --text-gray: #333;
    --placeholder-gray: #aaa;
    /* Se usaba en el foco de los campos y el fondo del logo sin estar definida: rojo vino de KARMA */
    --primary-red: #9E1B2E;
    --page-bg: #ffffff;
    --input-bg: #ffffff;
    --input-text: #17181A;
}

/* Modo oscuro: misma paleta que el POS, el Home y los paneles (#101012 con rojo vino), según karma_tema */
body.dark {
    --primary-blue: #F1F1EF;
    --hover-blue: #7A1322;
    --border-gray: #2B2C2F;
    --text-gray: #C9C9C7;
    --placeholder-gray: #6D6E6C;
    --page-bg: #101012;
    --input-bg: #17181B;
    --input-text: #F1F1EF;
}

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

body {
    font-family: 'Montserrat', sans-serif;
    height: 100vh;
    width: 100vw;
    overflow: hidden; /* Evita barras de desplazamiento innecesarias */
    background-color: var(--page-bg);
}

/* --- Contenedor Principal a Pantalla Completa --- */
.login-container {
    position: relative;
    display: flex;
    width: 100vw;       /* Toma todo el ancho de la ventana */
    height: 100vh;      /* Toma todo el alto de la ventana */
    background-color: var(--page-bg);
    border-radius: 0;   /* Eliminamos esquinas redondeadas */
    box-shadow: none;   /* Eliminamos sombras de tipo tarjeta */
    overflow: hidden;
}

/* --- 1. Estilos para la Imagen del Lado Izquierdo --- */
.left-panel {
    width: 50%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.left-image {
    width: 100%;
    height: 100%;
    /* cover: la foto se recorta en lugar de deformarse en pantallas anchas o angostas */
    object-fit: cover;
    object-position: center;
    display: block;
}

/* --- 2. Estilos para la Imagen del Logo Central --- */
.overlap-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: var(--primary-blue);
    border: 4px solid #ffffff;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.logo-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: contain;
    background-color: var(--primary-red);
    display: block;
}

/* --- Panel Derecho (Formulario) --- */
.right-panel {
    width: 50%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 50px;
}

.header-section {
    text-align: center;
    margin-bottom: 40px;
}

.header-section h1 {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary-blue);
    letter-spacing: 1px;
}

.header-section p {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-blue);
    margin-top: 5px;
    letter-spacing: 0.5px;
}

/* --- Formulario --- */
.login-form {
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.input-group {
    width: 100%;
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-gray);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.input-group input {
    width: 100%;
    padding: 14px 20px;
    border: 1px solid var(--border-gray);
    border-radius: 25px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    background-color: var(--input-bg);
    color: var(--input-text);
    transition: border-color 0.3s;
}

.input-group input:focus {
    border-color: var(--primary-red);
}

.input-group input::placeholder {
    color: var(--placeholder-gray);
}

/* --- Botón Ingresar --- */
.login-form button {
    width: 100%;
    padding: 15px 0;
    background-color: rgb(16, 33, 63, 0.94);
    color: #ffffff;
    border: none;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
    margin-bottom: 20px;
    letter-spacing: 1px;
    transition: background-color 0.3s;
}

.login-form button:hover {
    background-color: var(--hover-blue);
}

/* --- Enlace Inferior --- */
.forgot-password {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-gray);
    text-decoration: none;
    letter-spacing: 0.5px;
}

.forgot-password:hover {
    text-decoration: underline;
}

body.dark .login-form button { background-color: rgba(158, 27, 46, 0.85); }
body.dark .login-form button:hover { background-color: #9E1B2E; }
body.dark .overlap-logo { border-color: #101012; }

/* --- Pantallas medianas y celulares: una sola columna con la foto como franja superior --- */
@media (max-width: 860px) {
    body { height: auto; min-height: 100vh; min-height: 100dvh; overflow-x: hidden; overflow-y: auto; width: 100%; }
    .login-container { flex-direction: column; width: 100%; height: auto; min-height: 100vh; min-height: 100dvh; overflow: visible; }
    .left-panel { width: 100%; height: 30vh; min-height: 170px; max-height: 280px; flex: none; }
    .overlap-logo { top: clamp(170px, 30vh, 280px); width: 96px; height: 96px; }
    .right-panel { width: 100%; height: auto; flex: 1; justify-content: flex-start; padding: 72px 20px 40px; }
    .header-section { margin-bottom: 28px; }
    .header-section h1 { font-size: 30px; }
    .header-section p { font-size: 13px; }
    .input-group input { font-size: 16px; } /* 16px evita el zoom automático de iOS al enfocar */
}
@media (max-width: 380px) {
    .header-section h1 { font-size: 26px; }
    .right-panel { padding-left: 16px; padding-right: 16px; }
}