@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,400..700;1,14..32,400..700&family=JetBrains+Mono:wght@400;500&display=swap');

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: #F4F3F0;
}

#register-screen,
#verify-account-screen {
  --reg-font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --reg-font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --reg-bg: #F4F3F0;
  --reg-card: #FFFFFF;
  --reg-card-border: rgba(23, 26, 32, 0.07);
  --reg-confirm-bg: #FAFAFB;
  --reg-text: #171A20;
  --reg-label: #1A1D23;
  --reg-text-soft: #5A6069;
  --reg-body-alt: #43474E;
  --reg-hint: #8A919C;
  --reg-muted: #9AA1AB;
  --reg-placeholder: #A9AFB9;
  --reg-primary: #F96A00;
  --reg-primary-hover: #E25F00;
  --reg-link: #E05F00;
  --reg-link-hover: #BF5100;
  --reg-success: #0A7C3A;
  --reg-success-bg: rgba(10, 124, 58, 0.1);
  --reg-error: #DC3D43;
  --reg-error-bg: #fef2f2;
  --reg-border: #DBDEE3;
  --reg-border-focus: #F96A00;
  --reg-divider: #ECEDEF;
  --reg-chip-bg: #F4F5F7;
  --reg-chip-text: #6A717C;
  --reg-disabled: #9AA0A8;
  --reg-radius-sm: 10px;
  --reg-radius-md: 12px;
  --reg-radius: 20px;
  --reg-shadow: 0 1px 2px rgba(23, 26, 32, 0.05), 0 16px 40px -12px rgba(23, 26, 32, 0.12);
  --reg-shadow-cta: 0 8px 20px -8px rgba(249, 106, 0, 0.55);
  --reg-focus-ring: 0 0 0 3px rgba(249, 106, 0, 0.15);
  --reg-ease: ease;
  --reg-duration: 0.2s;
  --primaryColor: #F96A00;
  --darkColor: #171A20;
  --backgroundColor: #F4F3F0;
  --lightColor: #F4F5F7;
  --primaryTextColor: #ffffff;
}

#register-screen,
#verify-account-screen {
  font-family: var(--reg-font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  box-sizing: border-box;
}

#register-screen {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  box-sizing: border-box;
  background: var(--reg-bg);
}

#register-screen form.register-card {
  width: 100%;
  max-width: 540px;
  border: 1px solid var(--reg-card-border);
  border-radius: var(--reg-radius);
  box-shadow: var(--reg-shadow);
  background: var(--reg-card);
  padding: 36px;
  animation: reg-card-in 0.3s var(--reg-ease) both;
}

/* O style.css legado força flex/width 400px no form.register-card;
   o novo card do cadastro precisa de fluxo em bloco. */
#register-screen form#register-form.register-card {
  display: block;
  overflow: visible;
  width: 100%;
  max-width: 560px;
}

@keyframes reg-card-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Cabeçalho compartilhado dos cards novos ---------- */

#register-screen .reg-logo,
#verify-account-screen .reg-logo {
  height: 28px;
  display: block;
}

#register-screen .reg-title,
#verify-account-screen .reg-title {
  margin: 20px 0 4px;
  font-family: var(--reg-font-body);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--reg-text);
}

#register-screen .reg-subtitle,
#verify-account-screen .reg-subtitle {
  margin: 0 0 24px;
  font-family: var(--reg-font-body);
  font-size: 14.5px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--reg-text-soft);
}

#verify-account-screen .reg-subtitle { margin-bottom: 18px; }

/* ---------- Grid do cadastro ---------- */

#register-screen .reg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 14px;
}

#register-screen .reg-grid .custom-field { margin-bottom: 0; }
#register-screen .reg-grid .custom-field.full-row { grid-column: 1 / -1; }

#register-screen .reg-divider {
  height: 1px;
  background: var(--reg-divider);
  margin: 22px 0;
}

#register-screen .reg-section-title {
  margin: 0 0 14px;
  font-family: var(--reg-font-body);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--reg-text);
}

/* ---------- Campos ---------- */

#register-screen form.register-card .custom-field {
  margin-bottom: 12px;
}

#register-screen form.register-card .custom-field label {
  font-family: var(--reg-font-body);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--reg-label);
  margin-bottom: 7px;
  display: block;
}

