/* =============================================
   SIGECO — Login Moderno
   Fuente: Sora + JetBrains Mono
   Paleta: Azul corporativo profundo + verde esmeralda
   ============================================= */

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

:root {
    --blue-dark:   #0d1b2a;
    --blue-mid:    #1a3553;
    --blue-accent: #1b6ca8;
    --blue-light:  #2d8fdd;
    --green:       #00c896;
    --green-dim:   #00a87a;
    --white:       #ffffff;
    --off-white:   #f0f4f8;
    --gray-100:    #e8edf2;
    --gray-300:    #b0bec9;
    --gray-500:    #7a8fa0;
    --text-dark:   #0d1b2a;
    --text-mid:    #3d5166;
    --danger:      #e8394a;
    --danger-bg:   #fff0f2;
    --shadow-sm:   0 2px 8px rgba(13,27,42,.08);
    --shadow-md:   0 8px 32px rgba(13,27,42,.14);
    --shadow-lg:   0 20px 60px rgba(13,27,42,.22);
    --radius:      14px;
    --radius-sm:   8px;
    --transition:  all .22s cubic-bezier(.4,0,.2,1);
}

html, body {
    height: 100%;
    font-family: 'Sora', sans-serif;
    background: var(--off-white);
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
}

/* ─── Background scene ─── */
.bg-scene {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    background: linear-gradient(135deg, #0d1b2a 0%, #1a3553 55%, #0d2840 100%);
}

.bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(45,143,221,.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(45,143,221,.07) 1px, transparent 1px);
    background-size: 48px 48px;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .35;
    animation: floatOrb 12s ease-in-out infinite alternate;
}
.orb-1 { width: 520px; height: 520px; background: #1b6ca8; top: -180px; left: -120px; animation-delay: 0s; }
.orb-2 { width: 380px; height: 380px; background: #00c896; bottom: -100px; right: -80px; animation-delay: -4s; }
.orb-3 { width: 280px; height: 280px; background: #2d8fdd; top: 40%; left: 35%; animation-delay: -8s; }

@keyframes floatOrb {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, -40px) scale(1.08); }
}

.particles { position: absolute; inset: 0; pointer-events: none; }
.particle {
    position: absolute;
    background: rgba(255,255,255,.45);
    border-radius: 50%;
    animation: floatPart linear infinite;
}
@keyframes floatPart {
    0%   { transform: translateY(0) scale(1); opacity: .5; }
    50%  { opacity: .9; }
    100% { transform: translateY(-120px) scale(.6); opacity: 0; }
}

/* ─── Layout ─── */
.login-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    align-items: stretch;
}

/* ─── Brand panel (left) ─── */
.brand-panel {
    flex: 0 0 420px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 56px 48px;
    background: rgba(13,27,42,.55);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-right: 1px solid rgba(255,255,255,.07);
    animation: slideInLeft .6s cubic-bezier(.4,0,.2,1) both;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to   { opacity: 1; transform: translateX(0); }
}

.brand-content { display: flex; flex-direction: column; gap: 32px; }

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border: 1px solid var(--green);
    border-radius: 100px;
    color: var(--green);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    width: fit-content;
}

.brand-logo img {
    max-height: 80px;
    max-width: 220px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

#text-logo {
    font-size: 52px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -.03em;
}
.logo-s    { color: var(--green); }
.logo-igeco{ color: #fff; }

.brand-tagline {
    font-size: 15px;
    font-weight: 300;
    color: rgba(255,255,255,.65);
    line-height: 1.65;
}

.brand-features { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }

.feature-item {
    display: flex;
    align-items: center;
    gap: 14px;
    color: rgba(255,255,255,.8);
    font-size: 13.5px;
    font-weight: 400;
}

.feature-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: rgba(0,200,150,.15);
    border: 1px solid rgba(0,200,150,.3);
    display: grid;
    place-items: center;
    color: var(--green);
    font-size: 14px;
    flex-shrink: 0;
}

.brand-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(255,255,255,.35);
}
.brand-footer .dot { opacity: .5; }

/* ─── Form panel (right) ─── */
.form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    background: var(--white);
    animation: slideInRight .6s .1s cubic-bezier(.4,0,.2,1) both;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

.form-container {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ─── Form header ─── */
.form-header h2 {
    font-size: 30px;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -.03em;
    margin-bottom: 6px;
}
.form-header p {
    font-size: 14px;
    color: var(--gray-500);
    font-weight: 400;
}

/* ─── Error alert ─── */
.alert-error {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    background: var(--danger-bg);
    border: 1px solid rgba(232,57,74,.2);
    border-left: 4px solid var(--danger);
    border-radius: var(--radius-sm);
    color: var(--danger);
    font-size: 13.5px;
    font-weight: 500;
    animation: shake .4s ease;
}
@keyframes shake {
    0%,100% { transform: translateX(0); }
    20%      { transform: translateX(-6px); }
    60%      { transform: translateX(6px); }
}

/* ─── Tabs ─── */
.auth-tabs {
    display: flex;
    gap: 4px;
    background: var(--gray-100);
    padding: 5px;
    border-radius: var(--radius-sm);
}

.tab-btn {
    flex: 1;
    padding: 9px 14px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--gray-500);
    font-family: 'Sora', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.tab-btn.active {
    background: var(--white);
    color: var(--blue-accent);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

.tab-btn:hover:not(.active) {
    color: var(--text-mid);
    background: rgba(255,255,255,.5);
}

/* ─── Fields ─── */
.auth-form { display: flex; flex-direction: column; gap: 18px; }

.field-group { display: flex; flex-direction: column; gap: 7px; margin-bottom: 12px;}

.field-group label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-mid);
    letter-spacing: .02em;
    text-transform: uppercase;
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--gray-300);
    font-size: 14px;
    pointer-events: none;
    transition: var(--transition);
}

