/* Reset e base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --color-primary: #0a5f38;
  --color-primary-hover: #084a2b;
  --color-primary-light: #e8f5ee;
  --color-border: #c5d9cc;
  --color-error: #c53030;
  --color-success: #276749;
  --color-bg: #f7faf8;
  --color-card: #ffffff;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(10, 95, 56, 0.08);
  --font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: #1a202c;
  line-height: 1.5;
  min-height: 100vh;
  padding: 1.5rem;
}

.container {
  max-width: 640px;
  margin: 0 auto;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 2rem;
}

.header h1 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-primary);
}

.subtitle {
  margin: 0;
  color: #4a5568;
  font-size: 0.95rem;
}

/* Form e seções */
.form {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem;
}

.section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.section:last-of-type {
  border-bottom: none;
  margin-bottom: 1rem;
}

.section-config {
  background: var(--color-primary-light);
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.config-info {
  margin: 0;
  font-size: 0.9rem;
  color: #2d3748;
}

.section-title {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #2d3748;
}

/* Campos */
.field {
  margin-bottom: 1.25rem;
}

.field:last-child {
  margin-bottom: 0;
}

.field label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 500;
  font-size: 0.9rem;
  color: #2d3748;
}

.required {
  color: var(--color-error);
}

input[type="text"],
input[type="datetime-local"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-family: inherit;
  font-size: 0.95rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(10, 95, 56, 0.15);
}

input::placeholder,
textarea::placeholder {
  color: #718096;
}

textarea {
  resize: vertical;
  min-height: 80px;
}

/* Radio e select */
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.radio-group.inline {
  gap: 1rem;
}

.radio-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-weight: 400;
}

.radio-label input[type="radio"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.radio-outro {
  flex-basis: 100%;
  align-items: center;
  gap: 0.5rem;
}

.input-inline {
  flex: 1;
  min-width: 120px;
  max-width: 280px;
}

.input-inline:disabled {
  background: #edf2f7;
  cursor: not-allowed;
}

select {
  cursor: pointer;
  appearance: auto;
}

/* File input */
.input-file {
  width: 100%;
  padding: 0.5rem 0;
  font-size: 0.9rem;
  cursor: pointer;
}

.file-name {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: #718096;
}

/* Botões */
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn {
  padding: 0.7rem 1.25rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, transform 0.05s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
}

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

.btn-secondary {
  background: #e2e8f0;
  color: #2d3748;
}

.btn-secondary:hover {
  background: #cbd5e0;
}

/* Status (sucesso/erro) */
.status {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  display: none;
}

.status.visible {
  display: block;
}

.status.success {
  background: #c6f6d5;
  color: #22543d;
  border: 1px solid #9ae6b4;
}

.status.error {
  background: #fed7d7;
  color: #742a2a;
  border: 1px solid #fc8181;
}

.status.sending {
  background: #ebf8ff;
  color: #2b6cb0;
  border: 1px solid #90cdf4;
}

/* Validação */
input:invalid:not(:placeholder-shown):not(:focus),
textarea:invalid:not(:placeholder-shown):not(:focus) {
  border-color: #e53e3e;
}

/* Responsivo */
@media (max-width: 520px) {
  body {
    padding: 1rem;
  }

  .form {
    padding: 1.25rem;
  }

  .form-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .radio-outro {
    flex-direction: column;
    align-items: flex-start;
  }

  .input-inline {
    max-width: 100%;
  }
}