#register-screen form.register-card .custom-field input,
#register-screen form.register-card .custom-field select {
  font-family: var(--reg-font-body);
  font-size: 15px;
  font-weight: 400;
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--reg-border);
  border-radius: var(--reg-radius-sm);
  background: var(--reg-card);
  color: var(--reg-text);
  transition: border-color var(--reg-duration) var(--reg-ease),
    box-shadow var(--reg-duration) var(--reg-ease);
}

/* Login/recovery mantêm os ícones dentro do campo */
#register-screen form.register-card .custom-field .input-icon-container.icon-start input,
#register-screen form.register-card .custom-field .input-icon-container.icon-start select {
  padding-left: 42px;
}

#register-screen form.register-card .custom-field select {
  padding-right: 36px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6L8 10L12 6' stroke='%238A919C' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

#register-screen form.register-card .custom-field select:has(option[value='']:checked) {
  color: var(--reg-placeholder);
}

#register-screen form.register-card .custom-field input:focus,
#register-screen form.register-card .custom-field select:focus {
  outline: none;
  border-color: var(--reg-border-focus);
  box-shadow: var(--reg-focus-ring);
}

#register-screen form.register-card .custom-field input::placeholder {
  color: var(--reg-placeholder);
}

#register-screen form.register-card .custom-field.has-error input,
#register-screen form.register-card .custom-field.has-error select,
#register-screen form.register-card div.info div.custom-field.has-error input,
#register-screen form.register-card div.info div.custom-field.has-error select {
  border-color: var(--reg-error);
  background: var(--reg-card);
}

#register-screen form.register-card .custom-field div.input-icon-container.icon-start img {
  opacity: 0.5;
}

#register-screen form.register-card .custom-field p.error-message {
  font-family: var(--reg-font-body);
  font-size: 13.5px;
  color: var(--reg-error);
  margin: 6px 0 0;
  font-weight: 500;
}

#register-screen form.register-card .custom-field p.error-message:empty {
  display: none;
  margin: 0;
}

/* ---------- Tipo de produto ---------- */

#register-screen form.register-card fieldset.operation-type {
  border: 0;
  margin: 0;
  padding: 0;
  min-inline-size: 0;
}

#register-screen form.register-card fieldset.operation-type legend {
  font-family: var(--reg-font-body);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--reg-label);
  margin-bottom: 10px;
  padding: 0;
}

#register-screen .operation-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

#register-screen form.register-card fieldset.operation-type .operation-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--reg-font-body);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--reg-text);
  cursor: pointer;
}

#register-screen form.register-card .operation-option input[type="radio"] {
  appearance: auto;
  -webkit-appearance: auto;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  flex: none;
  accent-color: var(--reg-primary);
  border: 0;
  background: transparent;
  box-shadow: none;
}

#register-screen form.register-card .operation-option input[type="radio"]:focus-visible {
  outline: none;
  box-shadow: var(--reg-focus-ring);
  border-radius: 50%;
}

#register-screen form.register-card .custom-field.has-error .operation-option input[type="radio"] {
  outline: 2px solid var(--reg-error);
  outline-offset: 2px;
  background: transparent;
}

#register-screen form.register-card .custom-field p.description,
#register-screen form.register-card .custom-field p.field-hint {
  font-family: var(--reg-font-body);
  font-size: 12.5px;
  font-weight: 400;
  color: var(--reg-hint);
  margin: 6px 0 0;
  line-height: 1.4;
}

/* ---------- Senha: toggle interno + chips ---------- */

#register-screen .password-wrap {
  position: relative;
}

#register-screen .password-wrap input {
  padding-right: 78px;
}

#register-screen .custom-field .toggle-password {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--reg-font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--reg-text-soft);
  background: transparent;
  border: none;
  border-radius: 6px;
  /* padding garante área de toque >= 44px sem mudar o visual */
  padding: 14px 10px;
  cursor: pointer;
  transition: color var(--reg-duration) var(--reg-ease);
}

#register-screen .custom-field .toggle-password:hover {
  color: var(--reg-text);
  background: transparent;
}

#register-screen .custom-field .toggle-password:focus-visible {
  outline: 2px solid rgba(249, 106, 0, 0.4);
  outline-offset: 0;
}

