/* ============================================================
   Konfio CRM · Login · "Brisa & Teal"
   Claro, cálido y confiable — misma familia visual que app.css
   ============================================================ */

@font-face {
    font-family: 'Sora';
    src: url('../fonts/sora-var.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Plus Jakarta Sans';
    src: url('../fonts/plus-jakarta-sans-var.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --ink-950: #0d2237;
    --ink-900: #14304a;
    --forest: #0099f5;
    --forest-strong: #0078c8;
    --signal: #7dd3fc;
    --signal-strong: #38bdf8;
    --signal-soft: rgba(0, 153, 245, 0.14);
    --paper: #f3f6f9;
    --text: #2c4a63;
    --text-soft: #64798c;
    --text-faint: #93a5b4;
    --line: #e4ebf0;
    --line-strong: #d3dee6;
    --font-display: 'Sora', 'Segoe UI', 'Trebuchet MS', system-ui, sans-serif;
    --font-sans: 'Plus Jakarta Sans', 'Segoe UI', 'Trebuchet MS', system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

body.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 1.5rem;
    font-family: var(--font-sans);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    background:
        radial-gradient(50% 55% at 5% 0%, rgba(125, 211, 252, 0.55), transparent 60%),
        radial-gradient(45% 50% at 100% 10%, rgba(56, 189, 248, 0.3), transparent 60%),
        radial-gradient(55% 55% at 88% 100%, rgba(0, 153, 245, 0.26), transparent 60%),
        radial-gradient(40% 42% at 0% 95%, rgba(251, 191, 36, 0.22), transparent 60%),
        radial-gradient(38% 38% at 55% 110%, rgba(251, 113, 133, 0.16), transparent 60%),
        radial-gradient(30% 30% at 30% -5%, rgba(167, 139, 250, 0.18), transparent 60%),
        linear-gradient(160deg, #f8fbfc 0%, #eef5f7 55%, #e9f2f4 100%);
}

/* Puntos decorativos */
body.login-body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
    background-image: radial-gradient(rgba(0, 153, 245, 0.16) 1.2px, transparent 1.2px);
    background-size: 26px 26px;
    mask-image: radial-gradient(70% 70% at 50% 50%, transparent 30%, #000 100%);
    -webkit-mask-image: radial-gradient(70% 70% at 50% 50%, transparent 30%, #000 100%);
}

::selection {
    background: #fde68a;
    color: var(--ink-950);
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 430px;
}

.login-card {
    position: relative;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 2.75rem 2.5rem 2.25rem;
    box-shadow: 0 2px 6px rgba(16, 42, 67, 0.05), 0 30px 70px rgba(16, 42, 67, 0.12);
    overflow: hidden;
    animation: rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Barra de marca superior */
.login-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--forest-strong), var(--forest) 40%, var(--signal-strong) 70%, #fbbf24);
}

/* Resplandor decorativo */
.login-card::after {
    content: "";
    position: absolute;
    right: -80px;
    bottom: -80px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 153, 245, 0.12), transparent 70%);
    pointer-events: none;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    width: 66px;
    height: 66px;
    margin: 0 auto 1.1rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #38bdf8 0%, #0099f5 45%, #0078c8 100%);
    color: #ffffff;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 2.1rem;
    line-height: 1;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 12px 28px rgba(0, 153, 245, 0.38);
}

.login-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--ink-900);
    margin: 0 0 0.3rem;
}

.login-subtitle {
    color: var(--text-soft);
    font-size: 0.8125rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 700;
    margin: 0;
}

.login-form .form-label {
    font-weight: 700;
    color: var(--ink-900);
    font-size: 0.8125rem;
    margin-bottom: 0.375rem;
    letter-spacing: 0.01em;
}

.login-form .form-control {
    padding: 0.72rem 0.95rem;
    border-radius: 12px;
    border: 1px solid var(--line-strong);
    background: #ffffff;
    font-size: 0.95rem;
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-form .form-control::placeholder {
    color: var(--text-faint);
}

.login-form .form-control:focus {
    border-color: var(--forest);
    box-shadow: 0 0 0 3px var(--signal-soft);
}

.login-form .input-group {
    border-radius: 12px;
}

.login-form .input-group .form-control {
    border-right: none;
}

.login-form .input-group .btn-outline-secondary {
    border: 1px solid var(--line-strong);
    border-left: none;
    background: #ffffff;
    color: var(--text-faint);
    border-radius: 0 12px 12px 0;
}

.login-form .input-group .btn-outline-secondary:hover {
    background: var(--paper);
    color: var(--forest);
}

.btn-login {
    padding: 0.82rem;
    border-radius: 13px;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.01em;
    background: linear-gradient(135deg, #38bdf8 0%, #0099f5 45%, #0078c8 100%);
    border: none;
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 12px 26px rgba(0, 153, 245, 0.42);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-login:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 18px 38px rgba(0, 153, 245, 0.52);
    color: #ffffff;
}

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

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.link-recuperar {
    color: var(--text-soft);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 700;
    transition: color 0.2s ease;
}

.link-recuperar:hover {
    color: var(--forest);
}

.login-info {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-faint);
}

.login-info small {
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}

#loginAlert {
    border-radius: 12px;
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    border: none;
    background: rgba(244, 63, 94, 0.1);
    color: #be123c;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    body.login-body {
        padding: 1rem;
    }

    .login-card {
        padding: 2.25rem 1.5rem 1.75rem;
        border-radius: 20px;
    }

    .login-logo {
        width: 58px;
        height: 58px;
        font-size: 1.8rem;
        border-radius: 17px;
    }

    .login-title {
        font-size: 1.6rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}