.input-wrap input {
    width: 100%;
    padding: 13px 14px 13px 42px;
    border: 1.5px solid var(--gray-100);
    border-radius: var(--radius-sm);
    font-family: 'Sora', sans-serif;
    font-size: 14px;
    color: var(--text-dark);
    background: var(--off-white);
    outline: none;
    transition: var(--transition);
}

.input-wrap input:focus {
    border-color: var(--blue-accent);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(27,108,168,.1);
}

.input-wrap input:focus ~ .input-icon,
.input-wrap:focus-within .input-icon {
    color: var(--blue-accent);
}

.input-wrap input::placeholder { color: var(--gray-300); }

/* Password toggle */
.toggle-pass {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--gray-300);
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
    transition: var(--transition);
    line-height: 1;
}
.toggle-pass:hover { color: var(--blue-accent); }

/* ─── PIN input ─── */
.pin-input {
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 20px !important;
    letter-spacing: .25em;
    text-align: center;
    padding-left: 42px !important;
}

/* ─── Numpad ─── */
.numpad { display: flex; justify-content: center; }

.numpad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 280px;
}

.num-key {
    padding: 16px 10px;
    background: var(--off-white);
    border: 1.5px solid var(--gray-100);
    border-radius: var(--radius-sm);
    font-family: 'Sora', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    user-select: none;
}

.num-key:hover {
    background: var(--blue-accent);
    color: var(--white);
    border-color: var(--blue-accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(27,108,168,.3);
}

.num-key:active { transform: scale(.95); }

.num-key.zero { grid-column: 1 / 3; }

.num-key.del-key {
    background: rgba(232,57,74,.07);
    border-color: rgba(232,57,74,.15);
    color: var(--danger);
    font-size: 16px;
}
.num-key.del-key:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: var(--white);
}

/* ─── Submit button ─── */
.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px 24px;
    background: linear-gradient(135deg, var(--blue-accent) 0%, var(--blue-light) 100%);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--white);
    font-family: 'Sora', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: .01em;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(27,108,168,.35);
}

.btn-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--blue-light) 0%, var(--green-dim) 100%);
    opacity: 0;
    transition: var(--transition);
}

.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(27,108,168,.45); }
.btn-submit:hover::before { opacity: 1; }
.btn-submit:active { transform: scale(.98); }
.btn-submit span, .btn-submit i { position: relative; z-index: 1; }

.btn-submit:disabled {
    cursor: wait;
    opacity: .9;
    transform: none;
}

.btn-submit.is-loading i {
    display: none;
}

.btn-spinner {
    display: none;
    width: 17px;
    height: 17px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin .75s linear infinite;
}

.btn-submit.is-loading .btn-spinner {
    display: inline-block;
}

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

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--gray-500);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .04em;
}

#googleAuthBlock {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    height: 1px;
    flex: 1;
    background: var(--gray-100);
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 13px 18px;
    border: 1.5px solid var(--gray-100);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--text-mid);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.btn-google:hover {
    color: var(--text-dark);
    border-color: var(--gray-300);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.google-mark {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #4285f4;
    background: #fff;
    border: 1px solid var(--gray-100);
    font-family: Arial, sans-serif;
    font-size: 16px;
    font-weight: 700;
}

/* ─── Responsive ─── */
@media screen and (max-width: 800px) {
    .brand-panel { display: none; }
    .form-panel { background: linear-gradient(160deg, #0d1b2a, #1a3553); }
    .form-container {
        background: var(--white);
        border-radius: 20px;
        padding: 36px 28px;
        box-shadow: var(--shadow-lg);
    }
}

@media screen and (max-width: 480px) {
    .form-panel {
        min-height: 100dvh;
        padding: 24px 16px;
    }
    .form-container { padding: 28px 20px; }
    .form-header h2 { font-size: 24px; }
    .auth-tabs { gap: 3px; }
    .tab-btn {
        padding: 10px 8px;
        font-size: 12px;
        gap: 5px;
        white-space: nowrap;
    }
    .pin-input {
        font-size: 18px !important;
        letter-spacing: .18em;
    }
    .numpad-grid {
        max-width: 260px;
        gap: 8px;
    }
    .num-key { padding: 14px 8px; }
}

@media screen and (max-width: 360px) {
    .form-panel { padding: 16px 12px; }
    .form-container { padding: 24px 16px; }
    .auth-tabs { flex-direction: column; }
}