#register-screen form.register-card ul.password-criteria {
  list-style: none;
  display: flex;
  gap: 6px;
  margin: 6px 0 0;
  padding: 0;
}

#register-screen form.register-card ul.password-criteria li {
  font-family: var(--reg-font-body);
  font-size: 11.5px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--reg-chip-bg);
  color: var(--reg-chip-text);
  transition: background var(--reg-duration) var(--reg-ease),
    color var(--reg-duration) var(--reg-ease);
}

#register-screen form.register-card ul.password-criteria li.valid {
  background: var(--reg-success-bg);
  color: var(--reg-success);
}

#register-screen form.register-card ul.password-criteria li.valid::before {
  content: "\2713 ";
}

/* ---------- CTA primário (novo padrão das duas telas) ---------- */

#register-screen .reg-cta,
#verify-account-screen .reg-cta {
  width: 100%;
  height: 52px;
  border: none;
  border-radius: var(--reg-radius-md);
  background: var(--reg-primary);
  color: #FFFFFF;
  font-family: var(--reg-font-body);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--reg-shadow-cta);
  transition: background var(--reg-duration) var(--reg-ease),
    box-shadow var(--reg-duration) var(--reg-ease);
}

#register-screen .reg-cta:not(:disabled):hover,
#verify-account-screen .reg-cta:not(:disabled):hover {
  background: var(--reg-primary-hover);
}

#register-screen .reg-cta:disabled,
#verify-account-screen .reg-cta:disabled {
  background: var(--reg-disabled);
  cursor: not-allowed;
  box-shadow: none;
}

#register-screen .reg-cta:focus-visible,
#verify-account-screen .reg-cta:focus-visible {
  outline: none;
  box-shadow: var(--reg-focus-ring), var(--reg-shadow-cta);
}

#register-screen #register-form .reg-cta { margin-top: 24px; }

#register-screen .reg-login-line {
  margin: 16px 0 0;
  text-align: center;
  font-family: var(--reg-font-body);
  font-size: 14px;
  font-weight: 400;
  color: var(--reg-text-soft);
}

#register-screen .reg-login-line a {
  color: var(--reg-link);
  font-weight: 600;
  text-decoration: none;
  padding: 12px 4px;
}

#register-screen .reg-login-line a:hover {
  color: var(--reg-link-hover);
}

/* ---------- Botões legados (login / recovery) ---------- */

#register-screen .default-button.dark,
#register-screen .default-button.medium.dark {
  font-family: var(--reg-font-body);
  font-size: 15px;
  font-weight: 600;
  height: 46px;
  padding: 0 24px;
  margin-top: 4px;
  border-radius: var(--reg-radius-sm);
  background: var(--reg-primary);
  color: #ffffff;
  border: none;
  transition: background var(--reg-duration) var(--reg-ease),
    box-shadow var(--reg-duration) var(--reg-ease);
}

#register-screen .default-button.dark:not(:disabled):hover,
#register-screen .default-button.medium.dark:not(:disabled):hover {
  background: var(--reg-primary-hover);
  opacity: 1;
  box-shadow: none;
}

#register-screen .default-button.light {
  background: var(--reg-card);
  border: 1px solid var(--reg-border);
  color: var(--reg-text);
  font-weight: 600;
}

#register-screen .default-button.light:not(:disabled):hover {
  border-color: var(--reg-primary);
  background: var(--reg-bg);
  opacity: 1;
}

#submit-button-component .default-button {
  border-radius: var(--reg-radius-sm);
}

#register-screen .link-button,
#register-screen a.link-button {
  font-family: var(--reg-font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--reg-text-soft);
  text-decoration: none;
  transition: color var(--reg-duration) var(--reg-ease);
}

#register-screen .link-button:hover,
#register-screen a.link-button:hover {
  color: var(--reg-link);
}

#register-screen .link-button img,
#register-screen a.link-button img {
  vertical-align: middle;
  margin-left: 4px;
}

#register-screen .auth-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

#register-screen .auth-links .link-button { margin-top: 0; }

#register-screen .auth-description {
  font-size: 14px;
  color: var(--reg-text-soft);
  line-height: 1.45;
  margin: 0 0 14px;
}

