/* =====================================================================
   XPERTCELL · Login
   ===================================================================== */

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, sans-serif;
    color: #1a1f2c;
    background: #0a1530;
    overflow-x: hidden;
}

/* Background con gradientes */
.bg-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: radial-gradient(at 30% 20%, #1a3a8c 0%, transparent 50%),
                radial-gradient(at 80% 80%, #0a2a6f 0%, transparent 50%),
                #0a1530;
}
.bg-grid {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}
.bg-glow {
    position: absolute;
    width: 500px; height: 500px;
    border-radius: 50%;
    filter: blur(110px);
    opacity: .5;
    pointer-events: none;
}
.bg-glow-blue { background: #1d4eb6; top: -150px; right: -150px; }
.bg-glow-cyan { background: #0aa1cf; bottom: -150px; left: -120px; opacity: .35; }

/* Login screen */
.login-screen {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 25px 60px rgba(0,0,0,.35);
    overflow: hidden;
}

.card-header {
    padding: 1.5rem 1.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f2f5;
    background: linear-gradient(180deg, #fafbfd 0%, #fff 100%);
}
.brand {
    display: flex; align-items: center; gap: .65rem;
    font-weight: 700; font-size: 1.1rem; color: #1a1f2c;
}
.brand-mark {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, #1d4eb6 0%, #0a2a6f 100%);
    color: #fff;
    border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; letter-spacing: .5px;
}
.tech-tag {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .3rem .65rem;
    background: rgba(25, 135, 84, .1);
    color: #198754;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
}
.tag-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #198754;
    box-shadow: 0 0 10px #198754;
    animation: pulse 1.6s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .65; transform: scale(.85); }
}

.card-body { padding: 1.75rem; }
.hello {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: .35rem;
    color: #1a1f2c;
}
.cursor {
    color: #1d4eb6;
    animation: blink 1s infinite;
    margin-left: 2px;
}
@keyframes blink { 50% { opacity: 0; } }
.subhello {
    color: #6b7280;
    margin-bottom: 1.5rem;
    font-size: .9rem;
}

.field { margin-bottom: 1rem; }
.field label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: #3a4256;
    margin-bottom: .35rem;
}
.input-wrap {
    position: relative;
}
.input-wrap input {
    width: 100%;
    padding: .7rem .9rem .7rem 2.4rem;
    border: 1px solid #d8dde7;
    border-radius: .55rem;
    font-size: .92rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.input-wrap input:focus {
    outline: none;
    border-color: #1d4eb6;
    box-shadow: 0 0 0 3px rgba(29, 78, 182, .15);
}
.input-icon {
    position: absolute;
    left: .85rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
}
.input-toggle {
    position: absolute;
    right: .55rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: .25rem .4rem;
}
.input-toggle:hover { color: #1d4eb6; }

.field-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    font-size: .85rem;
    color: #3a4256;
}
.checkbox {
    display: inline-flex; align-items: center; gap: .45rem;
    cursor: pointer;
}
.checkbox input { width: 16px; height: 16px; accent-color: #1d4eb6; cursor: pointer; }

.btn-submit {
    width: 100%;
    padding: .8rem 1rem;
    background: linear-gradient(135deg, #1d4eb6 0%, #0a2a6f 100%);
    color: #fff;
    border: none;
    border-radius: .55rem;
    font-weight: 600;
    font-size: .95rem;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
    position: relative;
}
.btn-submit:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(29, 78, 182, .4); }
.btn-submit:disabled, .btn-submit.is-loading { opacity: .85; cursor: wait; transform: none; }
.btn-label, .btn-loading {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    justify-content: center;
}
.btn-loading { display: none; }
.btn-submit.is-loading .btn-label { display: none; }
.btn-submit.is-loading .btn-loading { display: inline-flex; }

.spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.alert {
    padding: .65rem .85rem;
    border-radius: .5rem;
    margin-bottom: 1rem;
    font-size: .85rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.alert-error { background: rgba(220,53,69,.1); color: #b02a37; border: 1px solid rgba(220,53,69,.2); }
.alert-ok    { background: rgba(25,135,84,.1);  color: #146c43; border: 1px solid rgba(25,135,84,.2); }

.card-footer {
    padding: 1rem 1.75rem;
    border-top: 1px solid #f0f2f5;
    text-align: center;
}
.meta-line { color: #6b7280; font-size: .78rem; }

.page-footer {
    margin-top: 1.5rem;
    color: rgba(255,255,255,.6);
    font-size: .78rem;
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}
.page-footer a { color: rgba(255,255,255,.85); text-decoration: none; }
.page-footer a:hover { color: #fff; text-decoration: underline; }
.footer-divider { opacity: .4; }
