/* ============================================================
   Grupo Fenix — Login del sistema de gestion.

   Toma la identidad visual de la web publica (negro + naranja
   #F26522, Bebas Neue + Inter) para que el salto desde la web
   no se sienta como entrar a otro producto. Una vez adentro,
   el sistema conserva su propio estilo.

   Mismos nombres de clase que craft (static/custom/css/login.css)
   para mantener la convencion entre los repos hermanos.

   Los widgets del LoginForm traen clases de Bootstrap fijas desde
   grupo_fenix/forms.py (.form-control, .form-check-input). Las
   reestilamos aca en vez de tocar el form, que es codigo compartido
   con el resto del ERP.
   ============================================================ */

:root {
    --fenix-orange: #F26522;
    --fenix-orange-dark: #d4541c;
    --fenix-black: #0a0a0a;
    --fenix-dark: #111827;
    --fenix-gray: #1f2937;
}

.login-body {
    margin: 0;
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--fenix-black);
    color: #e5e7eb;
    min-height: 100vh;
    display: flex;
}

.login-body main { width: 100%; display: flex; min-height: 100vh; }

.login-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    min-height: 100vh;
}

@media (min-width: 992px) {
    .login-wrapper { grid-template-columns: 1.1fr 1fr; }
}

/* Panel izquierdo (hero) ---------------------------------------- */
.login-hero {
    position: relative;
    background:
        radial-gradient(circle at 20% 25%, rgba(242, 101, 34, .16), transparent 55%),
        radial-gradient(circle at 85% 80%, rgba(217, 119, 6, .12), transparent 55%),
        var(--fenix-dark);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 48px 64px;
    overflow: hidden;
}

.login-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(255,255,255,.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}

@media (min-width: 992px) {
    .login-hero { display: flex; }
}

.hero-content {
    position: relative;
    max-width: 520px;
    z-index: 2;
}

.hero-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    margin-bottom: 40px;
}

.hero-logo {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    transition: transform .3s ease;
}

.hero-brand:hover .hero-logo { transform: scale(1.08); }

.hero-brand span {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.9rem;
    letter-spacing: .12em;
    color: #fff;
    transition: color .3s ease;
}

.hero-brand:hover span { color: var(--fenix-orange); }

.login-hero h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2.6rem, 4.5vw, 4rem);
    font-weight: 400;
    line-height: 1;
    letter-spacing: .03em;
    text-transform: uppercase;
    margin: 0 0 24px;
    color: #fff;
}

.login-hero h2 .accent {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 40%, #d97706 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-hero p {
    color: rgba(255, 255, 255, .65);
    line-height: 1.65;
    margin: 0 0 32px;
    font-size: 1rem;
}

.login-hero-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 40px;
}

.login-hero-feature {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.login-hero-feature i {
    color: var(--fenix-orange);
    font-size: 1.25rem;
    line-height: 1;
    margin-top: 2px;
}

.login-hero-feature strong {
    display: block;
    font-size: .92rem;
    margin-bottom: 2px;
    color: #f3f4f6;
}

.login-hero-feature span {
    font-size: .82rem;
    color: rgba(255,255,255,.5);
}

/* Panel derecho (form) ------------------------------------------ */
.login-panel {
    background: var(--fenix-black);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    position: relative;
}

@media (min-width: 768px) {
    .login-panel { padding: 64px 48px; }
}

.login-back {
    position: absolute;
    top: 24px; left: 24px;
    font-size: .85rem;
    color: #6b7280;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color .25s ease;
}

.login-back:hover { color: var(--fenix-orange); }

.login-box {
    width: 100%;
    max-width: 400px;
}

/* El logo del box solo aparece en mobile, donde no se ve el hero. */
.login-box-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
}

.login-box-logo svg { width: 44px; height: 44px; }

.login-box-logo span {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.6rem;
    letter-spacing: .12em;
    color: #fff;
}

@media (min-width: 992px) {
    .login-box-logo { display: none; }
}

.login-box h3 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2rem;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #fff;
    margin: 0 0 6px;
}

.login-box .lead-muted {
    font-size: .875rem;
    color: #6b7280;
    margin: 0 0 32px;
}

/* Campos --------------------------------------------------------- */
.login-form .form-group { margin-bottom: 20px; }

.login-form label {
    display: block;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #9ca3af;
    margin-bottom: 8px;
}

.input-wrap { position: relative; }

.input-wrap > i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 1rem;
    pointer-events: none;
    transition: color .25s ease;
}

.input-wrap:focus-within > i { color: var(--fenix-orange); }

.input-wrap input,
.input-wrap input.form-control {
    width: 100%;
    padding: 14px 16px 14px 44px;
    background: rgba(31, 41, 55, .5);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 8px;
    color: #f3f4f6;
    font-size: .95rem;
    font-family: inherit;
    transition: border-color .25s ease, box-shadow .25s ease, background .25s ease;
}

.input-wrap input::placeholder { color: #6b7280; }

.input-wrap input:focus,
.input-wrap input.form-control:focus {
    outline: none;
    background: rgba(31, 41, 55, .8);
    border-color: var(--fenix-orange);
    box-shadow: 0 0 0 3px rgba(242, 101, 34, .15);
}

/* El toggle de "mostrar contraseña" ocupa el margen derecho. */
.input-wrap input.has-toggle { padding-right: 44px; }

/* Autofill de Chrome: por defecto pinta el input de celeste. */
.input-wrap input:-webkit-autofill,
.input-wrap input:-webkit-autofill:hover,
.input-wrap input:-webkit-autofill:focus {
    -webkit-text-fill-color: #f3f4f6;
    -webkit-box-shadow: 0 0 0 1000px #1a2332 inset;
    caret-color: #f3f4f6;
}

.toggle-pass {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    color: #6b7280;
    padding: 8px;
    cursor: pointer;
    line-height: 1;
    transition: color .25s ease;
}

.toggle-pass:hover { color: var(--fenix-orange); }

/* Recordarme ----------------------------------------------------- */
.login-form .form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 28px;
}

.login-form .form-check input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin: 0;
    flex-shrink: 0;
    accent-color: var(--fenix-orange);
    cursor: pointer;
}

.login-form .form-check label {
    margin: 0;
    font-size: .875rem;
    font-weight: 400;
    letter-spacing: normal;
    text-transform: none;
    color: #9ca3af;
    cursor: pointer;
    user-select: none;
}

/* Boton ---------------------------------------------------------- */
.btn-login {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border: 0;
    border-radius: 8px;
    background: var(--fenix-orange);
    color: #fff;
    font-family: inherit;
    font-weight: 600;
    font-size: .95rem;
    letter-spacing: .05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .25s ease, transform .15s ease, box-shadow .25s ease;
}

.btn-login:hover {
    background: var(--fenix-orange-dark);
    box-shadow: 0 8px 24px rgba(242, 101, 34, .3);
}

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

.btn-login i { transition: transform .25s ease; }
.btn-login:hover i { transform: translateX(3px); }

/* Errores -------------------------------------------------------- */
.alert-login {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, .3);
    background: rgba(239, 68, 68, .1);
    color: #fca5a5;
    font-size: .875rem;
    line-height: 1.4;
}

.alert-login i { flex-shrink: 0; margin-top: 2px; }

/* Creditos ------------------------------------------------------- */
.login-credits {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
}

.login-credits-text {
    font-size: .75rem;
    color: #4b5563;
    letter-spacing: .05em;
}

.login-credits img {
    height: 18px;
    width: auto;
    opacity: .5;
    transition: opacity .25s ease;
}

.login-credits a:hover img { opacity: 1; }
