:root {
  --color-bg: #f4f6f9;
  --color-surface: #ffffff;
  --color-primary: #1a3a5c;
  --color-primary-light: #2d5a87;
  --color-accent: #c8a951;
  --color-accent-hover: #b8993f;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-border: #e2e8f0;
  --color-success: #059669;
  --color-error: #dc2626;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(26, 58, 92, 0.08);
  --font: "DM Sans", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 2rem;
}

.header__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.header__logo {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.02em;
}

.header__badge {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-primary);
  background: rgba(26, 58, 92, 0.08);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
}

.header__subtitle {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

/* Cards */
.card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--color-border);
}

.card__title {
  margin: 0 0 1.25rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-primary);
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--color-accent);
}

/* Form grid */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 560px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field--full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}

.required {
  color: var(--color-error);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="date"],
.field textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  font-family: inherit;
  font-size: 0.95rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fafbfc;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 3px rgba(45, 90, 135, 0.15);
  background: #fff;
}

.field input:invalid:not(:placeholder-shown):not(:focus),
.field textarea:invalid:not(:placeholder-shown):not(:focus) {
  border-color: var(--color-error);
}

.field textarea {
  resize: vertical;
  min-height: 2.5rem;
}

.field--conditional {
  margin-top: 0.75rem;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Checkboxes */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  transition: background 0.15s;
  user-select: none;
}

.checkbox-row:hover {
  background: rgba(26, 58, 92, 0.04);
}

.checkbox-row input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.15rem;
  accent-color: var(--color-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-row span {
  font-size: 0.925rem;
  line-height: 1.45;
}

/* Actions */
.form-actions {
  margin-top: 1.5rem;
  text-align: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
  min-width: 220px;
}

.btn--primary:hover:not(:disabled) {
  background: var(--color-primary-light);
}

.btn--primary:active:not(:disabled) {
  transform: scale(0.98);
}

.btn--primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn__loader {
  width: 1.125rem;
  height: 1.125rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 0.85rem 1.5rem;
  border-radius: 10px;
  font-size: 0.925rem;
  font-weight: 500;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  max-width: calc(100vw - 2rem);
  text-align: center;
}

.toast--visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast--success {
  background: var(--color-success);
  color: #fff;
}

.toast--error {
  background: var(--color-error);
  color: #fff;
}

/* Footer */
.footer {
  text-align: center;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.footer strong {
  color: var(--color-primary);
}
