/* Login "Portal de Emisiones". Requiere portal-emisiones.css (tokens --pe-*). */
.pe-body { margin: 0; background: var(--pe-background); color: var(--pe-text); font-family: var(--pe-font); font-size: 16px; line-height: 1.5; }
.pe-body * { box-sizing: border-box; }
.pe-body button, .pe-body input, .pe-body select { font: inherit; }
.pe-body button { cursor: pointer; }
.pe-body button:focus-visible, .pe-body input:focus-visible, .pe-body select:focus-visible, .pe-body a:focus-visible { outline: 3px solid var(--pe-focus); outline-offset: 4px; }
.pe-svg-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.pe-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.pe-shell { min-height: 100vh; min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

/* Panel izquierdo */
.pe-story { position: relative; isolation: isolate; overflow: hidden; background: linear-gradient(145deg, var(--pe-primary-pressed), var(--pe-primary)); color: #fff; display: flex; flex-direction: column; justify-content: space-between; gap: clamp(16px, 3vh, 32px); padding: clamp(24px, 6vh, 80px) clamp(32px, 5vw, 80px); }
.pe-story::before { content: ""; position: absolute; z-index: -1; width: 430px; height: 430px; background: #ffffff0f; border-radius: 50%; top: -170px; right: -180px; }
.pe-story::after { content: ""; position: absolute; z-index: -1; width: 290px; height: 290px; background: #ffffff0a; border-radius: 50%; bottom: -140px; left: -130px; }

.pe-wordmark { display: flex; gap: 14px; align-items: center; }
.pe-mark { width: 48px; height: 48px; flex: 0 0 auto; border-radius: 14px; background: #ffffff0c; display: grid; place-items: center; overflow: hidden; }
.pe-mark img { width: 48px; height: 48px; display: block; border-radius: 10px; }
.pe-wordmark strong { display: block; font-size: 20px; font-weight: 650; letter-spacing: -.025em; line-height: 1.2; }
.pe-wordmark small { display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; margin-top: 5px; color: #cbd5e1; }
.pe-brand-logo { display: inline-flex; align-items: center; background: var(--pe-surface); border-radius: 14px; padding: 10px 16px; max-width: 280px; }
.pe-brand-logo img { display: block; max-height: 56px; max-width: 100%; }

/* Los espacios verticales dependen de la altura de la pantalla: en laptops (100% de zoom) todo cabe sin scroll. */
.pe-copy { max-width: 520px; margin: clamp(12px, 4vh, 72px) 0; }
.pe-eyebrow { font-size: 12px; letter-spacing: .15em; text-transform: uppercase; color: #cbd5e1; margin: 0 0 clamp(10px, 2.2vh, 20px); }
.pe-copy h2 { font-size: min(clamp(34px, 3.5vw, 52px), 6.4vh); font-weight: 550; line-height: 1.13; letter-spacing: -.045em; margin: 0 0 clamp(12px, 2.6vh, 24px); }
.pe-description { color: #cbd5e1; max-width: 430px; margin: 0; line-height: 1.65; }
.pe-features { margin: clamp(16px, 3.4vh, 32px) 0 0; padding: 0; list-style: none; display: grid; gap: clamp(8px, 1.7vh, 16px); }
.pe-features li { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--pe-border-soft); }
.pe-feature-icon { width: 32px; height: 32px; background: #ffffff0a; border-radius: 9px; display: grid; place-items: center; flex: 0 0 auto; }
.pe-feature-icon svg { width: 17px; height: 17px; }
.pe-story-footer { color: #cbd5e1; font-size: 12px; }

/* Panel del formulario */
.pe-login { background: var(--pe-surface); display: flex; flex-direction: column; justify-content: center; padding: clamp(16px, 4vh, 48px) clamp(28px, 6vw, 100px) clamp(14px, 3vh, 30px); }
.pe-form-wrapper { max-width: 420px; width: 100%; margin: auto; padding: clamp(8px, 3vh, 32px) 0 clamp(12px, 4vh, 48px); }
.pe-form-wrapper h1 { margin: 0 0 10px; color: var(--pe-heading); font-size: 32px; line-height: 1.2; letter-spacing: -.035em; font-weight: 650; }
.pe-subtitle { color: var(--pe-muted); font-size: 14px; margin: 0 0 clamp(18px, 3.4vh, 32px); max-width: 340px; }
.pe-field-group { margin-bottom: clamp(14px, 2.4vh, 22px); }
.pe-body label { display: block; color: var(--pe-heading); font-size: 14px; font-weight: 600; margin-bottom: 9px; }
.pe-input-wrap { position: relative; }
.pe-input { width: 100%; height: 52px; border: 1px solid var(--pe-border); border-radius: var(--pe-radius); background: var(--pe-field); padding: 0 15px; color: var(--pe-heading); }
.pe-input::placeholder { color: var(--pe-muted); opacity: 1; }
.pe-input:hover { border-color: #94a3b8; }
.pe-input:focus { background: var(--pe-surface); }
.pe-input--reveal { padding-right: 60px; }
.pe-reveal { position: absolute; top: 4px; right: 4px; height: 44px; width: 44px; display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--pe-muted); }
.pe-reveal:hover { background: var(--pe-border-soft); color: var(--pe-heading); }
.pe-reveal svg { width: 20px; height: 20px; }
.pe-recovery { text-align: right; margin: -5px 0 clamp(12px, 2.6vh, 25px); }
.pe-text-button { display: inline-flex; align-items: center; padding: 8px 0; border: 0; background: transparent; color: var(--pe-text); font-size: 13px; text-decoration: underline; text-underline-offset: 4px; min-height: 44px; }
.pe-text-button:hover { color: var(--pe-heading); }

.pe-submit { width: 100%; min-height: 52px; border: 0; border-radius: var(--pe-radius); background: var(--pe-primary); color: #fff; font-weight: 600; transition: background .15s; }
.pe-submit:hover { background: var(--pe-primary-hover); }
.pe-submit:active { background: var(--pe-primary-pressed); }
.pe-submit:disabled { opacity: .8; cursor: progress; }
.pe-spinner { display: inline-block; width: 16px; height: 16px; margin-right: 8px; vertical-align: -3px; border: 2px solid #ffffff66; border-top-color: #fff; border-radius: 50%; animation: pe-spin .7s linear infinite; }
@keyframes pe-spin { to { transform: rotate(360deg); } }

.pe-alert, .pe-success { margin: 0 0 18px; padding: 12px 14px; font-size: 14px; background: var(--pe-field); border-radius: 0 10px 10px 0; }
.pe-alert { color: var(--pe-error); border-left: 3px solid var(--pe-error); }
.pe-success { color: var(--pe-success); background: var(--pe-success-bg); border-left: 3px solid var(--pe-success); }
.pe-security { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--pe-muted); font-size: 12px; margin: 20px 0 0; }
.pe-security svg { width: 14px; height: 14px; flex: 0 0 auto; }

.pe-footer { width: 100%; max-width: 420px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--pe-border-soft); padding-top: clamp(6px, 1.6vh, 20px); }
.pe-language { display: flex; align-items: center; gap: 8px; }
.pe-language svg { width: 17px; height: 17px; color: var(--pe-muted); }
.pe-language select { min-height: 44px; border: 0; color: var(--pe-text); background: var(--pe-surface); font-size: 13px; padding: 0 4px; max-width: 140px; }

/* Recuperar contraseña */
.pe-dialog-backdrop { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px; background: #0f172a66; }
.pe-dialog { border: 1px solid var(--pe-border); border-radius: 18px; padding: 28px; max-width: 440px; width: 100%; color: var(--pe-text); background: var(--pe-surface); box-shadow: 0 20px 60px #0f172a26; }
.pe-dialog h2 { color: var(--pe-heading); margin: 0 0 12px; font-size: 22px; }
.pe-dialog p { margin: 0 0 18px; font-size: 14px; }
.pe-dialog .pe-input { margin-bottom: 18px; }
.pe-dialog-actions { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }
.pe-dialog-actions .pe-submit { width: auto; min-height: 44px; padding: 0 22px; }
.pe-button-secondary { min-height: 44px; padding: 0 18px; border: 1px solid var(--pe-border); border-radius: var(--pe-radius); background: var(--pe-surface); color: var(--pe-text); font-weight: 600; }
.pe-button-secondary:hover { background: var(--pe-field); }

@media (min-width: 1600px) { .pe-copy { max-width: 580px; } .pe-copy h2 { font-size: 58px; } }
@media (max-width: 880px) {
  .pe-shell { grid-template-columns: 1fr; }
  .pe-story { padding: 32px 24px; }
  .pe-copy { margin: 36px 0 0; max-width: 520px; }
  .pe-copy h2 { font-size: clamp(28px, 5vw, 40px); }
  .pe-description { font-size: 14px; }
  .pe-eyebrow { margin-bottom: 14px; font-size: 11px; }
  .pe-features { margin-top: 24px; gap: 10px; }
  .pe-story-footer { display: none; }
  .pe-login { padding: 32px 24px 24px; }
  .pe-form-wrapper { padding: 16px 0 40px; }
}
@media (prefers-reduced-motion: reduce) { .pe-body * { transition: none !important; animation: none !important; } }
