/* =========================================================
   CADASTRO PROFISSIONAL — usa base.css (design system)
   Overrides estruturais desta página (form largura própria)
   ========================================================= */

:root {
  --container-width: 57.5rem;
  --form-width: 47.5rem;
  --placeholder: var(--text-muted);
}

/* ========================================================= LAYOUT GERAL ========================================================= */

.layout-container {
  width: var(--shell);
  margin: 0 auto;
}

.layout-section-register {
  padding: 2rem 0 2.75rem;
}

.layout-register-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

/* ========================================================= TOPO DO FORMULÁRIO ========================================================= */

.component-section-header h1 {
  font-size: clamp(1.9rem, 2.6vw, 2.6rem);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--brand-ink);
  margin-bottom: 0.75rem;
}

.component-section-header-left {
  text-align: center;
}

.component-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
  padding: 0.4rem 0.95rem;
  border-radius: var(--r-pill);
  background: rgba(0, 101, 78, 0.07);
  border: 1px solid rgba(0, 101, 78, 0.14);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand-teal-500);
}

.component-tag::before {
  content: "";
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: var(--grad-gold);
}

.component-description {
  max-width: 42.5rem;
  margin: 0 auto;
  font-size: clamp(1rem, 1.15vw, 1.05rem);
  line-height: 1.45;
  color: var(--text-secondary);
}

/* ========================================================= CARD DO FORMULÁRIO ========================================================= */

.component-register-card {
  position: relative;
  width: 100%;
  max-width: var(--form-width);
  background: var(--grad-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-premium), var(--card-highlight);
  padding: 2.4rem 2.5rem 2.2rem;
  overflow: hidden;
  isolation: isolate;
}

/* Fio teal→dourado no topo do card — acento premium discreto */
.component-register-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--grad-line);
  opacity: 0.5;
  transition: opacity 0.45s ease;
}

.component-register-card:hover::before {
  opacity: 1;
}

.component-form {
  width: 100%;
}

/* ========================================================= TÍTULOS DAS SEÇÕES ========================================================= */

.component-form-title {
  position: relative;
  text-align: center;
  font-size: clamp(1.15rem, 1.6vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--brand-ink);
  margin: 0 0 1.3rem;
  padding-bottom: 0.85rem;
}

.component-form-title:not(:first-child) {
  margin-top: 2.1rem;
}

.component-form-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--border-color);
}

/* Fio dourado-teal fino, centralizado, como acento discreto */
.component-form-title::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -0.5px;
  transform: translateX(-50%);
  width: 3rem;
  height: 2px;
  border-radius: 2px;
  background: var(--grad-line);
}

/* ========================================================= GRID ========================================================= */

.layout-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem 1rem;
  margin-bottom: 0.9rem;
}

/* ========================================================= CAMPOS ========================================================= */

.component-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  margin-bottom: 0.95rem;
}

.component-input-group label {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-label);
  text-align: center;
}

.component-form .component-input-group label {
  text-align: left;
}

.layout-form-grid .component-input-group label {
  text-align: center;
}

.layout-form-grid .component-input-group input,
.layout-form-grid .component-input-group select {
  text-align: left;
}

.component-input-group input,
.component-input-group select,
.component-input-group textarea {
  width: 100%;
  min-height: 2.4375rem;
  height: 2.4375rem;
  padding: 0.62rem 0.82rem;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-input);
  background: var(--surface);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--ease-premium), box-shadow var(--ease-premium);
  appearance: none;
  font-size: 0.9rem;
}

.component-input-group textarea {
  min-height: 6.25rem;
  height: auto;
  resize: vertical;
}

.component-input-group input::placeholder,
.component-input-group textarea::placeholder {
  color: var(--placeholder);
}

.component-input-group input:focus,
.component-input-group select:focus,
.component-input-group textarea:focus {
  border-color: var(--brand-teal);
  box-shadow: var(--ring-teal);
}

.component-input-group select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%),
    linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 13px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2.3rem;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

/* ========================================================= BOTÃO ========================================================= */

.button-primary {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: var(--radius-button);
  background: var(--grad-navy);
  color: #ffffff;
  font-size: 0.96rem;
  font-weight: 700;
  margin-top: 0.5rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), var(--shadow-md);
  transition: transform var(--ease-premium), box-shadow var(--ease-premium), filter var(--ease-premium);
  cursor: pointer;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.button-primary i,
.button-primary svg {
  width: 1.125rem;
  height: 1.125rem;
  stroke-width: 2.4;
}

.button-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), var(--shadow-lg);
}

/* ========================================================= TERMOS DE USO ========================================================= */

.terms-check {
  width: 100%;
  min-height: 2.625rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.78rem 0.95rem;
  margin: 0.35rem 0 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--ease-premium), background var(--ease-premium);
}

.terms-check:hover {
  border-color: var(--brand-muted);
  background: var(--surface-alt);
}

.terms-check input {
  display: none;
}

.terms-check-icon {
  position: relative;
  width: 1.0625rem;
  height: 1.0625rem;
  min-width: 1.0625rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--grad-teal);
  color: #ffffff;
  box-shadow: var(--tile-shadow);
}

.terms-check-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.28);
  pointer-events: none;
}

.terms-check-icon i,
.terms-check-icon svg {
  width: 0.75rem;
  height: 0.75rem;
  stroke-width: 3;
}

.terms-link {
  border: none;
  background: transparent;
  color: var(--brand-teal);
  font-weight: 800;
  cursor: pointer;
  padding: 0;
  font-size: inherit;
}

