@import url("tokens.css");

/* Toasts */
#toast-container {
  position: fixed; z-index: 2000; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; max-width: 420px; pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: #0f172a; color: #f8fafc; padding: 12px 14px; border-radius: 12px; box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,0.1); display: flex; gap: 10px; align-items: flex-start;
  animation: toast-in .2s ease-out;
}
.toast.ok { background: #052e1b; }
.toast.err { background: #3f0d0d; }
.toast .t { font-size: 14px; }
@keyframes toast-in { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Loader overlay */
#app-loader {
  position: fixed; inset: 0; z-index: 3000; display: none; align-items: center; justify-content: center;
  background: rgba(15, 23, 42, 0.25);
}
#app-loader.open { display: flex; }
.spinner {
  width: 44px; height: 44px; border-radius: 50%;
  border: 3px solid rgba(29, 78, 216, 0.25);
  border-top-color: #1d4ed8;
  animation: spin .8s linear infinite;
  background: #fff;
  box-shadow: var(--shadow-md);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 1500; background: rgba(15, 23, 42, 0.45); display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop.open { display: flex; }
.modal {
  width: min(640px, 100%); max-height: 90vh; overflow: auto; background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
}
.modal header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--color-border); }
.modal h3 { margin: 0; font-size: 16px; }
.modal .md-body { padding: 14px; }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 700px) { .grid-form { grid-template-columns: 1fr; } }
.w-full { grid-column: 1 / -1; }

.pager { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-top: 1px solid #f1f5f9; }
.pager .pg-btn { border: 1px solid #e2e8f0; background: #fff; border-radius: 8px; padding: 6px 10px; cursor: pointer; }

/* Auth */
body.page-auth { background: linear-gradient(180deg, #eef2f7 0%, var(--color-page) 38%); }
.auth-page { padding: 32px 0 56px; background: transparent; }
.auth-wrap--center { min-height: min(56vh, 640px); display: grid; place-items: center; padding: 0 20px; }
.auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--color-border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 28px 28px 30px; margin: 0 auto; }
.auth-card h1 { margin: 0 0 10px; font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; color: var(--navy-900); line-height: 1.25; }
.auth-topline { width: 100%; height: 3px; background: linear-gradient(90deg, var(--blue-500), var(--brand-orange)); border-radius: 3px; margin: 0 0 12px; }
.auth-card__back {
  display: inline-block; font-size: 13px; font-weight: 600; color: var(--color-ink-muted);
  text-decoration: none; margin: 0 0 8px; transition: color 0.15s;
}
.auth-card__back:hover { color: var(--navy-900); }
.auth-card__brand { margin: 0 0 12px; font-size: 1.05rem; font-weight: 800; line-height: 1.2; }
.auth-card__brand .logo__meu { color: var(--navy-900); letter-spacing: -0.02em; }
.auth-card__brand .logo__emp { color: var(--brand-orange); letter-spacing: -0.02em; }
.auth-card__lede { margin: 0 0 22px; font-size: 0.95rem; line-height: 1.5; color: var(--color-ink-muted); }
.auth-form { display: flex; flex-direction: column; gap: 0; }
.auth-field { margin-bottom: 16px; }
.auth-field label { display: block; }
.auth-forgot { text-align: right; margin: 0 0 4px; font-size: 14px; }
.auth-forgot a { color: var(--blue-500); text-decoration: none; font-weight: 600; }
.auth-forgot a:hover { text-decoration: underline; }
.auth-form__row { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; }
.auth-form__row .btn { min-width: 128px; }
.link-arrow { text-decoration: none; }
.auth-split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
@media (max-width: 900px) { .auth-split { grid-template-columns: 1fr; } }

/* Progress (ativação) */
.progress-bar { width: 100%; height: 12px; background: #e2e8f0; border-radius: 10px; overflow: hidden; }
.progress-bar > i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, #10b981, #34d399); transition: width .2s; }

/* page-hero: estilos principais em site.css */

.form-msg { min-height: 20px; font-size: 13px; margin-top: 8px; }
.form-msg.error { color: #b91c1c; }
.form-msg.ok { color: #047857; }
