/* Login xecodex — plantilla original (sistema_matricula) */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body.login-page {
    height: 100%;
    overflow: hidden;
    scrollbar-width: none;
}

body.login-page::-webkit-scrollbar {
    display: none;
    width: 0;
}

body.login-page {
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    font-size: 13px;
}

/* ── Fondo morado + partículas ── */
.login-bg {
    position: fixed;
    inset: 0;
    background: var(--savia-gradient, linear-gradient(135deg, #0a58ca 0%, #6366f1 42%, #cd0bae 100%));
    z-index: 0;
}

.login-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    animation: particleFloat 14s infinite ease-in-out;
    box-shadow: 0 0 18px rgba(255, 255, 255, 0.08);
}

@keyframes particleFloat {
    0%, 100% { transform: translate(0, 0); opacity: 0.35; }
    50%      { transform: translate(0, -80px); opacity: 0.55; }
}

/* ── Centrado ── */
.login-wrapper {
    position: relative;
    z-index: 1;
    height: 100vh;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    display: flex;
    width: 100%;
    max-width: 820px;
    height: min(580px, calc(100dvh - 32px));
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
    overflow: hidden;
    animation: slideIn 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(30px) scale(0.97); }
    to   { opacity: 1; transform: none; }
}

/* ── Panel izquierdo ── */
.login-left {
    flex: 1;
    background: var(--savia-gradient-v, linear-gradient(180deg, #0a58ca 0%, #6366f1 48%, #cd0bae 100%));
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.login-left::before {
    content: '';
    position: absolute;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(255,255,255,0.14) 0%, transparent 70%);
    border-radius: 50%;
    top: -100px;
    right: -100px;
    pointer-events: none;
}

.login-left::after {
    content: '';
    position: absolute;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
    bottom: -60px;
    left: -60px;
    pointer-events: none;
}

.login-left-inner {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 28px 24px 18px;
    color: #fff;
}

.login-left-text {
    text-align: center;
    flex-shrink: 0;
}

.login-left-text h2 {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.login-left-text p {
    font-size: 0.78rem;
    font-weight: 300;
    line-height: 1.55;
    opacity: 0.95;
    max-width: 280px;
    margin: 0 auto;
}

.login-features {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0 4px;
}

.login-features span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.62rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    padding: 4px 9px;
    border-radius: 999px;
}

.login-features i { font-size: 0.58rem; opacity: 0.9; }

.savia-logo-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.savia-logo-block--form { margin-bottom: 6px; }

.savia-logo-img {
    height: 34px;
    width: auto;
    display: block;
}

.savia-logo-img--sm { height: 26px; }

.savia-logo-block--light .savia-tag { margin-top: 0; }

.login-help-box {
    text-align: center;
    margin-top: 2px;
}

.login-help-box p {
    font-size: 0.65rem;
    color: #6b7280;
    margin-bottom: 8px;
    line-height: 1.45;
}

.login-help-btns {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.help-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.help-btn:hover { transform: translateY(-1px); }

.help-btn-whatsapp {
    background: #25d366;
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
}

.help-btn-whatsapp:hover {
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.45);
    color: #fff;
}

.help-btn-phone {
    background: rgba(99, 102, 241, 0.08);
    color: var(--savia-primary, #0a58ca);
    border: 1px solid rgba(99, 102, 241, 0.22);
}

.help-btn-phone:hover {
    background: rgba(99, 102, 241, 0.14);
    color: var(--savia-primary-dark, #4f46e5);
}

.savia-brand-row--form {
    margin-bottom: 6px;
}

.login-inst-name {
    font-size: 0.72rem;
    font-weight: 500;
    color: #6b7280;
    margin: -6px 0 10px;
}

.login-secure-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 0.68rem;
    font-weight: 500;
    color: #059669;
}

.login-secure-note i { font-size: 0.62rem; }

.login-savia-version {
    text-align: center;
    margin: 8px 0 0;
}

.login-savia-version .savia-tag--light {
    font-size: 0.58rem;
    letter-spacing: 0.04em;
    text-transform: none;
}

.login-left-image {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    min-height: 0;
    margin: 4px -20px -12px;
    overflow: visible;
}

.login-left-image img {
    width: 100%;
    max-width: 280px;
    max-height: 100%;
    object-fit: contain;
    object-position: bottom center;
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.2));
    pointer-events: none;
}

.footer-left {
    flex-shrink: 0;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.22);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.footer-left > i {
    color: rgba(255, 255, 255, 0.9);
    font-size: 11px;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    15%, 35% { transform: scale(1.12); }
}

.footer-left-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 9px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.4;
}

.footer-left-text a {
    color: #fff;
    font-weight: 700;
    font-size: 10px;
    text-decoration: none;
}

.footer-left-text a:hover { text-decoration: underline; }

/* ── Panel derecho ── */
.login-right {
    flex: 1;
    min-height: 0;
    padding: 22px 32px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #fff;
    overflow: hidden;
}

.login-right::-webkit-scrollbar {
    display: none;
    width: 0;
}

.logo-container {
    text-align: center;
    margin-bottom: 14px;
}

.logo-img {
    width: auto;
    max-width: 120px;
    max-height: 60px;
    object-fit: contain;
    margin-bottom: 10px;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.06));
}

.logo-fallback {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, #ede9fe, #e0e7ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #cd0bae;
}

