/**
 * Design System Comprove — estilos scoped para páginas de auth/trial.
 * Referência: design-system-comprove (comprove-login / comprove-trial).
 * Escopo: body.ds-auth — não altera o restante do WAR.
 */

@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@300;400;500;700&family=Inter:wght@300;400;500;600;700;800&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

body.ds-auth {
  --brand-purple-deep: #494752;
  --brand-ink: #494752;
  --brand-offwhite: #F8F8F8;
  --brand-violet: #8caf3d;
  --brand-blue: #8caf3d;
  --brand-lilac: #b2d86c;
  --success: #0FA968;
  --success-bg: #E6F7F0;
  --danger: #DE2B4B;
  --danger-bg: #FCE9ED;
  --bg-page: var(--brand-offwhite);
  --bg-surface: #FFFFFF;
  --text-primary: var(--brand-ink);
  --text-secondary: #5A6072;
  --text-muted: #8A90A3;
  --border: #E6E4EF;
  --shadow-sm: 0 2px 8px rgba(73, 71, 82, .04);
  --shadow-md: 0 12px 32px rgba(73, 71, 82, .08);
  --shadow-glow: 0 0 0 4px rgba(140, 175, 61, .18);
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 999px;
  --font-ui: 'Inter', system-ui, sans-serif;
  --font-display: 'Comfortaa', sans-serif;

  font-family: var(--font-ui);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  margin: 0;
  min-height: 100vh;
  box-sizing: border-box;
}

body.ds-auth *,
body.ds-auth *::before,
body.ds-auth *::after {
  box-sizing: border-box;
}

body.ds-auth a {
  text-decoration: none;
  color: inherit;
}

/* ========== LOGIN / VALIDA E-MAIL (card) ========== */
body.ds-auth.ds-login-page {
  background: radial-gradient(circle at 0% 0%, #edf4db 0%, var(--brand-offwhite) 50%, #e2e6eb 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 20px;
}

body.ds-auth.ds-login-page form#lume,
body.ds-auth.ds-login-page #lume {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  flex: 1 1 auto;
  margin: 0;
}

body.ds-auth .ds-login-shell {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex: 0 0 auto;
}

/* Garante 420px mesmo com wrappers do PrimeFaces (outputPanel) */
body.ds-auth .ds-login-shell > .ui-outputpanel,
body.ds-auth .ds-login-shell [id$="loginPanel"],
body.ds-auth .login-card {
  width: 100% !important;
  max-width: 420px !important;
  box-sizing: border-box;
}

body.ds-auth .login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-ui);
}

body.ds-auth .login-card .ui-inputfield,
body.ds-auth .login-card .ui-button,
body.ds-auth .login-card .ui-button-text,
body.ds-auth .login-card label,
body.ds-auth .login-card .ds-form-label,
body.ds-auth .login-card a {
  font-family: var(--font-ui) !important;
}

body.ds-auth .logo-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 28px;
  user-select: none;
  width: 100%;
}

body.ds-auth .logo-wrapper img,
body.ds-auth .logo-wrapper .ds-login-logo,
body.ds-auth .logo-wrapper .ui-graphicimage {
  width: 180px !important;
  height: 49px !important;
  max-width: 180px !important;
  object-fit: contain;
  display: block;
}

body.ds-auth .ds-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

body.ds-auth .ds-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

body.ds-auth .ds-form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

body.ds-auth .ds-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

body.ds-auth .ds-input-icon {
  position: absolute;
  left: 14px;
  z-index: 2;
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}

body.ds-auth .btn-toggle-password {
  position: absolute;
  right: 14px;
  z-index: 2;
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color 0.15s;
  padding: 0;
  line-height: 1;
  background: none;
  border: none;
  cursor: pointer;
}

body.ds-auth .btn-toggle-password:hover {
  color: var(--brand-violet);
}

body.ds-auth .ds-input-wrapper.has-toggle .ui-inputfield,
body.ds-auth .ds-input-wrapper.has-toggle input.ui-inputfield {
  padding-right: 42px !important;
}

/* PrimeFaces inputs inside DS auth */
body.ds-auth .ds-input-wrapper .ui-inputfield,
body.ds-auth .ds-input-wrapper input.ui-inputfield,
body.ds-auth .ds-input-wrapper .ui-password,
body.ds-auth .ds-form-group .ui-inputfield,
body.ds-auth .ds-form-group input.ui-inputfield,
body.ds-auth .ds-form-group .ui-selectonemenu,
body.ds-auth .ds-form-group .ui-autocomplete {
  width: 100% !important;
  background: var(--brand-offwhite) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  padding: 12px 14px 12px 40px !important;
  font-size: 0.88rem !important;
  color: var(--text-primary) !important;
  box-shadow: none !important;
  font-family: var(--font-ui) !important;
}

body.ds-auth .ds-form-group .ui-inputfield.ds-no-icon,
body.ds-auth .ds-form-group input.ui-inputfield.ds-no-icon {
  padding-left: 14px !important;
}

body.ds-auth .ds-input-wrapper .ui-inputfield:focus,
body.ds-auth .ds-form-group .ui-inputfield:focus {
  border-color: var(--brand-violet) !important;
  box-shadow: var(--shadow-glow) !important;
  background: #FFFFFF !important;
}

body.ds-auth .forgot-password-row {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

body.ds-auth .forgot-password-link,
body.ds-auth .forgot-password-row a,
body.ds-auth .forgot-password-row .ui-commandlink {
  font-size: 0.78rem !important;
  font-weight: 500 !important;
  color: var(--text-secondary) !important;
  background: none !important;
  border: none !important;
}

body.ds-auth .forgot-password-row a:hover,
body.ds-auth .forgot-password-row .ui-commandlink:hover {
  color: var(--brand-violet) !important;
}

body.ds-auth .btn-submit,
body.ds-auth .ui-button.btn-submit,
body.ds-auth button.btn-submit {
  background: var(--brand-violet) !important;
  background-image: none !important;
  border: none !important;
  color: #FFFFFF !important;
  font-weight: 700 !important;
  font-size: 0.88rem !important;
  padding: 14px !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-sm) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  line-height: 1.25 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  margin-top: 8px !important;
  font-family: var(--font-ui) !important;
  transition: all 0.15s ease !important;
}

body.ds-auth .btn-submit:hover,
body.ds-auth .ui-button.btn-submit:hover,
body.ds-auth button.btn-submit:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

body.ds-auth .ui-button.btn-submit .ui-button-text {
  padding: 0 !important;
  color: #FFFFFF !important;
  background: transparent !important;
  border: none !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
}

