/* ============================================
   RESET Y VARIABLES GLOBALES
   ============================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #2c3e50;
    /* Colores actualizados a Labor Segura */
    --accent: rgba(255, 84, 2, 1);           /* Naranja principal */
    --accent-hover: rgba(220, 70, 0, 1);     /* Naranja oscuro hover */
    --secondary: rgba(255, 200, 34, 1);      /* Amarillo secundario (cascos) */
    --secondary-soft: rgba(255, 200, 34, 0.15);
    
    --light-bg: #f8f9fa;
    --header-bg: #eef1f4;
    --card-bg: #ffffff;
    --text-dark: #2c3e50;
    --text-light: #6c757d;
    --border-soft: #e2e6ea;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.12);
    --radius: 16px;
}

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

body {
    max-width: 100%;
    overflow-x: hidden;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background: var(--light-bg);
    min-height: 100vh;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

/* ============================================
   LAYOUT PRINCIPAL — Grid de 2 columnas
   ============================================ */
.inix {
    position: relative;
    display: grid;
    width: 100%;
    min-height: 100vh;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr auto;
}

/* ============================================
   COLUMNA IZQUIERDA — Panel visual (branding)
   Fondo: collage de cascos
   ============================================ */
.panel-visual {
    grid-column: 1 / 2;
    grid-row: 1 / 4;
    background:
        radial-gradient(circle at 20% 15%, rgba(255, 84, 2, 0.10), transparent 45%),
        radial-gradient(circle at 85% 85%, rgba(255, 200, 34, 0.15), transparent 45%),
        linear-gradient(160deg, #eef1f4 0%, #dde3e9 100%);
    position: relative;
    overflow: hidden;
    display: grid;
    place-items: center;
    padding: 2rem;
}

/* Tarjetas flotantes tipo "casco" en el fondo del aside */
.collage-media {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.media-tile {
    position: absolute;
    display: grid;
    place-items: center;
    color: var(--secondary); /* Cambiado a amarillo */
    opacity: 0.10;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.media-tile svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* 4 piezas en las 4 esquinas, grandes y sobrias */
.tile-casco-1 { top: 4%;    left: 4%;   width: 200px; height: 200px; transform: rotate(-6deg); }
.tile-casco-2 { top: 4%;    right: 4%;  width: 190px; height: 190px; transform: rotate(5deg);  }
.tile-casco-3 { bottom: 4%; left: 4%;   width: 190px; height: 190px; transform: rotate(4deg);  }
.tile-casco-4 { bottom: 4%; right: 4%;  width: 200px; height: 200px; transform: rotate(-5deg); }

.panel-visual-contenido {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 2rem 1.75rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(44, 62, 80, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.9);
}

.panel-visual-titulo {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
    line-height: 1.2;
    white-space: nowrap; /* Evita que el texto se rompa en dos líneas */
}

.panel-visual-titulo .highlight { color: var(--accent); }

.panel-visual-subtitulo {
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: 2rem;
}

.panel-visual-lista {
    list-style: none;
    display: grid;
    gap: 0.75rem;
    text-align: left;
}

.panel-visual-lista li {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.85);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.95rem;
    color: var(--primary);
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border-left: 3px solid var(--secondary); /* Detalle amarillo */
}

.panel-visual-lista li svg {
    width: 22px;
    height: 22px;
    color: var(--accent);
    flex-shrink: 0;
}

/* ============================================
   COLUMNA DERECHA — Header, Login y Versión
   ============================================ */
.columna-derecha {
    grid-column: 2 / 3;
    grid-row: 1 / 4;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
}

/* --- Header (logo + apps) --- */
.ini1 {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--header-bg);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-bloque {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.logo-svg {
    display: grid;
    width: 44px;
    height: 44px;
    padding: 2px; /* Reducido para que el SVG ocupe más espacio */
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    background: #f4f4f4;
    place-items: center;
}

.logo-svg svg { width: 100%; height: 100%; display: block; }

/* Texto del logo: unificado en naranja */
.logo-texto {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--accent);
    white-space: nowrap;
}

/* --- Icono 9-dots --- */
.apps {
    position: relative;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    background: transparent;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease;
}

.apps:hover { background: rgba(255, 84, 2, 0.10); transform: scale(1.05); }
.apps:hover .apps-dot { background: var(--accent); }
.apps:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- Tarjeta de login (centro) --- */
.ini3 {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
    display: grid;
    place-items: center;
    padding: 2rem 1.5rem;
}

.abre {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 2.5rem 2.25rem;
    box-shadow: var(--shadow);
    display: grid;
    gap: 1rem;
    transition: box-shadow 0.3s ease;
    border-top: 4px solid var(--accent); /* Detalle naranja superior */
}

.abre:hover { box-shadow: var(--shadow-hover); }

.abre-titulo {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
    margin-bottom: 0.25rem;
}

.abre-subtitulo {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

/* --- Campos --- */
.campo { display: grid; gap: 0.4rem; }

.campo label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 0.2px;
}

.campo input {
    width: 100%;
    padding: 0.85rem 1.1rem;
    border: 2px solid var(--border-soft);
    border-radius: 50px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-dark);
    background: #ffffff;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.campo input::placeholder { color: #a0a8b0; }

.campo input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(255, 84, 2, 0.10);
}

/* --- Aviso de error --- */
.aviso {
    display: none;
    background: rgba(255, 84, 2, 0.08);
    color: var(--accent);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    border-left: 3px solid var(--accent);
}

.aviso.visible { display: block; }

/* --- Botón principal --- */
.btn-login {
    width: 100%;
    padding: 0.95rem 2rem;
    background: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    margin-top: 0.5rem;
}

.btn-login:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 84, 2, 0.35);
}

.btn-login:active { transform: translateY(0); }
.btn-login:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Estado del botón mientras se valida */
.btn-login.is-loading {
    opacity: 0.55;
    cursor: default;
    pointer-events: none;
}

/* --- Enlaces secundarios --- */
.abre-links {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.abre-links a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.25s ease;
}

.abre-links a:hover { color: var(--accent); }

/* --- Footer versión (abajo-derecha) --- */
.ini4 {
    grid-column: 1 / 2;
    grid-row: 3 / 4;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 1rem 1.5rem;
}

.vers {
    font-size: 0.8rem;
    color: var(--text-light);
    cursor: default;
    user-select: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    .inix { grid-template-columns: 1fr; }
    .panel-visual { display: none; }
    .columna-derecha { grid-column: 1 / 2; }
    .abre { padding: 2rem 1.5rem; }
}

@media (max-width: 450px) {
    .ini1 { padding: 0.85rem 1rem; }
    .logo-texto { font-size: 1.15rem; }
    .logo-svg { width: 34px; height: 34px; padding: 2px; }
    .abre { padding: 1.75rem 1.25rem; }
    .abre-titulo { font-size: 1.35rem; }
    .abre-links { justify-content: center; }
}