/* ============================================
   LOGIN PORTAFOLIO ERP
   ============================================ */
.pe-login {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    font-family: 'Manrope', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #0a0f1e;
    position: relative;
    overflow: hidden;
    color: #e2e8f0;
}

/* ============================================
   FONDO ANIMADO
   ============================================ */
.pe-login-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.pe-login-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 75% 65% at 50% 40%, #000 25%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 40%, #000 25%, transparent 80%);
}

.pe-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    will-change: transform;
}

.pe-orb-1 {
    width: 520px;
    height: 520px;
    background: rgba(99, 102, 241, 0.45);
    top: -180px;
    left: -120px;
}

.pe-orb-2 {
    width: 420px;
    height: 420px;
    background: rgba(139, 92, 246, 0.35);
    bottom: -140px;
    right: -100px;
}

.pe-orb-3 {
    width: 300px;
    height: 300px;
    background: rgba(34, 211, 238, 0.18);
    top: 45%;
    left: 55%;
}

.pe-login-stars {
    position: absolute;
    inset: 0;
}

.pe-login-stars span {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: rgba(165, 180, 252, 0.9);
    box-shadow: 0 0 6px rgba(165, 180, 252, 0.9);
    opacity: 0;
    animation: pe-star-twinkle linear infinite;
}