body.ds-auth .ui-button.btn-submit-arrow .ui-button-text::after {
  content: "\f061";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 0.9rem;
  line-height: 1;
}

body.ds-auth .divider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 8px 0;
}

body.ds-auth .divider-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

body.ds-auth .divider-text {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

body.ds-auth .btn-secondary-action,
body.ds-auth .ui-button.btn-secondary-action {
  border: 1.5px solid var(--border) !important;
  background: transparent !important;
  background-image: none !important;
  color: var(--text-secondary) !important;
  font-weight: 700 !important;
  font-size: 0.85rem !important;
  padding: 12px !important;
  border-radius: var(--radius-md) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  line-height: 1.25 !important;
  font-family: var(--font-ui) !important;
  box-shadow: none !important;
}

body.ds-auth .ui-button.btn-secondary-action .ui-button-text {
  padding: 0 !important;
  color: var(--text-secondary) !important;
  background: transparent !important;
  border: none !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
}

body.ds-auth .ui-button.btn-with-plus .ui-button-text::before {
  content: "\f067";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 0.85rem;
  line-height: 1;
}

body.ds-auth .btn-secondary-action:hover,
body.ds-auth .ui-button.btn-secondary-action:hover {
  background: var(--brand-offwhite) !important;
  border-color: var(--brand-lilac) !important;
  color: var(--brand-purple-deep) !important;
}

body.ds-auth .ui-button.btn-secondary-action:hover .ui-button-text {
  color: var(--brand-purple-deep) !important;
}

/* Footer — espelha .footer do DS (comprove-login.html) */
body.ds-auth .ds-footer {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 24px;
  width: 100%;
  font-family: var(--font-ui);
}

body.ds-auth .ds-footer a {
  color: var(--brand-violet);
  font-weight: 600;
  transition: color 0.15s, filter 0.15s;
}

body.ds-auth .ds-footer a:hover {
  filter: brightness(0.85);
}

body.ds-auth .ds-trial-hint {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 8px;
  line-height: 1.4;
}

body.ds-auth .ds-messages {
  width: 100%;
}

/*
 * Esconde área vazia (não infla o card).
 * p:messages → .ui-messages-error/info/... ; p:message → .ui-message
 * (:has(.ui-message) sozinho escondia SEMPRE os erros do login)
 */
body.ds-auth .ds-messages:not(:has(.ui-messages-error)):not(:has(.ui-messages-info)):not(:has(.ui-messages-warn)):not(:has(.ui-messages-fatal)):not(:has(.ui-message)) {
  display: none;
}

body.ds-auth .ds-messages .ui-messages,
body.ds-auth .ds-messages .ui-message {
  margin: 0 0 8px 0 !important;
  border-radius: var(--radius-md) !important;
}

body.ds-auth .ds-messages .ui-messages:empty {
  display: none !important;
  margin: 0 !important;
}

/* Login / auth: alerta soft — mesmo vocabulário do trial (erro-flow / growl erro) */
body.ds-auth .ds-messages .ui-messages-error,
body.ds-auth .ds-messages .ui-messages-fatal,
body.ds-auth .ds-messages .ui-message.ui-message-error,
body.ds-auth .ds-messages .ui-message.ui-message-fatal {
  display: flex !important;
  align-items: flex-start !important;
  gap: 12px !important;
  background: #FDF2F4 !important;
  border: 1px solid #F5C2CC !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-md) !important;
  padding: 12px 16px !important;
  box-shadow: var(--shadow-sm) !important;
  font-family: var(--font-ui) !important;
  font-size: 0.88rem !important;
  font-weight: 500 !important;
  line-height: 1.45 !important;
}

body.ds-auth .ds-messages .ui-messages-error::before,
body.ds-auth .ds-messages .ui-messages-fatal::before,
body.ds-auth .ds-messages .ui-message.ui-message-error::before,
body.ds-auth .ds-messages .ui-message.ui-message-fatal::before {
  content: "\f06a"; /* circle-exclamation */
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
  font-size: 1rem !important;
  line-height: 1.45 !important;
  color: var(--danger) !important;
  flex-shrink: 0;
}

body.ds-auth .ds-messages .ui-messages-info {
  display: flex !important;
  align-items: flex-start !important;
  gap: 12px !important;
  background: #F4F8EC !important;
  border: 1px solid #D4E5B0 !important;
  border-radius: var(--radius-md) !important;
  padding: 12px 16px !important;
  box-shadow: var(--shadow-sm) !important;
  font-family: var(--font-ui) !important;
  font-size: 0.88rem !important;
}

body.ds-auth .ds-messages .ui-messages-info::before {
  content: "\f05a"; /* circle-info */
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
  color: var(--brand-violet) !important;
  flex-shrink: 0;
}

body.ds-auth .ds-messages .ui-messages-error .ui-messages-error-icon,
body.ds-auth .ds-messages .ui-messages-fatal .ui-messages-fatal-icon,
body.ds-auth .ds-messages .ui-messages-info .ui-messages-info-icon,
body.ds-auth .ds-messages .ui-message .ui-message-error-icon,
body.ds-auth .ds-messages .ui-message .ui-message-info-icon {
  display: none !important;
}

body.ds-auth .ds-messages .ui-messages-error ul,
body.ds-auth .ds-messages .ui-messages-fatal ul,
body.ds-auth .ds-messages .ui-messages-info ul {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  flex: 1;
}

body.ds-auth .ds-messages .ui-messages-error .ui-messages-error-summary,
body.ds-auth .ds-messages .ui-messages-fatal .ui-messages-fatal-summary,
body.ds-auth .ds-messages .ui-message.ui-message-error .ui-message-error-summary {
  /* Esconde "Erro!" genérico quando há detalhe; mantém summary se for a única mensagem */
  display: none !important;
  color: var(--danger) !important;
  font-family: var(--font-ui) !important;
  font-size: 0.88rem !important;
  font-weight: 500 !important;
  margin: 0 !important;
}

body.ds-auth .ds-messages .ui-messages-error li:not(:has(.ui-messages-error-detail)) .ui-messages-error-summary,
body.ds-auth .ds-messages .ui-messages-fatal li:not(:has(.ui-messages-fatal-detail)) .ui-messages-fatal-summary,
body.ds-auth .ds-messages .ui-message.ui-message-error:not(:has(.ui-message-error-detail)) .ui-message-error-summary {
  display: block !important;
}

body.ds-auth .ds-messages .ui-messages-error .ui-messages-error-detail,
body.ds-auth .ds-messages .ui-messages-fatal .ui-messages-fatal-detail,
body.ds-auth .ds-messages .ui-messages-info .ui-messages-info-detail,
body.ds-auth .ds-messages .ui-messages-info .ui-messages-info-summary,
body.ds-auth .ds-messages .ui-message.ui-message-error .ui-message-error-detail {
  color: var(--danger) !important;
  font-family: var(--font-ui) !important;
  font-size: 0.88rem !important;
  font-weight: 500 !important;
  margin: 0 !important;
  display: block !important;
}

body.ds-auth .ds-messages .ui-messages-info .ui-messages-info-detail,
body.ds-auth .ds-messages .ui-messages-info .ui-messages-info-summary {
  color: var(--text-primary) !important;
}

/* ========== TRIAL / WIZARD (split) ========== */
body.ds-auth.ds-trial-page {
  background: var(--brand-offwhite);
  display: block;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body.ds-auth .split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-width: 0;
}

body.ds-auth .marketing-panel {
  background: linear-gradient(135deg, var(--brand-purple-deep) 0%, #2f2e36 100%);
  color: #FFFFFF;
  padding: 60px 80px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
}

body.ds-auth .marketing-panel::before {
  content: "";
  position: absolute;
  top: -20%;
  right: -20%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(140, 175, 61, 0.2) 0%, transparent 70%);
  filter: blur(50px);
  pointer-events: none;
}

body.ds-auth .m-logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
  position: relative;
  z-index: 1;
}

