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

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    min-height: 100vh;
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.login-shell {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    width: 100%;
    max-width: 980px;
    min-height: 560px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(59, 130, 246, 0.25);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

@media (max-width: 760px) {
    .login-shell { grid-template-columns: 1fr; min-height: auto; }
}

/* ── Brand panel (izquierda) ──────────────────────────── */
.brand-panel {
    position: relative;
    background: linear-gradient(160deg, #1e293b 0%, #0f172a 70%);
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.gear {
    position: absolute;
    opacity: 0.08;
    color: #3b82f6;
    pointer-events: none;
}

.gear-1 { width: 260px; height: 260px; top: -60px; right: -60px; animation: spin 40s linear infinite; }
.gear-2 { width: 160px; height: 160px; bottom: 10%; left: -40px; animation: spin-rev 30s linear infinite; }
.gear-3 { width: 100px; height: 100px; bottom: 40px; right: 10%; animation: spin 25s linear infinite; }

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes spin-rev { from { transform: rotate(360deg); } to { transform: rotate(0deg); } }

@media (prefers-reduced-motion: reduce) {
    .gear { animation: none; }
}

.brand-top { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }

.brand-icon {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
    flex-shrink: 0;
}

.brand-logo-img {
    height: 56px;
    width: auto;
    border-radius: 8px;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.mobile-brand-logo-img {
    height: 64px;
    width: auto;
    border-radius: 8px;
    display: block;
    margin: 0 auto 10px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.brand-title { font-size: 15px; font-weight: 700; color: white; line-height: 1.3; }
.brand-title span { display: block; font-size: 11px; color: #94a3b8; font-weight: 500; margin-top: 2px; }

.brand-hero { position: relative; z-index: 1; margin-top: 2rem; }
.brand-hero h1 { font-size: 28px; font-weight: 700; color: white; line-height: 1.25; margin-bottom: 12px; }
.brand-hero h1 em { font-style: normal; color: #60a5fa; }
.brand-hero p { font-size: 13.5px; color: #94a3b8; line-height: 1.6; max-width: 320px; }

.feature-row { position: relative; z-index: 1; display: flex; gap: 20px; margin-top: 2rem; flex-wrap: wrap; }
.feature-item { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }

.feature-icon {
    width: 36px; height: 36px; border-radius: 10px;
    background: rgba(59, 130, 246, 0.12); border: 1px solid rgba(59, 130, 246, 0.3);
    display: flex; align-items: center; justify-content: center; color: #60a5fa;
}

.feature-item span { font-size: 11px; color: #cbd5e1; font-weight: 600; }

.brand-footer { position: relative; z-index: 1; font-size: 11px; color: #475569; }

@media (max-width: 760px) {
    .brand-panel { display: none; }
}

/* ── Form panel (derecha) ─────────────────────────────── */
.form-panel {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.06) 0%, rgba(30, 58, 138, 0.12) 100%);
    padding: 2.5rem 2.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mobile-brand { display: none; text-align: center; margin-bottom: 1.5rem; }
@media (max-width: 760px) {
    .mobile-brand { display: block; }
}

.welcome h2 { color: white; font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.welcome p { color: #94a3b8; font-size: 13px; margin-bottom: 1.75rem; }

/* ── Alerts ────────────────────────────────────────────── */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.alert-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

.alert-info {
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #93c5fd;
}

.alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }

/* ── Form ──────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }

.form-group label {
    display: block;
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.input-wrapper { position: relative; }

.input-wrapper svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #64748b;
    pointer-events: none;
}

.form-control {
    width: 100%;
    padding: 12px 16px 12px 40px;
    background: rgba(15, 23, 42, 0.6);
    border: 1.5px solid rgba(59, 130, 246, 0.4);
    border-radius: 10px;
    color: white;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
}

.form-control::placeholder { color: #64748b; }

.form-control:focus {
    outline: none;
    background: rgba(15, 23, 42, 0.9);
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.form-control.is-invalid {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.show-password {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 12px;
    color: #94a3b8;
    cursor: pointer;
}

.btn-submit {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 18px rgba(59, 130, 246, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(59, 130, 246, 0.4);
}

.btn-submit:active { transform: translateY(0); }

.login-footer-note {
    text-align: center;
    font-size: 11px;
    color: #64748b;
    margin-top: 1.5rem;
    line-height: 1.6;
}