#register-screen .auth-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

#register-screen .auth-actions .default-button {
  min-width: 160px;
}

/* Estruturas legadas (login/recovery) */
#register-screen form.register-card div.logo-container {
  margin-bottom: 16px;
  text-align: center;
}

#register-screen form.register-card div.logo-container img {
  max-width: 180px;
  max-height: 40px;
}

#register-screen form.register-card div.header-container {
  margin-bottom: 18px;
  text-align: center;
}

#register-screen form.register-card div.header-container h2 {
  font-family: var(--reg-font-body);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--reg-text);
  margin: 0;
}

#register-screen form.register-card .fields-container {
  text-align: left;
}

#register-screen form.register-card .info-wrapper > a.link-button {
  margin-top: 10px;
  display: block;
  text-align: center;
  color: var(--reg-text-soft);
  font-size: 14px;
}

/* ---------- Mensagens de formulário ---------- */

.form-message {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  color: #5A6069;
  margin-top: 8px;
  min-height: 18px;
}

.form-message.error { color: #DC3D43; }
.form-message.success { color: #0A7C3A; }

/* ---------- Tela de verificação ---------- */

#verify-account-screen {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  padding: 28px 20px;
  background: var(--reg-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#verify-account-screen .verify-card {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  border: 1px solid var(--reg-card-border);
  border-radius: var(--reg-radius);
  box-shadow: var(--reg-shadow);
  background: var(--reg-card);
  padding: 36px;
  animation: reg-card-in 0.3s var(--reg-ease) both;
}

#verify-account-screen form { width: 100%; }

#verify-account-screen .confirm-box {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 14px 16px;
  background: var(--reg-confirm-bg);
  border-radius: var(--reg-radius-md);
  margin: 0 0 22px;
}

#verify-account-screen .confirm-box svg { flex: none; }

#verify-account-screen .confirm-box .confirm-text {
  flex: 1;
  font-family: var(--reg-font-body);
  font-size: 13.5px;
  font-weight: 450;
  line-height: 1.5;
  color: var(--reg-body-alt);
}

#verify-account-screen .confirm-box .confirm-text strong {
  color: var(--reg-text);
  font-weight: 600;
}

#verify-account-screen .confirm-box a.confirm-edit {
  flex: none;
  font-family: var(--reg-font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--reg-link);
  text-decoration: none;
  padding: 14px 6px;
  margin: -14px -6px;
}

#verify-account-screen .confirm-box a.confirm-edit:hover {
  color: var(--reg-link-hover);
}

#verify-account-screen .custom-field.code-input { width: 100%; margin: 0; }

#verify-account-screen .custom-field.code-input label {
  font-family: var(--reg-font-body) !important;
  display: block;
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1.2;
  color: var(--reg-label);
  margin: 0 0 10px;
}

#verify-account-screen .otp-boxes {
  display: flex;
  gap: 8px;
}

#verify-account-screen .otp-boxes .otp-box {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 58px;
  padding: 0;
  text-align: center;
  font-family: var(--reg-font-mono) !important;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--reg-text);
  border: 1px solid var(--reg-border);
  border-radius: var(--reg-radius-sm);
  background: var(--reg-card);
  caret-color: var(--reg-primary);
  transition: border-color var(--reg-duration) var(--reg-ease),
    box-shadow var(--reg-duration) var(--reg-ease);
}

@keyframes otp-caret-blink {
  0%, 49% { caret-color: var(--reg-primary); }
  50%, 100% { caret-color: transparent; }
}

#verify-account-screen .otp-boxes .otp-box:focus {
  outline: none;
  border: 1.5px solid var(--reg-primary);
  box-shadow: var(--reg-focus-ring);
  animation: otp-caret-blink 1.1s step-end infinite;
}

#verify-account-screen .otp-boxes .otp-box:disabled {
  background: var(--reg-confirm-bg);
  color: var(--reg-muted);
  cursor: not-allowed;
}

#verify-account-screen .otp-boxes.has-error .otp-box {
  border-color: var(--reg-error);
}

#verify-account-screen .otp-boxes.shake {
  animation: otp-shake 0.3s var(--reg-ease);
}

@keyframes otp-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