body.ds-auth .m-logo-img {
  height: 49px;
  width: 180px;
  max-width: 100%;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

body.ds-auth .hero-content {
  max-width: 540px;
  margin: auto 0;
  position: relative;
  z-index: 1;
}

body.ds-auth .hero-tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.12);
  color: var(--brand-lilac);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

body.ds-auth .hero-content h1 {
  font-size: 2.3rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 16px 0;
  font-family: var(--font-display);
}

body.ds-auth .hero-content > p {
  font-size: 1rem;
  line-height: 1.5;
  opacity: 0.85;
  margin: 0 0 36px 0;
}

body.ds-auth .features-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

body.ds-auth .feature-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

body.ds-auth .feature-icon-wrapper {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--brand-lilac);
  font-size: 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

body.ds-auth .feature-text h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 4px 0;
}

body.ds-auth .feature-text p {
  font-size: 0.82rem;
  opacity: 0.75;
  line-height: 1.4;
  margin: 0;
}

body.ds-auth .form-panel {
  padding: 60px 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: radial-gradient(circle at 100% 100%, #F5F8ED 0%, var(--brand-offwhite) 80%);
  min-width: 0;
  max-width: 100%;
}

body.ds-auth .form-container {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  min-width: 0;
}

body.ds-auth .wizard-steps {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: nowrap;
  max-width: 100%;
  min-width: 0;
}

body.ds-auth .wizard-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

body.ds-auth .wizard-step.active {
  color: var(--brand-purple-deep);
}

body.ds-auth .wizard-step.completed {
  color: var(--brand-violet);
}

body.ds-auth .step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
}

body.ds-auth .wizard-step.active .step-num {
  border-color: var(--brand-violet);
  background: var(--brand-violet);
  color: #fff;
}

body.ds-auth .wizard-step.completed .step-num {
  border-color: var(--brand-violet);
  background: var(--brand-lilac);
  color: var(--brand-purple-deep);
}

body.ds-auth .step-line {
  flex: 1;
  min-width: 12px;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
}

body.ds-auth .step-title-eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--brand-violet);
  display: block;
  margin-bottom: 4px;
}

body.ds-auth .step-title h2 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--brand-purple-deep);
  margin: 0 0 6px 0;
  font-family: var(--font-display);
}

body.ds-auth .step-title p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0 0 12px 0;
}

body.ds-auth .ui-button.ds-btn-primary {
  background: var(--brand-violet) !important;
  border: none !important;
  color: #FFFFFF !important;
  font-weight: 700 !important;
  font-size: 0.88rem !important;
  padding: 12px 24px !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-sm) !important;
  font-family: var(--font-ui) !important;
}

body.ds-auth .ui-button.ds-btn-primary .ui-button-text {
  padding: 0 !important;
  color: #FFFFFF !important;
  background: transparent !important;
  border: none !important;
  font-weight: 700 !important;
}

