/* Portal do cliente — extraido de portal.html (CSP: style-src 'self') */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0f0f14;
  color: #e2e2e9;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #1e1e2e;
}
.logo { font-size: 1.1rem; font-weight: 600; color: #cba6f7; }
#userInfo { font-size: 0.85rem; color: #a6adc8; display: flex; align-items: center; gap: 1rem; }
#logoutBtn {
  padding: 0.3rem 0.75rem;
  background: none;
  border: 1px solid #45475a;
  border-radius: 6px;
  color: #a6adc8;
  cursor: pointer;
  font-size: 0.82rem;
  transition: border-color 0.15s;
}
#logoutBtn:hover { border-color: #f38ba8; color: #f38ba8; }

main { flex: 1; max-width: 760px; margin: 0 auto; width: 100%; padding: 2.5rem 1.5rem; }

/* Estado: loading */
#loading { text-align: center; padding: 4rem; color: #6c7086; }

/* Estado: login */
#loginSection { max-width: 400px; margin: 4rem auto; }
#loginSection h2 { font-size: 1.2rem; color: #cdd6f4; margin-bottom: 0.5rem; }
#loginSection p { font-size: 0.88rem; color: #6c7086; margin-bottom: 1.5rem; line-height: 1.5; }

.card {
  background: #1e1e2e;
  border: 1px solid #313244;
  border-radius: 12px;
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}
.card h3 { font-size: 0.95rem; color: #cdd6f4; font-weight: 600; margin-bottom: 1rem; }

label { display: block; font-size: 0.82rem; color: #a6adc8; margin-bottom: 0.3rem; }
input[type="text"], input[type="password"], textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  background: #11111b;
  border: 1px solid #45475a;
  border-radius: 7px;
  color: #cdd6f4;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}
textarea { resize: vertical; min-height: 60px; }
input:focus, textarea:focus { border-color: #cba6f7; }

.btn {
  padding: 0.55rem 1.1rem;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; }
.btn-primary { background: #cba6f7; color: #11111b; }
.btn-secondary { background: #313244; color: #cdd6f4; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.82rem; }

/* Estado: pendente */
#pendingSection { text-align: center; padding: 3rem 1rem; }
.pending-icon { font-size: 3rem; margin-bottom: 1rem; }
#pendingSection h2 { font-size: 1.3rem; color: #cdd6f4; margin-bottom: 0.75rem; }
#pendingSection p { color: #a6adc8; line-height: 1.6; }

/* Estado: ativo */
.vault-status { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 4px; font-size: 0.78rem; font-weight: 600; }
.vault-status.active  { background: #1e2f1e; color: #a6e3a1; }
.vault-status.pending { background: #2f2a1e; color: #f9e2af; }
.vault-status.error   { background: #2f1e1e; color: #f38ba8; }

.cred-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
}
.cred-label { font-size: 0.8rem; color: #6c7086; width: 110px; flex-shrink: 0; }
.cred-value {
  flex: 1;
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 0.85rem;
  color: #cdd6f4;
  background: #11111b;
  padding: 0.4rem 0.75rem;
  border-radius: 5px;
  border: 1px solid #313244;
  word-break: break-all;
}
.cred-copy {
  padding: 0.35rem 0.6rem;
  background: #313244;
  border: none;
  border-radius: 5px;
  color: #a6adc8;
  cursor: pointer;
  font-size: 0.78rem;
  transition: background 0.15s;
}
.cred-copy:hover { background: #45475a; }

.guide-steps { counter-reset: step; }
.guide-step { display: flex; gap: 0.75rem; margin-bottom: 0.75rem; align-items: flex-start; }
.guide-step::before {
  counter-increment: step;
  content: counter(step);
  background: #313244;
  color: #cba6f7;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.guide-step p { font-size: 0.88rem; color: #a6adc8; line-height: 1.5; }
.guide-step code {
  background: #11111b;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.82rem;
  color: #cba6f7;
  font-family: monospace;
}

.hidden-pass { filter: blur(6px); user-select: none; transition: filter 0.2s; }

.divider { border: none; border-top: 1px solid #313244; margin: 1.25rem 0; }

/* ---- Classes que substituem os antigos atributos style= (CSP) ---- */
.form-field { margin-bottom: 1rem; }
#loginErr { margin-top: 0.75rem; font-size: 0.85rem; color: #f38ba8; display: none; }
.login-footer { text-align: center; font-size: 0.82rem; color: #6c7086; }
.link-plain { color: #89b4fa; text-decoration: none; }
.pending-contact { margin-top: 1.5rem; font-size: 0.82rem; color: #45475a; }
.vault-title { font-size: 1.2rem; color: #cdd6f4; margin-bottom: 1.5rem; }
.cred-section-title { font-size: 0.85rem; font-weight: 600; color: #cdd6f4; margin-bottom: 0.85rem; }
.vault-preparing { font-size: 0.85rem; color: #6c7086; }
.vault-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.vault-sub { font-size: 0.8rem; color: #6c7086; margin-bottom: 0; }
.muted { color: #6c7086; }

/* Estado inicial (era style="display:none" inline): JS controla via el.style.
   Fica DEPOIS das regras #userInfo/#loginSection acima — a ordem de fonte
   garante que vence com a mesma especificidade. */
#userInfo, #loginSection, #pendingSection, #activeSection { display: none; }

.adv-login { margin-top: .75rem; }
.adv-login summary { cursor: pointer; color: var(--muted, #8a9bb5); font-size: .9rem; }
.adv-login .form-field { margin-top: .5rem; }