.terms-link:hover {
  text-decoration: underline;
}

/* ========================================================= MODAL TERMOS DE USO ========================================================= */

body.modal-open {
  overflow: hidden;
}

.terms-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(14, 31, 51, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.terms-modal-overlay.is-active {
  display: flex;
}

.terms-modal {
  position: relative;
  width: min(100%, 41.875rem);
  max-height: 86vh;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2xl), var(--card-highlight);
  overflow: hidden;
}

.terms-modal-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 2;
  width: 1.6875rem;
  height: 1.6875rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--brand-muted);
  border-radius: 50%;
  background: var(--surface);
  color: var(--brand-teal);
  cursor: pointer;
  transition: background var(--ease-premium), transform var(--ease-premium);
}

.terms-modal-close:hover {
  background: var(--brand-light);
  transform: scale(1.04);
}

.terms-modal-close i,
.terms-modal-close svg {
  width: 1.0625rem;
  height: 1.0625rem;
  stroke-width: 2.4;
}

.terms-modal-content {
  max-height: 86vh;
  overflow-y: auto;
  padding: 1.6rem 1.6rem 1.8rem;
  color: var(--text-primary);
}

.terms-modal-content h2 {
  font-size: 1.55rem;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
  color: var(--brand-ink);
}

.terms-modal-updated {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.2rem;
}

.terms-modal-content h3 {
  font-size: 1rem;
  line-height: 1.35;
  font-weight: 800;
  margin: 1.25rem 0 0.35rem;
  color: var(--brand-ink);
}

.terms-modal-content p {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.terms-modal-content::-webkit-scrollbar {
  width: 0.5625rem;
}

.terms-modal-content::-webkit-scrollbar-track {
  background: var(--surface-alt);
}

.terms-modal-content::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 1.25rem;
}

/* ========================================================= AJUSTES FINAIS ========================================================= */

.component-form > .component-input-group {
  width: 100%;
}

.component-form > .component-input-group label {
  text-align: center;
}

.component-form > .component-input-group label,
.component-form > .component-input-group input,
.component-form > .component-input-group select {
  text-align: left;
}

/* ========================================================= RESPONSIVO ========================================================= */

@media (max-width: 991px) {
  .layout-section-register {
    padding: 1.6rem 0 2.4rem;
  }

  .layout-register-container {
    gap: 1.3rem;
  }

  .component-section-header h1 {
    font-size: clamp(1.95rem, 5vw, 2.8rem);
  }

  .component-register-card {
    max-width: 100%;
    padding: 1.5rem 1.3rem;
  }
}

@media (max-width: 767px) {
  .layout-container {
    width: min(calc(100% - 1rem), var(--container-width));
  }

  .layout-section-register {
    padding: 1rem 0 1.8rem;
  }

  .layout-register-container {
    gap: 1rem;
  }

  .component-section-header {
    max-width: 100%;
  }

  .component-tag {
    font-size: 0.72rem;
    letter-spacing: 0.14em;
  }

  .component-section-header h1 {
    font-size: clamp(1.7rem, 8vw, 2.2rem);
    margin-bottom: 0.55rem;
  }

  .component-description {
    font-size: 0.92rem;
    line-height: 1.4;
  }

  .component-register-card {
    padding: 1rem 0.9rem;
    border-radius: var(--r-md);
  }

  .layout-form-grid {
    grid-template-columns: 1fr;
    gap: 0;
    margin-bottom: 0;
  }

  .component-form-title {
    font-size: 1.15rem;
    margin-bottom: 0.95rem;
    padding-bottom: 0.6rem;
  }

  .component-form-title:not(:first-child) {
    margin-top: 1.4rem;
  }

  .component-input-group {
    margin-bottom: 0.8rem;
  }

  .component-input-group label,
  .layout-form-grid .component-input-group label {
    text-align: left;
    font-size: 0.9rem;
  }

  .component-input-group input,
  .component-input-group select,
  .component-input-group textarea {
    min-height: 2.625rem;
    height: 2.625rem;
    padding: 0.72rem 0.8rem;
    font-size: 0.92rem;
  }

  .component-input-group textarea {
    min-height: 6rem;
    height: auto;
  }

  .button-primary {
    min-height: 2.8125rem;
    font-size: 0.94rem;
  }

  .terms-check {
    align-items: flex-start;
    font-size: 0.84rem;
    line-height: 1.4;
  }

  .terms-modal-overlay {
    padding: 0.8rem;
  }

  .terms-modal {
    width: 100%;
    max-height: 88vh;
  }

  .terms-modal-content {
    max-height: 88vh;
    padding: 1.3rem 1.1rem 1.5rem;
  }

  .terms-modal-content h2 {
    font-size: 1.35rem;
  }

  .terms-modal-content h3 {
    font-size: 0.95rem;
  }

  .terms-modal-content p {
    font-size: 0.86rem;
  }
}

@media (max-width: 420px) {
  .component-section-header h1 {
    font-size: 1.55rem;
  }

  .component-description {
    font-size: 0.88rem;
  }

  .component-form-title {
    font-size: 1.08rem;
  }

  .component-input-group input,
  .component-input-group select,
  .component-input-group textarea {
    font-size: 0.9rem;
  }
}

.terms-check {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
}

.terms-check input#acceptTerms {
  display: inline-block !important;
  appearance: auto !important;
  -webkit-appearance: checkbox !important;
  width: 1.125rem !important;
  height: 1.125rem !important;
  min-width: 1.125rem !important;
  opacity: 1 !important;
  visibility: visible !important;
  position: static !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  margin: 0 !important;
}