/* PrimeFaces Wizard inside DS trial */
body.ds-auth .ds-pf-wizard.ui-wizard {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.ds-auth .ds-pf-wizard .ui-wizard-step-titles {
  display: none !important; /* usamos wizard-steps custom acima */
}

body.ds-auth .ds-pf-wizard .ui-wizard-content {
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
}

body.ds-auth .ds-pf-wizard .ui-wizard-navbar {
  margin-top: 12px !important;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 12px !important;
  justify-content: flex-start !important;
  align-items: center !important;
  width: 100% !important;
}

body.ds-auth .ds-pf-wizard .ui-wizard-nav-next,
body.ds-auth .ds-pf-wizard .ui-wizard-nav-back {
  float: none !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  border-radius: var(--radius-md) !important;
  font-weight: 700 !important;
  font-family: var(--font-ui) !important;
  font-size: 0.88rem !important;
  /* padding vertical 0: altura só via 44px (evita Voltar ≠ Próximo vs Ultima) */
  padding: 0 24px !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
  overflow: hidden !important;
}

/* Respeita show/hide do PrimeFaces (não forçar display em botão oculto) */
body.ds-auth .ds-pf-wizard .ui-wizard-nav-next:not([style*="display: none"]):not([style*="display:none"]),
body.ds-auth .ds-pf-wizard .ui-wizard-nav-back:not([style*="display: none"]):not([style*="display:none"]) {
  display: inline-flex !important;
}

body.ds-auth .ds-pf-wizard .ui-wizard-nav-next[style*="display: none"],
body.ds-auth .ds-pf-wizard .ui-wizard-nav-back[style*="display: none"],
body.ds-auth .ds-pf-wizard .ui-wizard-nav-next[style*="display:none"],
body.ds-auth .ds-pf-wizard .ui-wizard-nav-back[style*="display:none"] {
  display: none !important;
}

/* DS: Voltar compacto + Próximo ocupando o restante (mesma altura) */
body.ds-auth .ds-pf-wizard .ui-wizard-nav-next {
  background: var(--brand-violet) !important;
  border: none !important;
  color: #fff !important;
  flex: 1 1 auto !important;
  width: auto !important;
  min-width: 160px !important;
  box-shadow: var(--shadow-sm) !important;
}

body.ds-auth .ds-pf-wizard .ui-wizard-nav-back {
  border: 1.5px solid var(--border) !important;
  background: var(--bg-surface) !important;
  color: var(--text-secondary) !important;
  box-shadow: none !important;
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 110px !important;
  padding: 0 20px !important;
}

/* Remove ícones Material/jQuery UI tortos do wizard */
body.ds-auth .ds-pf-wizard .ui-wizard-nav-next .ui-button-icon-left,
body.ds-auth .ds-pf-wizard .ui-wizard-nav-back .ui-button-icon-left,
body.ds-auth .ds-pf-wizard .ui-wizard-nav-next .ui-icon,
body.ds-auth .ds-pf-wizard .ui-wizard-nav-back .ui-icon {
  display: none !important;
}

body.ds-auth .ds-pf-wizard .ui-wizard-nav-next .ui-button-text,
body.ds-auth .ds-pf-wizard .ui-wizard-nav-back .ui-button-text {
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  font-family: var(--font-ui) !important;
  font-weight: 700 !important;
}

body.ds-auth .ds-pf-wizard .ui-wizard-nav-next .ui-button-text::after {
  content: "\f061"; /* fa-arrow-right */
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
  font-size: 0.85rem !important;
  line-height: 1 !important;
}

body.ds-auth .ds-pf-wizard .ui-wizard-nav-back .ui-button-text::before {
  content: "\f060"; /* fa-arrow-left */
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
  font-size: 0.85rem !important;
  line-height: 1 !important;
}

/* Botões Confirmar / CEP com FA6 */
body.ds-auth .ds-pf-wizard .ui-button.ds-btn-primary {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  min-height: 44px !important;
}

body.ds-auth .ds-pf-wizard .ui-button.ds-btn-primary .ui-button-icon-left,
body.ds-auth .ds-pf-wizard .ui-button.ds-btn-primary .ui-icon {
  position: static !important;
  margin: 0 !important;
  float: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  height: auto !important;
  background: none !important;
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
  font-size: 0.9rem !important;
  color: inherit !important;
  text-indent: 0 !important;
}

body.ds-auth .ds-pf-wizard .ui-button.ds-btn-primary .ui-button-text {
  padding: 0 !important;
  line-height: 1.2 !important;
}

body.ds-auth .ds-pf-wizard .ui-button.ds-btn-cep,
body.ds-auth .ds-pf-wizard .ui-button.ds-btn-cep.ui-button-icon-only {
  flex: 0 0 44px !important;
  align-self: center !important;
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: var(--radius-md) !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

/* Ultima icon-only usa margin negativo + absolute — centraliza no square 44px */
body.ds-auth .ds-pf-wizard .ui-button.ds-btn-cep .ui-button-icon-left,
body.ds-auth .ds-pf-wizard .ui-button.ds-btn-cep .ui-icon,
body.ds-auth .ds-pf-wizard .ui-button.ds-btn-cep.ui-button-icon-only .ui-icon {
  position: static !important;
  top: auto !important;
  left: auto !important;
  margin: 0 !important;
  margin-top: 0 !important;
  margin-left: 0 !important;
  float: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  height: auto !important;
  font-size: 0.95rem !important;
  line-height: 1 !important;
}

body.ds-auth .ds-pf-wizard .ui-button.ds-btn-cep .ui-button-text {
  display: none !important;
  padding: 0 !important;
}

body.ds-auth .ds-pf-wizard .ui-button#aderir,
body.ds-auth .ds-pf-wizard .ui-button[id$="aderir"] {
  width: 100% !important;
}

/* ds-field: label acima (substitui md-inputfield / md-combo Ultima) */
body.ds-auth .ds-pf-wizard .ds-field {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  margin: 0 0 16px 0 !important;
  padding: 0 !important;
  min-height: 0 !important;
  overflow: visible !important;
}

body.ds-auth .ds-pf-wizard .ds-field > .ui-outputlabel,
body.ds-auth .ds-pf-wizard .ds-field > label {
  position: static !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  transform: none !important;
  order: -1 !important;
  display: block !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: auto !important;
  font-family: var(--font-ui) !important;
  color: var(--text-secondary) !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  background: transparent !important;
  width: auto !important;
  max-width: 100% !important;
}

body.ds-auth .ds-pf-wizard .ds-field .msg,
body.ds-auth .ds-pf-wizard .ds-field .ui-message {
  order: 2 !important;
  position: static !important;
}

body.ds-auth .ds-cep-row {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  margin-bottom: 16px !important;
}

/* Row só do campo + lupa — alinha ao INPUT, não à label */
body.ds-auth .ds-cep-row-fields {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
  align-items: center !important;
  width: 100% !important;
}

body.ds-auth .ds-cep-row-fields .ui-inputfield,
body.ds-auth .ds-cep-row-fields input.ui-inputfield {
  flex: 1 1 auto !important;
  width: auto !important;
  min-width: 0 !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  box-sizing: border-box !important;
  margin: 0 !important;
}

body.ds-auth .ds-pf-wizard .ui-panel,
body.ds-auth .ds-pf-wizard .ui-panel-content {
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  box-shadow: none !important;
}

body.ds-auth .ds-pf-wizard .ui-panelgrid,
body.ds-auth .ds-pf-wizard .ui-panelgrid td {
  border: none !important;
  background: transparent !important;
}

/* Label acima via order — input pode vir antes no DOM (legado Ultima) */
body.ds-auth .ds-pf-wizard .ds-field > .ui-outputlabel.ui-state-error,
body.ds-auth .ds-pf-wizard .ds-field > label.ui-state-error {
  color: var(--text-secondary) !important;
}

/*
 * Field validation (p:message) — DS helper text, não caixinha Ultima.
 * Tokens: --danger / --danger-bg (cadastro). Asterisco obrigatório em danger.
 * Trial HTML não tem inline errors (usa alert); alinhamos ao vocabulário semântico.
 */
body.ds-auth .ds-pf-wizard .ui-message,
body.ds-auth .ds-pf-wizard .ui-message.ui-message-error,
body.ds-auth .ds-pf-wizard .ds-field .ui-message.ui-message-error,
body.ds-auth .ds-pf-wizard .msg.ui-message-error {
  display: flex !important;
  align-items: flex-start !important;
  gap: 6px !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  margin: 4px 0 0 0 !important;
  padding: 0 !important;
  background: transparent !important;
  background-image: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: var(--danger) !important;
  font-family: var(--font-ui) !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  line-height: 1.35 !important;
}

/* PF deixa .ui-message vazio quando não há erro */
body.ds-auth .ds-pf-wizard .ui-message:not(.ui-message-error):not(.ui-message-info):not(.ui-message-warn):not(.ui-message-fatal),
body.ds-auth .ds-pf-wizard .ui-message:empty {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.ds-auth .ds-pf-wizard .ui-message .ui-message-error-detail,
body.ds-auth .ds-pf-wizard .ui-message .ui-message-error-summary,
body.ds-auth .ds-pf-wizard .ui-message.ui-message-error .ui-message-error-detail,
body.ds-auth .ds-pf-wizard .ui-message.ui-message-error .ui-message-error-summary {
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--danger) !important;
  font-family: var(--font-ui) !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  line-height: 1.35 !important;
}

/* Esconde ícone Material quebrado (quadradinho) do Ultima */
body.ds-auth .ds-pf-wizard .ui-message .ui-message-error-icon,
body.ds-auth .ds-pf-wizard .ui-message .ui-message-info-icon,
body.ds-auth .ds-pf-wizard .ui-message .ui-message-warn-icon,
body.ds-auth .ds-pf-wizard .ui-message .ui-message-fatal-icon {
  display: none !important;
}

/* Campo inválido: borda danger (não vermelho Ultima #e62a10) */
body.ds-auth .ds-pf-wizard .ui-inputfield.ui-state-error,
body.ds-auth .ds-pf-wizard input.ui-inputfield.ui-state-error,
body.ds-auth .ds-pf-wizard textarea.ui-inputfield.ui-state-error,
body.ds-auth .ds-pf-wizard .ui-selectonemenu.ui-state-error,
body.ds-auth .ds-pf-wizard .ui-autocomplete .ui-state-error {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(222, 43, 75, 0.12) !important;
}

body.ds-auth .ds-pf-wizard .ds-field > .ui-outputlabel .ui-outputlabel-rfi,
body.ds-auth .ds-pf-wizard .ds-field > label .ui-outputlabel-rfi,
body.ds-auth .ds-pf-wizard span.ui-outputlabel-rfi {
  color: var(--danger) !important;
}

body.ds-auth .ds-pf-wizard .ui-outputlabel,
body.ds-auth .ds-pf-wizard label {
  font-family: var(--font-ui) !important;
  color: var(--text-secondary) !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
}

body.ds-auth .ds-pf-wizard .ui-inputfield,
body.ds-auth .ds-pf-wizard input.ui-inputfield,
body.ds-auth .ds-pf-wizard textarea.ui-inputfield,
body.ds-auth .ds-pf-wizard .ui-selectonemenu,
body.ds-auth .ds-pf-wizard .ui-selectonemenu .ui-selectonemenu-label,
body.ds-auth .ds-pf-wizard .ui-autocomplete-input {
  width: 100% !important;
  box-sizing: border-box !important;
  background: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-sm) !important;
  font-family: var(--font-ui) !important;
  font-size: 0.88rem !important;
  font-weight: 400 !important;
  color: var(--text-primary) !important;
  min-height: 40px !important;
  height: auto !important;
  line-height: 1.4 !important;
  padding: 11px 14px !important;
  margin: 0 !important;
  vertical-align: middle !important;
}

body.ds-auth .ds-pf-wizard .ui-inputfield:focus,
body.ds-auth .ds-pf-wizard input.ui-inputfield:focus,
body.ds-auth .ds-pf-wizard .ui-selectonemenu.ui-state-focus {
  border-color: var(--brand-violet) !important;
  box-shadow: var(--shadow-glow) !important;
}

body.ds-auth .ds-pf-wizard .ui-selectonemenu {
  display: block !important;
  position: relative !important;
  width: 100% !important;
  min-height: 40px !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

body.ds-auth .ds-pf-wizard .ui-selectonemenu .ui-selectonemenu-label {
  display: block !important;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 11px 40px 11px 14px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  line-height: 1.4 !important;
}

/* Chevron centralizado no dropdown (substitui Material Icons) */
body.ds-auth .ds-pf-wizard .ui-selectonemenu .ui-selectonemenu-trigger {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 40px !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

body.ds-auth .ds-pf-wizard .ui-selectonemenu .ui-selectonemenu-trigger .ui-icon {
  display: none !important;
}

body.ds-auth .ds-pf-wizard .ui-selectonemenu .ui-selectonemenu-trigger::after {
  content: "\f078"; /* fa-chevron-down */
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
  font-size: 0.75rem !important;
  color: var(--text-muted) !important;
  line-height: 1 !important;
  pointer-events: none;
}

body.ds-auth .ds-pf-wizard .ui-autocomplete {
  display: block !important;
  width: 100% !important;
  position: relative !important;
}

body.ds-auth .ds-pf-wizard .ui-autocomplete .ui-autocomplete-input {
  width: 100% !important;
  padding-right: 40px !important;
  box-sizing: border-box !important;
}

body.ds-auth .ds-pf-wizard .ui-autocomplete .ui-autocomplete-dropdown.ui-button {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 40px !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transform: none !important;
}

body.ds-auth .ds-pf-wizard .ui-autocomplete .ui-autocomplete-dropdown .ui-button-text,
body.ds-auth .ds-pf-wizard .ui-autocomplete .ui-autocomplete-dropdown .ui-icon {
  display: none !important;
}

body.ds-auth .ds-pf-wizard .ui-autocomplete .ui-autocomplete-dropdown.ui-button::after {
  content: "\f078"; /* fa-chevron-down */
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
  font-size: 0.75rem !important;
  color: var(--text-muted) !important;
  line-height: 1 !important;
  pointer-events: none;
}

/*
 * Painéis de lista (autocomplete / selectOneMenu) — espelham o dropdown do DS.
 * Referência: trial .form-control (campo) + cadastro .nav-dropdown-item (item/hover).
 * CNAE: painel absolute com width:auto crescia pelo max-content do itemLabel
 * ("codigo - descricao"); JS (bindDsCnaePanelWidth) fixa width = trigger
 * ANTES do align nativo e realinha 1x (evita collision:flip no 1º open).
 */
body.ds-auth .ui-autocomplete-panel,
body.ds-auth .ui-autocomplete-panel.ds-cnae-panel,
body.ds-auth .ui-selectonemenu-panel {
  max-height: 180px !important;
  height: auto !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-md) !important;
  background: var(--bg-surface) !important;
  font-family: var(--font-ui) !important;
  font-size: 0.88rem !important;
  box-sizing: border-box !important;
  padding: 4px 0 !important;
  z-index: 999999 !important;
}

/* CNAE: não maior que o campo; itens quebram linha (descrições longas). */
body.ds-auth .ui-autocomplete-panel.ds-cnae-panel {
  box-sizing: border-box !important;
  overflow-x: hidden !important;
}

body.ds-auth .ui-autocomplete-panel.ds-cnae-panel .ui-autocomplete-items,
body.ds-auth .ui-autocomplete-panel.ds-cnae-panel .ui-autocomplete-list {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

body.ds-auth .ui-autocomplete-panel .ui-autocomplete-items,
body.ds-auth .ui-autocomplete-panel .ui-autocomplete-list,
body.ds-auth .ui-selectonemenu-panel .ui-selectonemenu-items,
body.ds-auth .ui-selectonemenu-panel .ui-selectonemenu-list {
  padding: 0 !important;
  margin: 0 !important;
}

body.ds-auth .ui-autocomplete-panel .ui-autocomplete-item,
body.ds-auth .ui-autocomplete-panel .ui-autocomplete-list .ui-autocomplete-item,
body.ds-auth .ui-selectonemenu-panel .ui-selectonemenu-item {
  font-family: var(--font-ui) !important;
  font-size: 0.88rem !important;
  font-weight: 400 !important;
  color: var(--text-primary) !important;
  line-height: 1.4 !important;
  padding: 8px 12px !important;
  margin: 0 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  transition: background 0.15s, color 0.15s;
}

body.ds-auth .ui-autocomplete-panel .ui-autocomplete-item.ui-state-highlight,
body.ds-auth .ui-autocomplete-panel .ui-autocomplete-item:hover,
body.ds-auth .ui-autocomplete-panel .ui-autocomplete-list .ui-autocomplete-item.ui-state-highlight,
body.ds-auth .ui-autocomplete-panel .ui-autocomplete-list .ui-autocomplete-item:hover,
body.ds-auth .ui-selectonemenu-panel .ui-selectonemenu-item.ui-state-highlight,
body.ds-auth .ui-selectonemenu-panel .ui-selectonemenu-item:hover {
  background: rgba(140, 175, 61, 0.12) !important;
  color: var(--brand-violet) !important;
  border: none !important;
}

body.ds-auth .ds-pf-wizard .ui-panelgrid {
  margin-bottom: 8px !important;
}

body.ds-auth .ds-pf-wizard .ui-panelgrid .ui-panelgrid-cell {
  padding: 0 !important;
}

body.ds-auth .ds-terms-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

body.ds-auth .ds-terms-text,
body.ds-auth .ds-terms-text .ui-outputtext {
  font-size: 0.82rem !important;
  line-height: 1.5 !important;
  color: var(--text-secondary) !important;
}

body.ds-auth .ds-terms-link {
  color: var(--brand-violet) !important;
  font-weight: 700 !important;
  text-decoration: underline !important;
}

/* Checkbox “Li e concordo” — espelha .checkbox-row do DS trial */
body.ds-auth .ds-checkbox-row {
  display: flex !important;
  align-items: flex-start !important;
  gap: 10px !important;
  margin-top: 4px !important;
  margin-bottom: 8px !important;
}

body.ds-auth .ds-checkbox-row .ui-chkbox {
  flex: 0 0 auto !important;
  width: 16px !important;
  height: 16px !important;
  margin: 2px 0 0 0 !important;
  line-height: 16px !important;
  vertical-align: top !important;
}

body.ds-auth .ds-checkbox-row .ui-chkbox .ui-chkbox-box {
  width: 16px !important;
  height: 16px !important;
  border: 1.5px solid var(--border) !important;
  border-radius: 4px !important;
  background: var(--bg-surface) !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  margin: 0 !important;
  transition: background 0.15s, border-color 0.15s;
}

body.ds-auth .ds-checkbox-row .ui-chkbox .ui-chkbox-box.ui-state-active {
  background: var(--brand-violet) !important;
  border-color: var(--brand-violet) !important;
}

body.ds-auth .ds-checkbox-row .ui-chkbox .ui-chkbox-box.ui-state-focus {
  box-shadow: var(--shadow-glow) !important;
  border-color: var(--brand-violet) !important;
}

/* Substitui ícone Material quebrado do Ultima */
body.ds-auth .ds-checkbox-row .ui-chkbox .ui-chkbox-box .ui-chkbox-icon {
  font-size: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: none !important;
  text-indent: 0 !important;
}

body.ds-auth .ds-checkbox-row .ui-chkbox .ui-chkbox-box .ui-chkbox-icon.ui-icon-check::before,
body.ds-auth .ds-checkbox-row .ui-chkbox .ui-chkbox-box.ui-state-active .ui-chkbox-icon::before {
  content: "\f00c";
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
  font-size: 0.65rem !important;
  color: #FFFFFF !important;
  line-height: 1 !important;
}

body.ds-auth .ds-checkbox-row .ds-checkbox-label,
body.ds-auth .ds-checkbox-row label.ds-checkbox-label,
body.ds-auth .ds-checkbox-row .ui-outputlabel {
  font-size: 0.78rem !important;
  font-weight: 400 !important;
  color: var(--text-secondary) !important;
  line-height: 1.45 !important;
  margin: 0 !important;
  padding: 0 !important;
  cursor: pointer !important;
  flex: 1 1 auto !important;
}

/* Estado/Município disabled (preenchidos via CEP) — visual DS, não “quebrado” */
body.ds-auth .ds-pf-wizard .ui-selectonemenu.ui-state-disabled,
body.ds-auth .ds-pf-wizard .ui-selectonemenu.ui-state-disabled .ui-selectonemenu-label {
  opacity: 1 !important;
  background: var(--brand-offwhite) !important;
  color: var(--text-muted) !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
}

body.ds-auth .ds-pf-wizard .ui-selectonemenu.ui-state-disabled .ui-selectonemenu-trigger::after {
  color: var(--border) !important;
}

/* Trial footer: DS tipografia + link violet */
body.ds-auth .ds-trial-footer {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-family: var(--font-ui);
  line-height: 1.6;
  width: 100%;
}

body.ds-auth .ds-trial-footer .sugestao,
body.ds-auth .ds-trial-footer .copyright {
  text-align: center !important;
  padding: 0 !important;
  opacity: 1 !important;
  font-family: var(--font-ui) !important;
}

body.ds-auth .ds-trial-footer .sugestao {
  margin: 0 0 4px 0 !important;
  font-size: 0.72rem !important;
}

body.ds-auth .ds-trial-footer .sugestao a,
body.ds-auth .ds-trial-footer .sugestao .ui-commandlink,
body.ds-auth .ds-trial-footer .sugestao .ui-commandlink span,
body.ds-auth .ds-trial-footer .sugestao span,
body.ds-auth .ds-footer-sugestao-link,
body.ds-auth .ds-footer-sugestao-link span {
  color: var(--brand-violet) !important;
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  text-decoration: none !important;
  background: none !important;
  border: none !important;
  font-family: var(--font-ui) !important;
  line-height: 1.6 !important;
  transition: filter 0.15s;
}

body.ds-auth .ds-trial-footer .sugestao a:hover,
body.ds-auth .ds-trial-footer .sugestao .ui-commandlink:hover,
body.ds-auth .ds-footer-sugestao-link:hover,
body.ds-auth .ds-footer-sugestao-link:hover span {
  filter: brightness(0.85);
}

body.ds-auth .ds-trial-footer .copyright {
  color: var(--text-muted) !important;
  font-size: 0.72rem !important;
  font-weight: 400 !important;
  margin-top: 0 !important;
  line-height: 1.6 !important;
}

body.ds-auth .ds-trial-footer .copyright .fa,
body.ds-auth .ds-trial-footer .copyright .fa-copyright {
  display: none !important;
}

body.ds-auth .ds-erro-flow {
  background: #FDF2F4 !important;
  color: var(--text-primary) !important;
  border: 1px solid #F5C2CC !important;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  text-align: left;
  font-family: var(--font-ui) !important;
  font-size: 0.88rem !important;
  font-weight: 500 !important;
  line-height: 1.45 !important;
  box-shadow: var(--shadow-sm);
}

/* ========== GROWL / TOAST (PrimeFaces) ========== */
body.ds-auth .ui-growl {
  top: 24px !important;
  right: 24px !important;
  width: 360px !important;
  z-index: 999999 !important;
}

body.ds-auth .ui-growl > .ui-growl-item-container {
  opacity: 1 !important;
  background: var(--bg-surface) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-md) !important;
  font-family: var(--font-ui) !important;
  margin-bottom: 10px !important;
}

body.ds-auth .ui-growl > .ui-growl-item-container.ui-growl-error,
body.ds-auth .ui-growl > .ui-growl-item-container.ui-growl-fatal {
  background: #FDF2F4 !important;
  border-color: #F5C2CC !important;
}

body.ds-auth .ui-growl > .ui-growl-item-container.ui-growl-warn {
  background: #FFF8E8 !important;
  border-color: #F5E0A8 !important;
}

body.ds-auth .ui-growl > .ui-growl-item-container.ui-growl-info {
  background: #F4F8EC !important;
  border-color: #D4E5B0 !important;
}

body.ds-auth .ui-growl .ui-growl-item {
  display: flex !important;
  align-items: flex-start !important;
  gap: 12px !important;
  padding: 14px 40px 14px 16px !important;
  position: relative !important;
}

body.ds-auth .ui-growl .ui-growl-image {
  float: none !important;
  display: grid !important;
  place-items: center !important;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 50% !important;
  background: rgba(73, 71, 82, 0.06) !important;
  color: var(--text-secondary) !important;
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
  font-size: 1rem !important;
  line-height: 1 !important;
}

body.ds-auth .ui-growl .ui-growl-image-error,
body.ds-auth .ui-growl .ui-growl-image-fatal {
  background: rgba(222, 43, 75, 0.12) !important;
  color: var(--danger) !important;
}

body.ds-auth .ui-growl .ui-growl-image-warn {
  background: rgba(255, 193, 7, 0.18) !important;
  color: #B78103 !important;
}

body.ds-auth .ui-growl .ui-growl-image-info {
  background: rgba(140, 175, 61, 0.16) !important;
  color: var(--brand-violet) !important;
}

/* Substitui Material Icons quebrados por Font Awesome */
body.ds-auth .ui-growl .ui-growl-image:before {
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
  font-size: 1rem !important;
  line-height: 1 !important;
  display: block !important;
}

body.ds-auth .ui-growl .ui-growl-image-error:before,
body.ds-auth .ui-growl .ui-growl-image-fatal:before {
  content: "\f06a" !important; /* circle-exclamation */
  color: var(--danger) !important;
}

body.ds-auth .ui-growl .ui-growl-image-warn:before {
  content: "\f071" !important; /* triangle-exclamation */
  color: #B78103 !important;
}

body.ds-auth .ui-growl .ui-growl-image-info:before {
  content: "\f05a" !important; /* circle-info */
  color: var(--brand-violet) !important;
}

body.ds-auth .ui-growl .ui-growl-message {
  float: none !important;
  padding: 0 !important;
  flex: 1 1 auto !important;
  width: auto !important;
}

body.ds-auth .ui-growl .ui-growl-title {
  font-family: var(--font-ui) !important;
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
  display: block !important;
  margin: 0 0 2px 0 !important;
}

body.ds-auth .ui-growl .ui-growl-message p {
  font-family: var(--font-ui) !important;
  font-size: 0.82rem !important;
  font-weight: 400 !important;
  color: var(--text-secondary) !important;
  line-height: 1.4 !important;
  margin: 0 !important;
}

body.ds-auth .ui-growl .ui-growl-icon-close {
  position: absolute !important;
  top: 10px !important;
  right: 10px !important;
  float: none !important;
  width: 20px !important;
  height: 20px !important;
  margin: 0 !important;
  border-radius: 50% !important;
  background: transparent !important;
  color: var(--text-muted) !important;
  cursor: pointer !important;
}

body.ds-auth .ui-growl .ui-growl-icon-close:before {
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
  content: "\f00d" !important;
  font-size: 0.75rem !important;
  color: var(--text-muted) !important;
}

/* ========== SUCCESS ========== */
body.ds-auth.ds-success-page {
  background: radial-gradient(circle at 0% 0%, #edf4db 0%, var(--brand-offwhite) 50%, #e2e6eb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

body.ds-auth .success-card {
  text-align: center;
  padding: 40px 36px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  max-width: 420px;
  width: 100%;
}

body.ds-auth .success-icon-box {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success);
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  margin: 0 auto 20px;
  border: 1.5px solid rgba(15, 169, 104, 0.15);
}

body.ds-auth .success-card h1,
body.ds-auth .success-card h2 {
  font-family: var(--font-display);
  color: var(--brand-purple-deep);
  font-size: 1.4rem;
  margin: 0 0 8px 0;
}

body.ds-auth .success-card .exception-detail,
body.ds-auth .success-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0 0 24px 0;
}

/* Sucesso inline no trial (DS form-step-3) */
body.ds-auth.ds-trial-page .ds-trial-success {
  width: 100%;
  min-width: 0;
}

body.ds-auth.ds-trial-page .ds-trial-success .success-card {
  max-width: none;
  width: 100%;
  padding: 8px 0 0;
  border: none;
  box-shadow: none;
  background: transparent;
}

body.ds-auth.ds-trial-page .ds-trial-success-title h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}

body.ds-auth.ds-trial-page .ds-trial-success-title p {
  margin: 0 0 12px 0;
}

body.ds-auth.ds-trial-page .ds-trial-success-hint {
  font-size: 0.82rem !important;
  color: var(--text-muted) !important;
  margin: 0 0 24px 0 !important;
}

body.ds-auth.ds-trial-page .ds-trial-success-actions {
  margin-top: 8px;
}

body.ds-auth.ds-trial-page .ds-trial-success-actions .ui-button.btn-submit {
  width: 100%;
}

/* ========== FORGOT PASSWORD DIALOG ========== */
/* DS login não tem modal de reset; alinhamos ao vocabulário do card de auth. */
body.ds-auth .ui-dialog.ds-forgot-dialog,
body.ds-auth .ui-dialog.ui-confirm-dialog.ds-forgot-dialog {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-md) !important;
  background: var(--bg-surface) !important;
  font-family: var(--font-ui) !important;
  width: 90% !important;
  max-width: 420px !important;
  padding: 0 !important;
  overflow: hidden;
}

