/* Login del panel administrativo — misma plantilla visual del Aula Virtual */
:root {
    --adm-navy: #0b1f4a;
    --adm-primary: #1e3a8a;
    --adm-primary-dark: #1e40af;
    --adm-accent: #2563eb;
    --adm-sky: #0ea5e9;
    --adm-gradient: linear-gradient(135deg, #0b1f4a 0%, #1e3a8a 42%, #2563eb 100%);
    --adm-gradient-v: linear-gradient(180deg, #1e3a8a 0%, #2563eb 48%, #0ea5e9 100%);
    --adm-ink: #1f2937;
    --adm-muted: #6b7280;
}

*, *::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', system-ui, -apple-system, sans-serif;
    font-size: 13px;
    color: var(--adm-ink);
    -webkit-font-smoothing: antialiased;
}

/* ── Fondo azul + partículas ── */
.login-bg {
    position: fixed;
    inset: 0;
    background: var(--adm-gradient);
    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: 860px;
    height: min(600px, 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;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--adm-gradient-v);
}

.login-left::before,
.login-left::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.login-left::before {
    width: 320px; height: 320px;
    top: -100px; right: -100px;
    background: radial-gradient(circle, rgba(255,255,255,0.14) 0%, transparent 70%);
}

.login-left::after {
    width: 240px; height: 240px;
    bottom: -60px; left: -60px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
}

.login-left-inner {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 26px 24px 16px;
    color: #fff;
}

.brand-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    margin-bottom: 12px;
}

.brand-word {
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}

.brand-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.14);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.login-left-text { text-align: center; flex-shrink: 0; }

.login-left-text h2 {
    font-size: 1.32rem;
    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.76rem;
    font-weight: 300;
    line-height: 1.55;
    opacity: 0.95;
    max-width: 285px;
    margin: 0 auto;
}

.login-features {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0 4px;
}

.login-features span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    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 svg { width: 11px; height: 11px; opacity: 0.9; }

.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;
    user-select: 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 > svg {
    width: 12px;
    height: 12px;
    color: rgba(255, 255, 255, 0.9);
    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;
}

.dev-credit-btn {
    display: inline;
    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; }

/* ── Panel derecho ── */
.login-right {
    flex: 1;
    min-height: 0;
    padding: 22px 32px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #fff;
    overflow-y: auto;
    scrollbar-width: none;
}

.login-right::-webkit-scrollbar { display: none; width: 0; }

.logo-container { text-align: center; margin-bottom: 14px; }

.logo-img {
    width: auto;
    max-width: 150px;
    max-height: 58px;
    object-fit: contain;
    margin-bottom: 8px;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.06));
}

.login-inst-name {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--adm-muted);
    margin: 0 0 10px;
    line-height: 1.4;
}

.logo-container h1 {
    font-size: 1.2rem;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.logo-container > p:last-child {
    color: var(--adm-muted);
    font-size: 0.76rem;
    font-weight: 400;
}

.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.45;
    margin-bottom: 14px;
}

.login-alert svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 1px; }

.login-alert--ok {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #059669;
}

/* ── 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: var(--adm-ink);
    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: var(--adm-accent);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.input-icon-left {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    color: var(--adm-accent);
    pointer-events: none;
    z-index: 1;
}

.input-group--toggle input { padding-right: 46px; }

.input-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--adm-accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
}

.input-toggle svg { width: 16px; height: 16px; pointer-events: none; }

.input-toggle:hover { opacity: 1; background: rgba(37, 99, 235, 0.08); }

.input-toggle .icon-off { display: none; }
.input-toggle.is-on .icon-on { display: none; }
.input-toggle.is-on .icon-off { display: block; }

.login-options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.caps-hint {
    display: none;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    font-weight: 600;
    color: #c2410c;
}

.caps-hint.is-on { display: inline-flex; }

.forgot-password a {
    color: var(--adm-accent);
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 500;
}

.forgot-password a:hover { color: var(--adm-primary); 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(--adm-gradient);
    box-shadow: 0 6px 18px rgba(30, 58, 138, 0.34);
    transition: transform 0.25s, box-shadow 0.25s, opacity 0.25s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-button svg { width: 15px; height: 15px; }

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(30, 58, 138, 0.42);
}

.login-button:disabled {
    pointer-events: none;
    opacity: 0.82;
    transform: none;
}

.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 svg { width: 11px; height: 11px; }

.login-version { text-align: center; margin: 8px 0 0; }

.login-version span {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: var(--adm-primary);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.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;
}

.login-help-box { text-align: center; margin-top: 10px; }

.login-help-box p {
    font-size: 0.65rem;
    color: var(--adm-muted);
    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, background 0.2s;
    font-family: inherit;
}

.help-btn svg { width: 13px; height: 13px; }

.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(37, 99, 235, 0.08);
    color: var(--adm-primary);
    border: 1px solid rgba(37, 99, 235, 0.22);
}

.help-btn-phone:hover { background: rgba(37, 99, 235, 0.14); color: var(--adm-primary-dark); }

/* ── 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: var(--adm-muted);
    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(--adm-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dev-modal__avatar svg { width: 26px; height: 26px; }

.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: var(--adm-accent);
    margin-bottom: 10px;
}

.dev-modal__desc {
    font-size: 0.78rem;
    color: var(--adm-muted);
    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; }

/* ── 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: 300px; }

    .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: 620px) 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; }
}
