/* ============================================================
   Cabral & Ruscitto — Formulários Públicos
   Fundo branco frio, mobile-first
   ============================================================ */

/* ─── Layout ─────────────────────────────────────────────── */
.form-page {
  min-height: 100vh;
  background: #F5F3F0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--sp-8) var(--sp-4);
}

.form-header {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: var(--sp-8);
}

.form-header__logo {
  height: 48px;
  margin-bottom: var(--sp-6);
}

.form-header__divider {
  width: 48px;
  height: 1px;
  background: var(--gold);
  opacity: 0.6;
  margin-bottom: var(--sp-4);
}

.form-header__title {
  font-family: var(--font-editorial);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 0.10em;
  color: var(--navy-deep);
  text-align: center;
  margin-bottom: var(--sp-2);
}

.form-header__subtitle {
  font-size: 14px;
  font-weight: 300;
  color: var(--warm-gray);
  text-align: center;
  line-height: 1.5;
}

/* ─── Card do formulário ──────────────────────────────────── */
.form-card {
  width: 100%;
  max-width: 680px;
  background: var(--white);
  border: 1px solid rgba(61, 74, 92, 0.15);
  padding: var(--sp-8);
}

.form-card + .form-card {
  margin-top: var(--sp-4);
}

.form-section {
  margin-bottom: var(--sp-8);
}

.form-section:last-child {
  margin-bottom: 0;
}

.form-section__title {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy-mid);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid rgba(61, 74, 92, 0.12);
  margin-bottom: var(--sp-5);
}

/* ─── Grid de campos ──────────────────────────────────────── */
.form-grid {
  display: grid;
  gap: var(--sp-4) var(--sp-5);
}

.form-grid--2 { grid-template-columns: 1fr 1fr; }
.form-grid--3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid--1-2 { grid-template-columns: 1fr 2fr; }

@media (max-width: 580px) {
  .form-grid--2,
  .form-grid--3,
  .form-grid--1-2 {
    grid-template-columns: 1fr;
  }
}

/* ─── Campo ───────────────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.field--full {
  grid-column: 1 / -1;
}

.field__label {
  font-size: 13px;
  font-weight: 400;
  color: var(--navy-mid);
  letter-spacing: 0.01em;
}

.field__label--required::after {
  content: ' *';
  color: var(--error);
}

.field__input,
.field__select,
.field__textarea {
  width: 100%;
  padding: 10px var(--sp-3);
  border: 1px solid rgba(61, 74, 92, 0.35);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--black);
  font-size: 15px;
  transition: border-color var(--duration) var(--ease),
              box-shadow var(--duration) var(--ease);
  outline: none;
  -webkit-appearance: none;
}

.field__input:focus,
.field__select:focus,
.field__textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.12);
}

.field__input::placeholder,
.field__textarea::placeholder {
  color: rgba(138, 128, 112, 0.6);
  font-weight: 300;
}

.field__textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

.field__select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%233D4A5C' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--sp-3) center;
  padding-right: var(--sp-8);
}

/* Estados de validação */
.field__input--error,
.field__select--error,
.field__textarea--error {
  border-color: var(--error);
}

.field__input--success,
.field__select--success,
.field__textarea--success {
  border-color: var(--success);
}

.field__hint {
  font-size: 12px;
  font-weight: 300;
  color: var(--warm-gray);
}

.field__error-msg {
  font-size: 12px;
  font-weight: 400;
  color: var(--error);
}

/* ─── Upload ──────────────────────────────────────────────── */
.upload-area {
  border: 1px dashed rgba(61, 74, 92, 0.35);
  border-radius: var(--radius);
  padding: var(--sp-6);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--duration) var(--ease),
              background var(--duration) var(--ease);
  position: relative;
}

.upload-area:hover,
.upload-area--drag {
  border-color: var(--gold);
  background: var(--gold-dim);
}

.upload-area__input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-area__icon {
  width: 32px;
  height: 32px;
  margin: 0 auto var(--sp-2);
  color: var(--warm-gray);
}

.upload-area__text {
  font-size: 14px;
  color: var(--navy-mid);
}

.upload-area__hint {
  font-size: 12px;
  font-weight: 300;
  color: var(--warm-gray);
  margin-top: var(--sp-1);
}

.upload-list {
  margin-top: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.upload-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-2) var(--sp-3);
  background: rgba(201, 169, 110, 0.08);
  border-radius: var(--radius);
}

.upload-item__name {
  font-size: 13px;
  color: var(--navy-mid);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 80%;
}

.upload-item__remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--warm-gray);
  font-size: 18px;
  line-height: 1;
  padding: 2px;
  transition: color var(--duration);
}

.upload-item__remove:hover {
  color: var(--error);
}

/* ─── Alertas de erro ─────────────────────────────────────── */
.form-errors {
  background: var(--error-bg);
  border: 1px solid rgba(122, 30, 46, 0.25);
  border-radius: var(--radius);
  padding: var(--sp-4);
  margin-bottom: var(--sp-5);
}

.form-errors__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--error);
  margin-bottom: var(--sp-2);
}

.form-errors__list {
  list-style: none;
  padding: 0;
}

.form-errors__list li {
  font-size: 13px;
  color: var(--error);
  padding: 2px 0;
}

.form-errors__list li::before {
  content: '— ';
}

/* ─── Botão primário ──────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 12px var(--sp-8);
  background: var(--gold);
  color: var(--navy-deep);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity var(--duration) var(--ease),
              transform var(--duration) var(--ease),
              box-shadow var(--duration) var(--ease);
  white-space: nowrap;
}

.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(201, 169, 110, 0.22);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: none;
  opacity: 0.85;
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 10px var(--sp-6);
  background: transparent;
  color: var(--navy-mid);
  border: 1px solid rgba(61, 74, 92, 0.35);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  transition: border-color var(--duration), color var(--duration);
}

.btn-secondary:hover {
  border-color: var(--navy-mid);
  color: var(--navy-deep);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-3);
  margin-top: var(--sp-8);
  padding-top: var(--sp-6);
  border-top: 1px solid rgba(61, 74, 92, 0.10);
}

/* ─── Tela de confirmação ─────────────────────────────────── */
.form-success {
  text-align: center;
  padding: var(--sp-10) var(--sp-8);
}

.form-success__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--success-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--sp-5);
}

.form-success__icon svg {
  width: 28px;
  height: 28px;
  color: var(--success);
}

.form-success__title {
  font-family: var(--font-editorial);
  font-size: 28px;
  font-weight: 400;
  color: var(--navy-deep);
  margin-bottom: var(--sp-3);
}

.form-success__text {
  font-size: 15px;
  font-weight: 300;
  color: var(--warm-gray);
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.6;
}


/* ─── Footer do formulário ────────────────────────────────── */
.form-footer {
  width: 100%;
  max-width: 680px;
  text-align: center;
  margin-top: var(--sp-6);
  padding-top: var(--sp-5);
  border-top: 1px solid rgba(61, 74, 92, 0.10);
}

.form-footer__text {
  font-size: 12px;
  font-weight: 300;
  color: var(--warm-gray);
}