body.ds-auth .ui-dialog.ds-forgot-dialog .ui-dialog-titlebar {
  background: var(--bg-surface) !important;
  background-image: none !important;
  border: none !important;
  border-bottom: 1px solid var(--border) !important;
  border-radius: 0 !important;
  padding: 18px 24px !important;
  color: var(--brand-purple-deep) !important;
  font-family: var(--font-ui) !important;
}

body.ds-auth .ui-dialog.ds-forgot-dialog .ui-dialog-title {
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  color: var(--brand-purple-deep) !important;
  font-family: var(--font-ui) !important;
  margin: 0 !important;
  padding-right: 36px !important;
}

/* X de fechar: esconde Material quebrado; FA6 (igual sugestão/growl) */
body.ds-auth .ui-dialog.ds-forgot-dialog .ui-dialog-titlebar-close,
body.ds-auth .ui-dialog.ds-forgot-dialog .ui-dialog-titlebar-icon.ui-dialog-titlebar-close {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 28px !important;
  height: 28px !important;
  background: transparent !important;
  border: none !important;
  border-radius: 6px !important;
  color: var(--text-muted) !important;
  right: 14px !important;
  top: 50% !important;
  margin-top: -14px !important;
  opacity: 1 !important;
  visibility: visible !important;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

body.ds-auth .ui-dialog.ds-forgot-dialog .ui-dialog-titlebar-close .ui-icon,
body.ds-auth .ui-dialog.ds-forgot-dialog .ui-dialog-titlebar-close .ui-icon-closethick {
  display: none !important;
}

body.ds-auth .ui-dialog.ds-forgot-dialog .ui-dialog-titlebar-close::after {
  content: "\f00d"; /* fa-xmark */
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
  font-size: 0.85rem !important;
  line-height: 1 !important;
  color: inherit !important;
  pointer-events: none;
}

body.ds-auth .ui-dialog.ds-forgot-dialog .ui-dialog-titlebar-close:hover {
  color: var(--brand-violet) !important;
  background: rgba(140, 175, 61, 0.12) !important;
}

body.ds-auth .ui-dialog.ds-forgot-dialog .ui-dialog-content {
  background: var(--bg-surface) !important;
  border: none !important;
  padding: 24px 24px 8px 24px !important;
  font-family: var(--font-ui) !important;
  color: var(--text-secondary) !important;
}

body.ds-auth .ui-dialog.ds-forgot-dialog .ui-confirm-dialog-severity,
body.ds-auth .ui-dialog.ds-forgot-dialog .ui-confirm-dialog-icon {
  display: none !important;
}

body.ds-auth .ui-dialog.ds-forgot-dialog .ui-confirm-dialog-message {
  display: block !important;
  margin: 0 0 20px 0 !important;
  padding: 0 !important;
  font-size: 0.85rem !important;
  line-height: 1.45 !important;
  color: var(--text-secondary) !important;
  font-family: var(--font-ui) !important;
}

body.ds-auth .ui-dialog.ds-forgot-dialog .ds-form-group {
  margin: 0;
}

body.ds-auth .ui-dialog.ds-forgot-dialog .ui-dialog-buttonpane,
body.ds-auth .ui-dialog.ds-forgot-dialog .ui-dialog-footer {
  display: block !important;
  background: var(--bg-surface) !important;
  border: none !important;
  border-top: none !important;
  padding: 0 24px 24px 24px !important;
  text-align: left !important;
  margin: 0 !important;
}

body.ds-auth .ui-dialog.ds-forgot-dialog .ds-forgot-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: 20px;
}