.logo-container h1 {
    font-size: 1.2rem;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.logo-container p {
    color: #6b7280;
    font-size: 0.78rem;
    font-weight: 400;
}

.login-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    font-size: 0.75rem;
    margin-bottom: 14px;
}

/* ── Formulario ── */
.login-form { width: 100%; }

.input-group {
    position: relative;
    margin-bottom: 10px;
}

.input-group input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.82rem;
    font-family: inherit;
    font-weight: 400;
    background: #f9fafb;
    color: #1f2937;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
    -webkit-appearance: none;
}

.input-group input::placeholder {
    color: #9ca3af;
}

.input-group input:hover {
    border-color: #d1d5db;
    background: #fff;
}

.input-group input:focus {
    outline: none;
    border-color: #cd0bae;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.12);
}

.input-group > .input-icon-left,
.input-group > i.input-icon-left {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #cd0bae;
    font-size: 14px;
    pointer-events: none;
    z-index: 1;
}

.forgot-password {
    text-align: right;
    margin-bottom: 0;
}

.login-options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.staff-login-hint { display: none !important; }
.staff-prefer-row { display: none !important; }

.remember-me {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: #64748b;
    cursor: pointer;
    user-select: none;
}

.remember-me input {
    accent-color: #cd0bae;
    width: 14px;
    height: 14px;
}

.login-container--single {
    min-height: auto;
    padding: 2rem 1rem;
}

.forgot-password a {
    color: #cd0bae;
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 500;
}

.forgot-password a:hover {
    color: #6366f1;
    text-decoration: underline;
}

.login-button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    background: var(--savia-gradient, linear-gradient(135deg, #0a58ca 0%, #6366f1 42%, #cd0bae 100%));
    box-shadow: 0 6px 18px rgba(139, 92, 246, 0.38);
    transition: transform 0.25s, box-shadow 0.25s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(139, 92, 246, 0.42);
}

.login-button.loading {
    pointer-events: none;
    opacity: 0.85;
}

.divider {
    text-align: center;
    margin-top: 12px;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: #e5e7eb;
}

.divider span {
    background: #fff;
    padding: 0 10px;
    position: relative;
    font-size: 0.72rem;
    color: #9ca3af;
    font-weight: 500;
}

.divider a {
    color: #9ca3af;
    font-size: 0.72rem;
    font-weight: 500;
    text-decoration: none;
}

.divider a:hover { color: #cd0bae; }

/* ── Responsive ── */
@media (max-width: 768px) {
    html, body.login-page { overflow: auto; }

    .login-wrapper {
        height: auto;
        min-height: 100dvh;
        padding: 16px;
    }

    .login-container {
        flex-direction: column;
        height: auto;
        max-height: none;
    }

    .login-right { order: 1; padding: 28px 24px; }

    .login-left {
        order: 2;
        min-height: 280px;
    }

    .login-left-inner { padding: 22px 20px 16px; }

    .login-left-image {
        margin: 0 -10px -8px;
        max-height: 200px;
    }

    .login-left-image img { max-width: 220px; }

    .input-group input { font-size: 16px; }
}

@media (max-height: 560px) and (min-width: 769px) {
    .login-left-text p { display: none; }
    .login-left-image { margin-bottom: -16px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; }
}

/* ── Extensiones Mi Perú (tabs, paso 2) ── */
.login-role-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    padding: 4px;
    background: #f3f4f6;
    border-radius: 10px;
}

.login-role-tabs button {
    flex: 1;
    padding: 8px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.login-role-tabs button.is-active,
.login-role-tabs button.is-on {
    background: #fff;
    color: #cd0bae;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.login-panel-form { display: none; }
.login-panel-form.is-visible { display: block; }

.input-group--toggle input { padding-right: 46px; }

.input-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #cd0bae;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    opacity: 0.85;
    pointer-events: auto;
}

.input-toggle i {
    position: static !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    pointer-events: none;
    color: inherit;
    font-size: inherit;
}

.input-toggle:hover {
    opacity: 1;
    background: rgba(205, 11, 174, 0.08);
}

.login-step-name {
    font-size: 0.78rem;
    font-weight: 400;
    color: #6b7280;
    margin: -4px 0 12px;
}

/* Crédito desarrollador */
.dev-credit-btn {
    display: inline;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    color: #fff;
    font: inherit;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.dev-credit-btn:hover { opacity: 0.9; }

.dev-credit-btn strong {
    font-weight: 800;
}

/* Modal desarrollador */
.dev-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.dev-modal[hidden] { display: none !important; }

.dev-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
}

.dev-modal__card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 360px;
    background: #fff;
    border-radius: 18px;
    padding: 28px 24px 22px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    animation: slideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.dev-modal__close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.dev-modal__close:hover {
    background: #e5e7eb;
    color: #111;
}

.dev-modal__avatar {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 18px;
    background: var(--savia-gradient, linear-gradient(135deg, #0a58ca, #cd0bae));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.dev-modal__card h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #111;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.dev-modal__role {
    font-size: 0.78rem;
    font-weight: 600;
    color: #cd0bae;
    margin-bottom: 10px;
}

.dev-modal__desc {
    font-size: 0.78rem;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 18px;
}

.dev-modal__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dev-modal__actions .help-btn {
    justify-content: center;
    width: 100%;
}

.dev-modal__ver {
    margin-top: 14px;
    font-size: 0.65rem;
    color: #9ca3af;
}