#verify-account-screen .custom-field.code-input .description {
  font-family: var(--reg-font-body) !important;
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--reg-hint);
  margin: 10px 0 0;
}

#verify-account-screen .custom-field.code-input p.error-message {
  font-family: var(--reg-font-body);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--reg-error);
  margin: 8px 0 0;
}

#verify-account-screen .custom-field.code-input p.error-message:empty {
  display: none;
  margin: 0;
}

#verify-account-screen .resend-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0 0;
  width: 100%;
}

#verify-account-screen .resend-line .resend-ask {
  font-family: var(--reg-font-body);
  font-size: 14px;
  font-weight: 400;
  color: var(--reg-hint);
}

#verify-account-screen .countdown-message {
  font-family: var(--reg-font-body) !important;
  font-size: 14px;
  font-weight: 500;
  color: var(--reg-muted);
  margin: 0;
}

#verify-account-screen .countdown-message[hidden] { display: none; }

#verify-account-screen .resend-link {
  font-family: var(--reg-font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--reg-link);
  background: transparent;
  border: none;
  padding: 12px 4px;
  margin: -12px -4px;
  cursor: pointer;
}

#verify-account-screen .resend-link:hover { color: var(--reg-link-hover); }
#verify-account-screen .resend-link[hidden] { display: none; }
#verify-account-screen .resend-link:disabled { color: var(--reg-muted); cursor: not-allowed; }

#verify-account-screen .reg-cta { margin-top: 24px; }

#verify-account-screen .form-message {
  width: 100%;
  margin-top: 12px;
  margin-bottom: 0;
}

#verify-account-screen .form-message:empty { margin: 0; min-height: 0; }

#verify-account-screen #captcha-container.captcha-on-background {
  margin-top: 20px;
  text-align: center;
  min-height: 0;
  /* o badge do reCAPTCHA tem 256px fixos; contê-lo evita scroll horizontal no mobile */
  max-width: 100%;
  overflow: hidden;
}
#verify-account-screen #captcha-container.captcha-on-background > div {
  display: inline-flex;
  justify-content: center;
}

/* ---------- Loading dots (componente legado) ---------- */

#submit-button-component .dot-flashing,
#submit-button-component .dot-flashing:before,
#submit-button-component .dot-flashing:after {
  background-color: var(--reg-primary);
  color: var(--reg-primary);
}

/* ---------- Redirect (index.html) ---------- */

#register-screen.reg-redirect { padding: 28px 20px; }

.reg-redirect-card {
  background: #FFFFFF;
  border: 1px solid rgba(23, 26, 32, 0.07);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(23, 26, 32, 0.05), 0 16px 40px -12px rgba(23, 26, 32, 0.12);
  padding: 52px 48px;
  text-align: center;
  max-width: 440px;
  width: 100%;
  animation: reg-card-in 0.3s ease both;
}

.reg-redirect-card p {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  color: #5A6069;
  margin: 0 0 20px;
  line-height: 1.5;
}

.reg-redirect-card p a {
  color: #E05F00;
  font-weight: 600;
  text-decoration: none;
}

.reg-redirect-card p a:hover { text-decoration: underline; }

.reg-redirect-spinner {
  width: 28px;
  height: 28px;
  margin: 0 auto 16px;
  border: 3px solid #DBDEE3;
  border-top-color: #F96A00;
  border-radius: 50%;
  animation: reg-spin 0.8s linear infinite;
}

@keyframes reg-spin {
  to { transform: rotate(360deg); }
}

/* ---------- Responsivo ---------- */

@media (max-width: 520px) {
  #register-screen { padding: 20px 16px; }
  #register-screen form.register-card,
  #verify-account-screen .verify-card {
    padding: 28px 20px;
  }
  #register-screen .reg-grid {
    grid-template-columns: 1fr;
  }
  #register-screen .operation-options {
    gap: 12px 16px;
  }
}

/* ---------- Movimento reduzido ---------- */

@media (prefers-reduced-motion: reduce) {
  #register-screen form.register-card,
  #verify-account-screen .verify-card,
  .reg-redirect-card {
    animation: none;
  }
  #verify-account-screen .otp-boxes.shake,
  #verify-account-screen .otp-boxes .otp-box:focus {
    animation: none;
  }
}