body.ds-auth .ui-dialog.ds-forgot-dialog .ui-button.btn-submit,
body.ds-auth .ui-dialog.ds-forgot-dialog .ui-button.btn-secondary-action {
  margin-top: 0 !important;
}

body.ds-auth .ui-widget-overlay {
  background: rgba(73, 71, 82, 0.45) !important;
  opacity: 1 !important;
}

/* Loader (antes em lume.css) — mínimo para dialog loading das auth */
body.ds-auth .loader {
  border: 16px solid #f3f3f3;
  border-top: 16px solid #8EB13D;
  border-radius: 50%;
  width: 120px;
  height: 120px;
  animation: ds-auth-spin 2s linear infinite;
  margin: 0 auto;
}

@keyframes ds-auth-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

body.ds-auth .dialogLoader {
  width: 300px !important;
  height: 300px !important;
  background-color: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

body.ds-auth .dialogLoader .ui-dialog-content {
  text-align: center;
}

@media (max-width: 980px) {
  body.ds-auth .split-layout {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
  }

  body.ds-auth .marketing-panel {
    padding: 32px 20px;
    justify-content: flex-start;
  }

  body.ds-auth .hero-content {
    margin: 20px 0;
    max-width: 100%;
  }

  body.ds-auth .hero-content h1 {
    font-size: 1.75rem;
  }

  body.ds-auth .form-panel {
    padding: 32px 20px;
    justify-content: flex-start;
  }

  body.ds-auth .wizard-steps {
    gap: 8px;
    flex-wrap: wrap;
    overflow-x: visible;
  }

  body.ds-auth .wizard-step {
    font-size: 0.72rem;
    flex: 0 1 auto;
  }

  body.ds-auth .step-line {
    display: none;
  }

  body.ds-auth .ds-trial-footer .sugestao,
  body.ds-auth .ds-trial-footer .sugestao a,
  body.ds-auth .ds-trial-footer .sugestao .ui-commandlink,
  body.ds-auth .ds-footer-sugestao-link {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}