@keyframes pe-star-twinkle {
    0%, 100% { opacity: 0; transform: scale(0.6); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* ============================================
   LAYOUT 2 COLUMNAS
   ============================================ */
.pe-login-wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1120px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 4.5rem;
    align-items: center;
}

/* ============================================
   PANEL DE MARCA
   ============================================ */
.pe-brand { display: flex; flex-direction: column; gap: 1.4rem; }

.pe-brand-badge {
    display: inline-flex; align-items: center; gap: .55rem; width: fit-content;
    padding: .4rem .9rem; border-radius: 999px;
    font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
    color: #a5b4fc; background: rgba(99,102,241,.1); border: 1px solid rgba(129,140,248,.3);
}
.pe-brand-badge i {
    width: 7px; height: 7px; border-radius: 50%; background: #34d399;
    box-shadow: 0 0 10px #34d399;
}

.pe-brand h2 {
    font-family: 'Sora', sans-serif; font-weight: 800; color: #fff; margin: 0;
    font-size: clamp(2rem, 3.4vw, 3.1rem); line-height: 1.08; letter-spacing: -.04em;
}
.pe-brand h2 span {
    background: linear-gradient(120deg, #818cf8, #22d3ee);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.pe-brand p { margin: 0; max-width: 520px; color: #94a3b8; font-size: 1.02rem; line-height: 1.7; }

.pe-brand-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; max-width: 540px; }
.pe-brand-item {
    display: flex; align-items: center; gap: .7rem; padding: .65rem .8rem;
    border-radius: 12px; font-size: .84rem; font-weight: 700; color: #e2e8f0;
    background: rgba(15,23,41,.65); border: 1px solid rgba(148,163,184,.12);
    transition: border-color .2s ease, transform .2s ease;
}
.pe-brand-item:hover { border-color: rgba(129,140,248,.45); transform: translateY(-2px); }
.pe-brand-item svg {
    width: 32px; height: 32px; padding: 7px; flex-shrink: 0; border-radius: 9px;
    background: rgba(99,102,241,.18); color: #a5b4fc;
    fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.pe-brand-stats { display: flex; gap: 2.2rem; padding-top: .4rem; }
.pe-brand-stats b { display: block; font-family: 'Sora', sans-serif; font-size: 1.6rem; color: #fff; letter-spacing: -.03em; }
.pe-brand-stats span { font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #64748b; }

.pe-brand-help { font-size: .84rem; color: #94a3b8; text-decoration: none; width: fit-content; }
.pe-brand-help strong { color: #4ade80; }
.pe-brand-help:hover strong { color: #86efac; }

/* ============================================
   TARJETA
   ============================================ */
.pe-login-card {
    width: 100%;
    max-width: 420px;
    justify-self: end;
    position: relative;
    background: #081329;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 20px;
    box-shadow:
        0 25px 60px -20px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset,
        0 1px 0 rgba(255, 255, 255, 0.06) inset;
    overflow: hidden;
    isolation: isolate;
}

.pe-login-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
        400px circle at var(--gx, 50%) var(--gy, 50%),
        rgba(99, 102, 241, 0.12),
        transparent 60%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 0;
}

.pe-login-card:hover::before {
    opacity: 1;
}

/* Header compacto: logo a la izquierda, título y subtítulo al lado */
.pe-login-card-header {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: .9rem;
    align-items: center;
    text-align: left;
    padding: 1.1rem 1.5rem;
    overflow: hidden;
    background:
        radial-gradient(ellipse 80% 100% at 50% 0%, rgba(79, 70, 229, 0.18) 0%, transparent 70%),
        linear-gradient(180deg, rgba(79, 70, 229, 0.06) 0%, transparent 100%);
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    isolation: isolate;
}

.pe-login-card-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -30%;
    width: 60%;
    height: 200%;
    background: radial-gradient(ellipse at center,
        rgba(99, 102, 241, 0.35) 0%,
        rgba(99, 102, 241, 0.12) 35%,
        transparent 70%);
    filter: blur(40px);
    animation: pe-aurora-1 12s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes pe-aurora-1 {
    0%, 100% { transform: translateX(0) translateY(0) scale(1); opacity: 0.7; }
    50% { transform: translateX(120%) translateY(-10%) scale(1.2); opacity: 1; }
}

.pe-login-card-header::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 55%;
    height: 200%;
    background: radial-gradient(ellipse at center,
        rgba(139, 92, 246, 0.30) 0%,
        rgba(139, 92, 246, 0.10) 40%,
        transparent 70%);
    filter: blur(45px);
    animation: pe-aurora-2 15s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes pe-aurora-2 {
    0%, 100% { transform: translateX(0) translateY(0) scale(1); opacity: 0.6; }
    50% { transform: translateX(-130%) translateY(10%) scale(1.15); opacity: 0.95; }
}

.pe-login-card-header .pe-login-dots {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.pe-login-card-header .pe-login-dots span {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(165, 180, 252, 0.9);
    box-shadow: 0 0 8px rgba(165, 180, 252, 0.8);
    animation: pe-dot-float linear infinite;
    opacity: 0;
}

.pe-login-card-header .pe-login-dots span:nth-child(1) { left: 12%; top: 75%; animation-duration: 9s; animation-delay: 0s; }
.pe-login-card-header .pe-login-dots span:nth-child(2) { left: 28%; top: 40%; animation-duration: 11s; animation-delay: 1.5s; width: 2px; height: 2px; }
.pe-login-card-header .pe-login-dots span:nth-child(3) { left: 50%; top: 60%; animation-duration: 10s; animation-delay: 3s; }
.pe-login-card-header .pe-login-dots span:nth-child(4) { left: 72%; top: 30%; animation-duration: 13s; animation-delay: 0.8s; width: 2px; height: 2px; }
.pe-login-card-header .pe-login-dots span:nth-child(5) { left: 88%; top: 70%; animation-duration: 12s; animation-delay: 2.2s; }
.pe-login-card-header .pe-login-dots span:nth-child(6) { left: 40%; top: 85%; animation-duration: 14s; animation-delay: 4s; width: 2px; height: 2px; }

@keyframes pe-dot-float {
    0% { transform: translateY(20px) scale(0.5); opacity: 0; }
    15% { opacity: 0.9; }
    85% { opacity: 0.9; }
    100% { transform: translateY(-70px) scale(1); opacity: 0; }
}

.pe-login-card-header .pe-login-scan {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        transparent 30%,
        rgba(129, 140, 248, 0.9) 50%,
        transparent 70%,
        transparent 100%);
    animation: pe-scan 5s ease-in-out infinite;
    z-index: 2;
    pointer-events: none;
    box-shadow:
        0 0 12px rgba(129, 140, 248, 0.7),
        0 0 24px rgba(129, 140, 248, 0.4);
}

@keyframes pe-scan {
    0%, 100% { transform: translateX(-100%); opacity: 0; }
    50% { transform: translateX(100%); opacity: 1; }
}

.pe-login-card-header > .pe-login-logo,
.pe-login-card-header > .pe-login-card-title,
.pe-login-card-header > .pe-login-card-subtitle {
    position: relative;
    z-index: 3;
}

.pe-login-logo {
    grid-row: 1 / 3;
    width: 46px;
    height: 46px;
    margin: 0;
    padding: 8px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.25), rgba(139, 92, 246, 0.15));
    border: 1px solid rgba(129, 140, 248, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 8px 20px -8px rgba(79, 70, 229, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.pe-login-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pe-login-card-title {
    font-size: 1.1rem;
    margin: 0;
    align-self: end;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: #ffffff;
    text-transform: uppercase;
    line-height: 1.2;
}

.pe-login-card-subtitle {
    font-size: .68rem;
    align-self: start;
    font-weight: 500;
    letter-spacing: 0.15em;
    color: #64748b;
    margin: 0;
    text-transform: uppercase;
}

/* ============================================
   CUERPO DE LA TARJETA
   ============================================ */
.pe-login-card-body {
    padding: 1.35rem 1.5rem 1.4rem;
    position: relative;
    z-index: 1;
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(148,163,184,.25) transparent;
}

.pe-login-card-body::-webkit-scrollbar { width: 6px; }
.pe-login-card-body::-webkit-scrollbar-thumb { background: rgba(148,163,184,.25); border-radius: 3px; }

.pe-login-form-title {
    text-align: center;
    font-size: .85rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #cbd5e1;
    margin: 0 0 1.1rem 0;
    text-transform: uppercase;
}

.pe-login-alert {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 0.875rem;
    margin-bottom: 1.25rem;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 10px;
    color: #fca5a5;
    font-size: 0.8125rem;
    font-weight: 500;
}

.pe-login-alert svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ============================================
   CAMPOS
   ============================================ */
.pe-login-field {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    margin-bottom: .85rem;
}

.pe-login-field label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #cbd5e1;
    margin: 0;
}

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

.pe-login-input-wrap::before {
    content: '';
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.55;
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.2s ease;
}

.pe-login-input-wrap.pe-icon-mail::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z'/%3E%3Cpolyline points='22,6 12,13 2,6'/%3E%3C/svg%3E");
}

.pe-login-input-wrap.pe-icon-lock::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Crect x='3' y='11' width='18' height='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
}

.pe-login-input-wrap input,
.pe-login-input-wrap select {
    width: 100%;
    padding: .7rem 1rem .7rem 2.625rem;
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 400;
    color: #f1f5f9;
    background: rgba(2, 6, 23, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 10px;
    outline: none;
    transition: all 0.2s ease;
    margin: 0;
}

.pe-login-input-wrap input::placeholder {
    color: #64748b;
}

.pe-login-input-wrap input:hover,
.pe-login-input-wrap select:hover {
    border-color: rgba(148, 163, 184, 0.25);
    background: rgba(2, 6, 23, 0.6);
}

.pe-login-input-wrap input:focus,
.pe-login-input-wrap select:focus {
    background: rgba(2, 6, 23, 0.8);
    border-color: rgba(129, 140, 248, 0.6);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.pe-login-input-wrap:focus-within::before {
    opacity: 0.9;
}

/* Inputs sin ícono (registro): sin hueco a la izquierda */
.pe-login-input-wrap:not(.pe-icon-mail):not(.pe-icon-lock) input,
.pe-login-input-wrap select {
    padding-left: 1rem;
}

.pe-login-input-wrap select {
    padding-right: 1rem;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .875rem center;
    background-size: 16px;
}

.pe-login-input-wrap input:-webkit-autofill,
.pe-login-input-wrap input:-webkit-autofill:hover,
.pe-login-input-wrap input:-webkit-autofill:focus {
    -webkit-text-fill-color: #f1f5f9;
    -webkit-box-shadow: 0 0 0 1000px rgba(2, 6, 23, 0.8) inset;
    transition: background-color 5000s ease-in-out 0s;
    caret-color: #f1f5f9;
}

.pe-login-toggle-pass {
    position: absolute;
    right: 0.625rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    z-index: 2;
    padding: 0;
    margin: 0;
}

.pe-login-toggle-pass:hover {
    background: rgba(148, 163, 184, 0.1);
    color: #cbd5e1;
}

.pe-login-toggle-pass svg {
    width: 16px;
    height: 16px;
}

.pe-login-field-error {
    font-size: 0.75rem;
    color: #fca5a5;
    margin: 0;
}

/* ============================================
   BOTONES
   ============================================ */
.pe-login-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: .75rem 1.25rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    font-family: inherit;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #ffffff;
    background: linear-gradient(180deg, #6366f1 0%, #4f46e5 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.15) inset,
        0 8px 20px -6px rgba(79, 70, 229, 0.5);
    transition: all 0.2s ease;
}

.pe-login-submit::after {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,0.3), transparent);
    transform: skewX(-20deg);
    transition: left 0.7s ease;
}

.pe-login-submit:hover:not(:disabled)::after {
    left: 140%;
}

.pe-login-submit:hover:not(:disabled) {
    background: linear-gradient(180deg, #4f46e5 0%, #4338ca 100%);
    transform: translateY(-1px);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.15) inset,
        0 12px 28px -6px rgba(79, 70, 229, 0.6);
}

.pe-login-submit:active:not(:disabled) {
    transform: translateY(0);
}

.pe-login-submit:disabled {
    opacity: 0.85;
    cursor: wait;
}

.pe-login-submit svg {
    width: 15px;
    height: 15px;
    transition: transform 0.2s ease;
}

.pe-login-submit:hover:not(:disabled) svg {
    transform: translateX(2px);
}

.pe-login-submit-secondary {
    background: transparent;
    box-shadow: none;
    color: #cbd5e1;
    border: 1px solid rgba(148,163,184,.25);
    text-transform: none;
    font-weight: 600;
    letter-spacing: 0;
    font-size: 0.8125rem;
}

.pe-login-submit-secondary:hover:not(:disabled) {
    background: rgba(148,163,184,.1);
    box-shadow: none;
    transform: none;
    color: #cbd5e1;
    border-color: rgba(148,163,184,.4);
}

.pe-login-btn-square {
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    margin: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 8px;
}

.pe-login-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: pe-login-spin 0.7s linear infinite;
    display: inline-block;
}

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

/* ============================================
   REGISTRO: fila login
   ============================================ */
.pe-login-register-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    margin-top: 1.25rem;
    font-size: 0.8125rem;
    color: #94a3b8;
}

.pe-login-register-row a {
    color: #a5b4fc;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s ease;
}

.pe-login-register-row a:hover {
    color: #c7d2fe;
}

/* ============================================
   PANELES
   ============================================ */
.pe-login-panel { display: none; }
.pe-login-panel.active { display: block; }

/* ============================================
   REGISTRO: filas y archivo
   ============================================ */
.pe-login-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}

.pe-login-file {
    display: block;
    text-align: center;
    cursor: pointer;
    padding: 1.1rem;
    margin-bottom: .6rem;
    border: 1.5px dashed rgba(129,140,248,.4);
    border-radius: 12px;
    background: rgba(79,70,229,.06);
    color: #cbd5e1;
    font-size: .85rem;
    font-weight: 600;
    transition: all .2s ease;
    line-height: 1.5;
}

.pe-login-file:hover {
    border-color: #818cf8;
    background: rgba(79,70,229,.12);
}

.pe-login-file input { display: none; }

.pe-login-file small {
    display: block;
    margin-top: .25rem;
    color: #64748b;
    font-weight: 500;
}

.pe-login-hr {
    border: none;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
    margin: 1rem 0;
}

.pe-login-duration {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    color: #cbd5e1;
    font-size: 0.875rem;
}

.pe-login-duration-ctrl {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pe-login-duration-ctrl input {
    width: 60px;
    text-align: center;
    background: rgba(2, 6, 23, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 8px;
    color: #f1f5f9;
    padding: 0.4rem;
    font-size: 0.875rem;
    font-family: inherit;
    outline: none;
}

.pe-login-total-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    color: #cbd5e1;
    font-size: 0.875rem;
}

.pe-login-total-row strong {
    color: #f1f5f9;
}

.pe-login-total-pagar {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: rgba(79, 70, 229, 0.1);
    border: 1px solid rgba(129, 140, 248, 0.2);
    border-radius: 10px;
    margin-top: 0.5rem;
    align-items: center;
}

.pe-login-total-pagar span {
    font-weight: 700;
    color: #a5b4fc;
    font-size: 0.8125rem;
    letter-spacing: 0.05em;
}

.pe-login-total-pagar strong {
    color: #ffffff;
    font-size: 1.125rem;
    font-weight: 800;
}

/* ============================================
   VERSIÓN
   ============================================ */
.pe-login-version {
    text-align: center;
    font-size: 0.6875rem;
    color: #475569;
    letter-spacing: 0.1em;
    margin: .8rem 0 0 0;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1000px) {
    .pe-login-wrap {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        max-width: 440px;
    }
    .pe-login-card { justify-self: center; order: -1; }
    .pe-brand-stats { gap: 1.5rem; }
}

@media (max-width: 560px) {
    .pe-login { padding: 1.25rem 1rem; }
    .pe-brand-grid, .pe-brand-stats { display: none; }
    .pe-login-card-body { max-height: none; }
    .pe-login-row { grid-template-columns: 1fr; }

    .pe-orb-1 { width: 340px; height: 340px; }
    .pe-orb-2 { width: 280px; height: 280px; }
    .pe-orb-3 { width: 220px; height: 220px; }
}

@media (prefers-reduced-motion: reduce) {
    .pe-login-card-header::before,
    .pe-login-card-header::after,
    .pe-login-card-header .pe-login-dots span,
    .pe-login-card-header .pe-login-scan,
    .pe-login-stars span,
    .pe-orb {
        animation: none !important;
    }

    .pe-login-card-header .pe-login-scan,
    .pe-login-card-header .pe-login-dots,
    .pe-login-stars {
        display: none;
    }
}

/* ============ STEPPER ============ */
.pe-login-stepper {
    display: flex;
    margin: 0 0 1.4rem;
}
.pe-login-step {
    position: relative;
    flex: 1;
    text-align: center;
    opacity: 1;                      /* antes 0.5: causaba la transparencia */
}
/* conector entre círculos (queda detrás y no pisa los números) */
.pe-login-step:not(:first-child)::before {
    content: '';
    position: absolute;
    top: 13px;
    left: calc(-50% + 18px);
    width: calc(100% - 36px);
    height: 2px;
    border-radius: 2px;
    background: rgba(148, 163, 184, .18);
    transition: background .3s ease;
}
.pe-login-step.done::before,
.pe-login-step.active::before {
    background: linear-gradient(90deg, #10b981, #6366f1);
}
.pe-login-step-circle {
    position: relative;
    z-index: 1;
    width: 28px; height: 28px;
    margin: 0 auto .35rem;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .74rem; font-weight: 800;
    color: #64748b;
    background: #0f1b36;             /* sólido, sin transparencia */
    border: 1.5px solid rgba(148, 163, 184, .3);
    transition: all .3s ease;
}
.pe-login-step.active .pe-login-step-circle {
    color: #fff;
    background: #4f46e5;
    border-color: #818cf8;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .18), 0 0 14px rgba(99, 102, 241, .5);
}
.pe-login-step.done .pe-login-step-circle {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
    font-size: 0;                    /* oculta el número, muestra ✓ */
}
.pe-login-step.done .pe-login-step-circle::after {
    content: '✓';
    font-size: .8rem;
    font-weight: 800;
}
.pe-login-step-label {
    font-size: .65rem; font-weight: 700; letter-spacing: .04em;
    color: #64748b;
}
.pe-login-step.active .pe-login-step-label,
.pe-login-step.done .pe-login-step-label { color: #e2e8f0; }

/* ============ SELECTOR DE COMPONENTES ============ */
#pe-arbol-componentes { display: flex; flex-direction: column; gap: .6rem; }

.pe-comp {
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 12px;
    background: rgba(2, 6, 23, .35);
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.pe-comp:hover { border-color: rgba(129, 140, 248, .4); }
.pe-comp:has(input:checked) {
    border-color: rgba(129, 140, 248, .75);
    background: linear-gradient(135deg, rgba(79, 70, 229, .16), rgba(139, 92, 246, .07));
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .12);
}

.pe-comp-head {
    display: flex; align-items: center; gap: .75rem;
    padding: .75rem .9rem;
    cursor: pointer;
    margin: 0;
}
.pe-comp-head input { position: absolute; opacity: 0; pointer-events: none; }

/* checkbox custom */
.pe-comp-box {
    width: 20px; height: 20px; flex-shrink: 0;
    border-radius: 6px;
    border: 1.5px solid rgba(148, 163, 184, .45);
    display: flex; align-items: center; justify-content: center;
    transition: all .2s ease;
}
.pe-comp-box::after {
    content: '';
    width: 9px; height: 5px;
    border-left: 2px solid #fff; border-bottom: 2px solid #fff;
    transform: rotate(-45deg) scale(0);
    margin-top: -2px;
    transition: transform .18s cubic-bezier(.34, 1.56, .64, 1);
}
.pe-comp-head input:checked + .pe-comp-box {
    background: #4f46e5; border-color: #818cf8;
}
.pe-comp-head input:checked + .pe-comp-box::after {
    transform: rotate(-45deg) scale(1);
}
.pe-comp-head input:focus-visible + .pe-comp-box {
    box-shadow: 0 0 0 3px rgba(129, 140, 248, .45);
}

.pe-comp-ico {
    width: 34px; height: 34px; flex-shrink: 0; padding: 8px;
    border-radius: 9px;
    background: rgba(99, 102, 241, .16); color: #a5b4fc;
    fill: none; stroke: currentColor; stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round;
}
.pe-comp-name { font-size: .88rem; font-weight: 700; color: #e2e8f0; line-height: 1.2; }
.pe-comp-sub  { display: block; font-size: .7rem; font-weight: 500; color: #64748b; margin-top: 2px; }
.pe-comp-price {
    margin-left: auto; text-align: right;
    font-family: 'Sora', sans-serif; font-weight: 800; font-size: .95rem;
    color: #fff; white-space: nowrap;
}
.pe-comp-price small { display: block; font-family: 'Manrope', sans-serif; font-size: .62rem; font-weight: 600; color: #64748b; }
.pe-comp-more { margin-left: auto; font-size: .7rem; font-weight: 700; color: #a5b4fc; }

/* planes por rango (hijos) */
.pe-comp .pe-hijos {
    display: none;
    grid-template-columns: 1fr;
    gap: .4rem;
    margin: 0 !important;
    padding: 0 .9rem .85rem 2.9rem;
}
.pe-comp:has(.pe-check-padre:checked) .pe-hijos { display: grid; }

.pe-tier {
    display: flex; align-items: center; gap: .6rem;
    padding: .5rem .7rem; margin: 0;
    border-radius: 9px; cursor: pointer;
    border: 1px solid rgba(148, 163, 184, .14);
    font-size: .78rem; font-weight: 600; color: #94a3b8;
    transition: all .2s ease;
}
.pe-tier:hover { border-color: rgba(129, 140, 248, .45); color: #e2e8f0; }
.pe-tier input { position: absolute; opacity: 0; pointer-events: none; }
.pe-tier-dot {
    width: 14px; height: 14px; flex-shrink: 0; border-radius: 50%;
    border: 1.5px solid rgba(148, 163, 184, .5);
    transition: all .2s ease;
}
.pe-tier:has(input:checked) {
    border-color: #818cf8; background: rgba(99, 102, 241, .16); color: #fff;
}
.pe-tier input:checked + .pe-tier-dot {
    border-color: #818cf8; background: #818cf8;
    box-shadow: inset 0 0 0 3px #1e1b4b;
}
.pe-tier-price { margin-left: auto; font-weight: 800; color: #c7d2fe; white-space: nowrap; }

.pe-desglose {
    margin-top: .75rem; padding: .7rem .85rem;
    background: rgba(2, 6, 23, .45);
    border: 1px solid rgba(148, 163, 184, .12);
    border-radius: 12px;
}
.pe-line {
    display: flex; justify-content: space-between; gap: 1rem;
    padding: .2rem 0; font-size: .78rem; color: #94a3b8;
}
.pe-line span:last-child { color: #e2e8f0; font-weight: 600; white-space: nowrap; }
.pe-line-sub { margin-top: .35rem; padding-top: .5rem; border-top: 1px dashed rgba(148, 163, 184, .2); }
.pe-line-save, .pe-line-save span:last-child { color: #34d399 !important; font-weight: 700; }

.pe-otp {
    position: relative;
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 6px 0 4px;
}
.pe-otp-box {
    width: 48px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1.5px solid rgba(99, 102, 241, .35);
    background: rgba(99, 102, 241, .08);
    font-family: "JetBrains Mono", "Courier New", monospace;
    font-size: 28px;
    font-weight: 800;
    color: #4f46e5;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease, background .2s ease;
}
.pe-otp-box.is-filled {
    background: rgba(99, 102, 241, .16);
    border-color: #6366f1;
}
.pe-otp-box.is-active {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .22);
    transform: translateY(-2px);
}
/* cursor parpadeante en la casilla activa vacía */
.pe-otp-box.is-active:empty::after {
    content: "";
    width: 2px;
    height: 26px;
    background: #6366f1;
    border-radius: 2px;
    animation: peCaret 1s steps(1) infinite;
}
@keyframes peCaret { 50% { opacity: 0; } }
 
/* Estados de resultado */
.pe-otp.is-error .pe-otp-box { border-color: #ef4444; background: rgba(239, 68, 68, .08); animation: peShake .4s ease; }
.pe-otp.is-ok .pe-otp-box    { border-color: #10b981; background: rgba(16, 185, 129, .12); color: #10b981; }
@keyframes peShake {
    20% { transform: translateX(-6px); } 40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); } 80% { transform: translateX(4px); }
}
 
/* Input real: cubre todo, invisible, pero sigue funcionando (pegar, autocompletar SMS/correo) */
.pe-otp-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: transparent;
    caret-color: transparent;
    font-size: 16px;        /* evita el zoom automático en iPhone */
    letter-spacing: 40px;
    cursor: text;
}
 
@media (max-width: 420px) {
    .pe-otp { gap: 6px; }
    .pe-otp-box { width: 42px; height: 54px; font-size: 24px; }
}

/* ── Descuento visible en /pagar ── */
.pp-chip-desc {
    display: inline-block;
    margin-left: .4rem;
    padding: .05rem .45rem;
    border-radius: 999px;
    background: rgba(52, 211, 153, .15);
    color: #34d399;
    font-size: .68rem;
    font-weight: 800;
    vertical-align: middle;
}

.pp-precio-lista {
    text-decoration: line-through;
    opacity: .55;
    font-weight: 500;
    font-size: .8em;
    margin-left: .35rem;
}

.pp-descuento-mes {
    margin: .55rem 0 0;
    padding: .5rem .75rem;
    background: rgba(52, 211, 153, .1);
    border: 1px solid rgba(52, 211, 153, .3);
    border-radius: 10px;
    color: #34d399;
    font-size: .8rem;
    font-weight: 700;
}

.pp-descuento-mes strong {
    color: #6ee7b7;
}