/* ==========================================================================
   SPA /operacao — login + esqueci-senha na mesma pagina.
   A barra de enderecos mantem /operacao em todas as secoes; a troca e via
   toggling de <section hidden>. Estilos espelham /gestao/login.html para
   paridade visual entre os dois portais.
   ========================================================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: 'Barlow', sans-serif; background: #0D1117; min-height: 100vh; }

:root {
  --ink:        #0D1117;
  --ink-s:      #4A5568;
  --border:     #D1D9E6;
  --warn:       #DC2626;
  --stripe:     #E22A48;
  --blue:       #1D4ED8;
  --ok:         #15803D;
  --primary:    #1E3A8A;
  --primary-dk: #1E40AF;
}

.screen { min-height: 100vh; display: flex; }

/* ============ PAINEL ESQUERDO ============ */
.left-panel {
  width: 460px; flex-shrink: 0; background: var(--ink);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 56px 52px; position: relative; overflow: hidden;
}
.left-panel::before {
  content: ''; position: absolute; top: -80px; right: -100px;
  width: 320px; height: 600px; background: var(--stripe);
  opacity: 0.10; transform: rotate(20deg); border-radius: 4px; pointer-events: none;
}
.left-panel::after {
  content: ''; position: absolute; bottom: -60px; left: -80px;
  width: 260px; height: 420px; background: var(--stripe);
  opacity: 0.06; transform: rotate(20deg); border-radius: 4px; pointer-events: none;
}
.brand-block { position: relative; z-index: 1; }
.brand-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 52px; font-weight: 800; letter-spacing: 4px; line-height: 1; color: #fff;
}
.brand-name span { color: var(--stripe); }
.brand-sub {
  font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.56);
  letter-spacing: 2.5px; text-transform: uppercase; margin-top: 8px;
}
.brand-divider { width: 44px; height: 4px; background: var(--stripe); border-radius: 2px; margin: 28px 0; }
.brand-desc    { font-size: 16px; font-weight: 400; color: rgba(255,255,255,0.68); line-height: 1.75; }
.brand-route {
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; padding: 10px 16px; margin-top: 24px;
}
.route-badge {
  background: var(--stripe); color: #fff;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px; font-weight: 800; letter-spacing: 1px;
  padding: 4px 10px; border-radius: 5px;
}
.route-desc { font-size: 13px; color: rgba(255,255,255,0.72); font-weight: 500; }
.powered {
  position: relative; z-index: 1; display: flex; align-items: center;
  font-size: 12px; color: rgba(255,255,255,0.42); font-weight: 500; letter-spacing: 0.5px;
}
.powered a { color: rgba(255,255,255,0.72); font-weight: 700; text-decoration: none; }
.powered a:hover { text-decoration: underline; text-underline-offset: 3px; }
.powered a:focus-visible { outline: 2px solid var(--stripe); outline-offset: 3px; border-radius: 3px; }

/* ============ PAINEL DIREITO ============ */
.right-panel {
  flex: 1; background: #F8FAFC;
  display: flex; align-items: center; justify-content: center;
  padding: 48px 72px;
}
.login-box { width: 100%; max-width: 520px; }

.login-greeting {
  font-size: 36px; font-weight: 800; color: var(--ink);
  line-height: 1.1; margin-bottom: 6px;
}
.login-sub {
  font-size: 15px; font-weight: 400; color: var(--ink-s);
  margin-bottom: 28px; line-height: 1.5;
}

