/* ============================================================
   LOGIN.CSS — Pantalla de acceso (Empresas2 / Davimar)
   Split-screen: panel de marca a la izquierda, formulario a la derecha.
   Paleta tomada del logo (public/images/davimar.png).
   ============================================================ */

:root {
    --brand: #3366ff;
    --brand-dark: #1f4fd8;
    --brand-deep: #081536;
    --accent: #ff0066;
    --ink: #101828;
    --ink-soft: #344054;
    --muted: #667085;
    --line: #e4e7ec;
    --panel: #f5f7fb;
    --font: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: var(--font);
    color: var(--ink);
    background: var(--panel);
    -webkit-font-smoothing: antialiased;
}

.login-shell {
    display: flex;
    min-height: 100vh;
}

/* ============================================================
   PANEL DE MARCA (izquierda)
   ============================================================ */

.login-brand {
    flex: 1.15;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    padding: 3.5rem 4rem;
    color: #fff;
    background:
        radial-gradient(1100px 620px at 88% 8%, rgba(51, 102, 255, 0.55) 0%, transparent 62%),
        radial-gradient(900px 520px at 8% 96%, rgba(255, 0, 102, 0.32) 0%, transparent 60%),
        linear-gradient(155deg, #050f2b 0%, #10265f 45%, #1f4fd8 100%);
}

/* Trama sutil de puntos para dar textura sin ruido visual */
.login-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px);
    background-size: 26px 26px;
    mask-image: radial-gradient(circle at 30% 40%, #000 0%, transparent 78%);
    -webkit-mask-image: radial-gradient(circle at 30% 40%, #000 0%, transparent 78%);
    pointer-events: none;
}

.login-brand__inner {
    position: relative;
    z-index: 1;
    max-width: 560px;
}

/* Placa blanca: el logo es azul/rojo sobre transparente y necesita
   fondo claro para no perderse sobre el azul de marca. */
.login-brand__plate {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    background: #fff;
    border-radius: 16px;
    padding: 18px 26px;
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.32);
}

.login-brand__plate img {
    display: block;
    height: 54px;
    width: auto;
}

.login-brand__title {
    font-size: 2rem;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 2.5rem 0 0.75rem;
}

.login-brand__lead {
    font-size: 1.0625rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.78);
    margin: 0 0 2.5rem;
    max-width: 46ch;
}

.login-brand__features {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.5rem;
    padding: 0;
    margin: 0;
    list-style: none;
    max-width: 520px;
}

.login-brand__features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.9);
}

.login-brand__features i {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    font-size: 0.9375rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #fff;
}

.login-brand__meta {
    position: relative;
    z-index: 1;
    margin: 3.5rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.55);
}

/* ============================================================
   LADO DEL FORMULARIO (derecha)
   ============================================================ */

.login-form-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    background: var(--panel);
}

.login-card {
    position: relative;
    width: 100%;
    max-width: 430px;
    background: #fff;
    border-radius: 20px;
    padding: 2.75rem 2.5rem 2.25rem;
    box-shadow: 0 24px 60px -22px rgba(16, 24, 40, 0.22), 0 2px 6px rgba(16, 24, 40, 0.04);
    overflow: hidden;
}

/* Barra de acento superior azul -> magenta */
.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--brand) 0%, var(--accent) 100%);
}

.login-card__brand {
    display: block;
    margin: 0 auto 1.5rem;
    height: 46px;
    width: auto;
}

.login-card__title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-align: center;
    margin: 0 0 0.375rem;
}

.login-card__subtitle {
    font-size: 0.875rem;
    color: var(--muted);
    text-align: center;
    margin: 0 0 1.75rem;
}

.login-form__field { margin-bottom: 1.125rem; }

.login-form__label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: 0.4375rem;
}

.login-form__control {
    display: flex;
    align-items: stretch;
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-form__control:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(51, 102, 255, 0.14);
}

.login-form__control > i {
    display: grid;
    place-items: center;
    width: 46px;
    flex: 0 0 46px;
    color: #98a2b3;
    font-size: 0.9375rem;
}

.login-form__control input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    padding: 0.8125rem 0.25rem;
    font-family: inherit;
    font-size: 0.9375rem;
    color: var(--ink);
}

.login-form__control input::placeholder { color: #98a2b3; }

.login-form__control input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 40px #fff inset;
    -webkit-text-fill-color: var(--ink);
}

.login-form__reveal {
    display: grid;
    place-items: center;
    width: 46px;
    flex: 0 0 46px;
    border: 0;
    background: transparent;
    color: #98a2b3;
    font-size: 0.9375rem;
    cursor: pointer;
    border-radius: 0 12px 12px 0;
    transition: color 0.15s ease;
}

.login-form__reveal:hover { color: var(--brand); }

.login-form__reveal:focus-visible,
.login-form__submit:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

/* --- Alerta de error --- */

.login-form__alert { margin-bottom: 1.125rem; }

.login-form__alert:empty { display: none; }

.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    background: #fef3f2;
    border: 1px solid #fecdca;
    border-radius: 11px;
    padding: 0.75rem 0.875rem;
    font-size: 0.875rem;
    line-height: 1.45;
    color: #b42318;
}

.login-alert i {
    margin-top: 0.125rem;
    color: #f04438;
}

/* --- Botón --- */

.login-form__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    border: 0;
    border-radius: 12px;
    padding: 0.875rem 1rem;
    margin-top: 1.5rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    box-shadow: 0 10px 22px -10px rgba(51, 102, 255, 0.7);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.login-form__submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px -10px rgba(51, 102, 255, 0.8);
    filter: saturate(1.06);
}

.login-form__submit:active:not(:disabled) {
    transform: translateY(0);
}

.login-form__submit:disabled {
    cursor: default;
    opacity: 0.75;
    box-shadow: none;
}

.login-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: login-spin 0.7s linear infinite;
}

@keyframes login-spin {
    to { transform: rotate(360deg); }
}

/* --- Pie de la tarjeta --- */

.login-card__footer {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
    text-align: center;
}

.login-card__footer p {
    margin: 0;
    font-size: 0.75rem;
    color: var(--muted);
}

.login-card__footer p + p { margin-top: 0.25rem; }

.login-card__footer i { color: #98a2b3; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1199.98px) {
    .login-brand { padding: 3rem; }
    .login-brand__title { font-size: 1.75rem; }
}

/* Sin espacio para dos columnas: el formulario hereda el fondo de marca */
@media (max-width: 991.98px) {
    .login-brand { display: none; }

    .login-form-side {
        background:
            radial-gradient(800px 420px at 80% 0%, rgba(51, 102, 255, 0.5) 0%, transparent 65%),
            linear-gradient(155deg, #050f2b 0%, #10265f 50%, #1f4fd8 100%);
        padding: 2rem 1.25rem;
    }
}

@media (max-width: 575.98px) {
    .login-card { padding: 2rem 1.5rem 1.75rem; border-radius: 16px; }
    .login-card__title { font-size: 1.375rem; }
    .login-card__brand { height: 40px; }
}
