/* css/login.css - Pantalla de inicio de sesión */

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

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: radial-gradient(120% 90% at 30% 20%, #0f2a78 0%, #08154a 55%, #050c2b 100%);
    color: #fff;
    overflow-x: hidden;
}

.hidden { display: none !important; }

/* ---------- Fondo ---------- */
.bg-map {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.map-ready .bg-map { display: none; }

/* Mapa real oscuro de Cali, teñido de azul marino como en el diseño */
.bg-real-map {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: transparent;
    opacity: 1;
    transition: opacity 0.6s ease;
}

.bg-real-map.is-loading { opacity: 0; }

.bg-real-map .leaflet-tile-pane {
    filter: brightness(0.8) contrast(1.4) sepia(1) hue-rotate(190deg) saturate(3.4);
    opacity: 0.9;
}

.bg-real-map.leaflet-container { background: transparent; }

.bg-shade {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        linear-gradient(90deg, rgba(5, 12, 43, 0.62) 0%, rgba(5, 12, 43, 0.05) 45%, rgba(5, 12, 43, 0.25) 100%),
        radial-gradient(60% 50% at 0% 100%, rgba(99, 57, 235, 0.55) 0%, transparent 70%);
    pointer-events: none;
}

/* ---------- Layout ---------- */
.login-page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(360px, 560px);
    align-items: center;
    gap: 48px;
    padding: 48px clamp(24px, 7vw, 120px);
}

/* ---------- Marca ---------- */
.brand-logo,
.card-logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-mark { width: 84px; height: 66px; color: #fff; flex-shrink: 0; }
.logo-word { font-size: 52px; font-weight: 800; letter-spacing: -1.5px; }

.tagline {
    margin-top: 44px;
    font-size: clamp(30px, 3.2vw, 44px);
    line-height: 1.18;
    font-weight: 800;
}

.tagline span {
    background: linear-gradient(90deg, #1d8bff 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.features { list-style: none; margin-top: 40px; display: grid; gap: 22px; }

.features li { display: flex; align-items: center; gap: 18px; font-size: 18px; line-height: 1.3; }

.feat-icon {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1.5px solid rgba(99, 132, 255, 0.55);
    background: rgba(30, 58, 138, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7aa2ff;
    box-shadow: 0 0 22px rgba(80, 110, 255, 0.25);
}

/* ---------- Tarjeta ---------- */
.login-card {
    background: #fff;
    color: #101a3d;
    border-radius: 22px;
    padding: clamp(28px, 4vw, 44px);
    box-shadow: 0 30px 80px rgba(0, 0, 20, 0.55);
}

.card-logo { color: #10163d; }
.card-logo .logo-mark { color: #10163d; width: 76px; height: 60px; }
.card-logo .logo-word { color: #10163d; font-size: 46px; }

.login-card h1 { margin-top: 30px; font-size: 32px; font-weight: 800; letter-spacing: -0.5px; }
.card-sub { margin-top: 8px; color: #6b7392; font-size: 16px; line-height: 1.5; max-width: 380px; }

form { margin-top: 30px; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 15px; font-weight: 600; margin-bottom: 8px; color: #2a3358; }

.field {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1.5px solid #dfe3f0;
    border-radius: 12px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field:focus-within { border-color: #4f7cff; box-shadow: 0 0 0 4px rgba(79, 124, 255, 0.15); }

.field-icon { position: absolute; left: 16px; color: #8b93b0; pointer-events: none; }

.field input {
    width: 100%;
    height: 56px;
    border: none;
    outline: none;
    background: transparent;
    padding: 0 48px 0 50px;
    font-size: 16px;
    color: #101a3d;
    border-radius: 12px;
}

.field input::placeholder { color: #9aa2bf; }

.eye {
    position: absolute;
    right: 8px;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: #6b7392;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.eye:hover { color: #101a3d; background: #f1f3fa; }
.eye .eye-off { display: none; }
.eye.showing .eye-on { display: none; }
.eye.showing .eye-off { display: block; }

.error-message {
    display: none;
    background: #fdecec;
    color: #b42318;
    border: 1px solid #f7c1bd;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 16px;
}

.error-message.show { display: block; }

.btn-primary {
    width: 100%;
    height: 58px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(90deg, #1677ff 0%, #6d3df0 100%);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 10px 24px rgba(58, 91, 255, 0.35);
    transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(58, 91, 255, 0.45); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.7; cursor: wait; transform: none; }

.spinner {
    width: 26px;
    height: 26px;
    margin: 14px auto 0;
    border: 3px solid #dfe3f0;
    border-top-color: #4f7cff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.card-foot {
    margin-top: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 15px;
}

.keep { display: flex; align-items: center; gap: 10px; color: #4a5378; cursor: pointer; }
.keep input { width: 20px; height: 20px; accent-color: #3b64ff; cursor: pointer; }

.forgot { color: #1259d6; text-decoration: none; font-weight: 500; }
.forgot:hover { text-decoration: underline; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .login-page { grid-template-columns: 1fr; gap: 28px; padding: 28px 20px 40px; align-content: start; }
    .brand { text-align: center; }
    .brand-logo { justify-content: center; }
    .logo-mark { width: 64px; height: 50px; }
    .logo-word { font-size: 40px; }
    .tagline { margin-top: 22px; font-size: 28px; }
    .features { display: none; }
    .login-card { width: 100%; max-width: 480px; margin: 0 auto; }
    .card-logo { display: none; }
    .login-card h1 { margin-top: 0; }
}

.map-credit {
    position: fixed;
    right: 12px;
    bottom: 8px;
    z-index: 1;
    font-size: 11px;
    color: rgba(190, 205, 255, 0.55);
}