/* ============ STATUS MSG ============ */
.status-msg {
  display: flex; align-items: center; gap: 10px;
  border-radius: 8px; padding: 12px 16px; margin-bottom: 22px;
  font-size: 14px; font-weight: 600; border: 1.5px solid;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  min-height: 48px;
}
.status-msg.info    { background: #EFF6FF; border-color: #BFDBFE; color: #1D4ED8; }
.status-msg.error   { background: #FEF2F2; border-color: #FECACA; color: var(--warn); }
.status-msg.success { background: #F0FDF4; border-color: #BBF7D0; color: var(--ok); }
.status-msg.loading { background: #FFF7ED; border-color: #FED7AA; color: #C2410C; }

.status-icon { flex-shrink: 0; }
.status-spin {
  width: 16px; height: 16px; flex-shrink: 0;
  border: 2px solid #FED7AA; border-top-color: #C2410C;
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ FIELDS ============ */
.fields-stack { display: flex; flex-direction: column; gap: 16px; margin-bottom: 6px; }
.field { display: block; }
.field label {
  display: block; font-size: 11px; font-weight: 700; color: var(--ink);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 7px;
}
.field-wrap { position: relative; display: flex; align-items: center; }
.field-wrap svg.fi {
  position: absolute; left: 14px; color: #94A3B8;
  pointer-events: none; flex-shrink: 0;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"] {
  width: 100%; height: 54px; padding: 0 44px;
  font-family: 'Barlow', sans-serif; font-size: 17px; font-weight: 500; color: var(--ink);
  background: #fff; border: 2px solid var(--border); border-radius: 10px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.field input::placeholder { color: #CBD5E1; font-weight: 400; }
.field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.12); }
.field input.err  { border-color: var(--warn); box-shadow: 0 0 0 3px rgba(220,38,38,0.08); }
.field input:disabled { background: #F1F5F9; color: #94A3B8; border-color: #E2E8F0; cursor: not-allowed; }

.eye-btn {
  position: absolute; right: 12px; background: none; border: none; cursor: pointer;
  color: #94A3B8; padding: 4px; display: flex; align-items: center;
  transition: color 0.15s;
}
.eye-btn:hover { color: var(--ink); }
.eye-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============ FORGOT ============ */
.forgot-row { display: flex; justify-content: flex-end; margin-bottom: 20px; margin-top: 14px; }
.forgot-link {
  background: none; border: none; padding: 4px 2px;
  font-family: 'Barlow', sans-serif; font-size: 13px; font-weight: 600;
  color: var(--primary); text-decoration: none; cursor: pointer;
  transition: color 0.15s;
}
.forgot-link:hover { color: var(--primary-dk); text-decoration: underline; text-underline-offset: 3px; }
.forgot-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 3px; }

/* ============ BOTAO ============ */
.btn-login-spaced { margin-top: 20px; }
.field-compact { margin-bottom: 16px; }
.back-row-tight { margin-top: 0; }
.btn-login {
  width: 100%; height: 62px;
  font-family: 'Barlow', sans-serif; font-size: 20px; font-weight: 800;
  letter-spacing: 0; text-transform: none;
  border-radius: 10px;
  gap: 10px;
}
.btn-login:active:not(:disabled)  { transform: scale(0.99); }
.btn-login:disabled:not([data-busy="true"]) { opacity: 0.45; cursor: not-allowed; }

/* ============ LINK VOLTAR / SUPORTE ============ */
.back-row { text-align: center; margin-top: 20px; font-size: 14px; }
.back-link {
  background: none; border: none; cursor: pointer; padding: 4px 2px;
  font-family: 'Barlow', sans-serif; font-size: 14px;
  color: var(--primary); font-weight: 600; text-decoration: none;
  transition: color 0.15s;
}
.back-link:hover { color: var(--primary-dk); text-decoration: underline; text-underline-offset: 3px; }

.support {
  text-align: center; font-size: 13px; color: var(--ink-s);
  margin-top: 20px; line-height: 1.6;
}
.support strong { color: var(--ink); font-weight: 700; }
.support a { color: var(--ink); font-weight: 700; text-decoration: none; }
.support a:hover { text-decoration: underline; }

/* ============ SECAO DE LOADING ============ */
.big-spin {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 40px 0;
}
.big-spin-circle {
  width: 52px; height: 52px;
  border: 4px solid #E2E8F0; border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.9s linear infinite;
}
.big-spin-text {
  font-size: 14px; font-weight: 600; color: var(--ink-s);
  letter-spacing: 0.5px; text-transform: uppercase;
}

/* ============ RESPONSIVO ============ */
@media (max-width: 899px) {
  .screen { flex-direction: column; }
  .left-panel {
    width: 100%; flex-direction: row; align-items: center; justify-content: space-between;
    gap: 16px; padding: 20px 24px; min-height: auto;
  }
  .left-panel::before { top: -40px; right: -60px; width: 180px; height: 300px; }
  .left-panel::after  { display: none; }
  .brand-block { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
  .brand-name  { font-size: 32px; letter-spacing: 3px; }
  .brand-sub, .brand-divider, .brand-desc { display: none; }
  .brand-route { margin-top: 0; padding: 6px 10px; }
  .route-badge { font-size: 12px; padding: 3px 8px; }
  .route-desc  { font-size: 12px; }
  .powered     { display: flex; }
  .powered-text { display: none; }
  .right-panel { padding: 32px 24px 48px; }
  .login-box   { max-width: 520px; }
}
@media (max-width: 480px) {
  .left-panel { flex-wrap: wrap; padding: 16px 20px; }
  .brand-name  { font-size: 26px; letter-spacing: 2px; }
  .brand-route { display: none; }
  .right-panel { padding: 24px 16px 40px; }
  .login-greeting { font-size: 28px; }
  .field input[type="text"],
  .field input[type="email"],
  .field input[type="password"] { height: 50px; font-size: 16px; }
  .btn-login { height: 56px; font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
