/* ── Fonts (self-hosted) ─────────────────────────────────────────── */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../vendor/fonts/dm-sans-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../vendor/fonts/dm-sans-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../vendor/fonts/dm-sans-latin-700-normal.woff2') format('woff2');
}

:root {
  --green: #2d6a4f;
  --green-dark: #1b4332;
  --green-light: #d8f3dc;
  --green-pale: #f0f7f3;
  --text: #1f2937;
  --text-muted: #6b7280;
  --bg: #f4f6f5;
  --surface: #ffffff;
  --border: #e2e8e4;
  --danger: #dc2626;
  --warning: #ea580c;
  --caution: #ca8a04;
  --info: #2563eb;
  --purple: #7c3aed;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 14px rgba(0, 0, 0, 0.05);
  --font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
}

h1, h2, h3 { color: var(--green-dark); line-height: 1.25; }

a { color: var(--green); }

/* ── Form controls ───────────────────────────────────────────────── */
.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  font-size: 15px;
}

.field .required { color: var(--danger); }

.field .hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.field input[type='text'],
.field input[type='email'],
.field input[type='tel'],
.field input[type='password'],
.field select,
.field textarea {
  width: 100%;
  padding: 13px 14px;
  font-size: 16px; /* prevents iOS zoom */
  font-family: var(--font);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.18);
}

.field textarea { min-height: 130px; resize: vertical; }

.char-count {
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
  margin-top: 3px;
}

.char-count.limit { color: var(--danger); font-weight: 700; }

/* Radio cards (service mode) */
.radio-cards { display: grid; gap: 10px; }

.radio-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  font-size: 15px;
}

.radio-card input { width: 20px; height: 20px; accent-color: var(--green); flex-shrink: 0; }

.radio-card:has(input:checked) { border-color: var(--green); background: var(--green-pale); }

.radio-card input:focus-visible { outline: 3px solid rgba(45, 106, 79, 0.4); outline-offset: 2px; }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  text-decoration: none;
}

.btn:focus-visible { outline: 3px solid rgba(45, 106, 79, 0.4); outline-offset: 2px; }

.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }
.btn-primary:disabled { background: #9db8ac; cursor: not-allowed; }

.btn-secondary { background: var(--surface); color: var(--green-dark); border: 1.5px solid var(--border); }
.btn-secondary:hover { background: var(--green-pale); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }

.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 8px; }

.btn-block { width: 100%; }

/* ── Badges ──────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-critical { background: #fee2e2; color: #b91c1c; }
.badge-high { background: #ffedd5; color: #c2410c; }
.badge-medium { background: #fef9c3; color: #a16207; }
.badge-low { background: #f1f5f9; color: #475569; }

.badge-open { background: #dbeafe; color: #1d4ed8; }
.badge-in_progress { background: #ede9fe; color: #6d28d9; }
.badge-resolved { background: #dcfce7; color: #15803d; }
.badge-closed { background: #f1f5f9; color: #475569; }

.badge-overdue { background: var(--danger); color: #fff; }

/* ── Alerts / messages ───────────────────────────────────────────── */
.alert {
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 16px;
}

.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

.hidden { display: none !important; }

/* ── Toasts ──────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 92vw;
}

.toast {
  padding: 13px 18px;
  border-radius: var(--radius);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: toast-in 0.25s ease;
  max-width: 360px;
}

.toast-success { background: var(--green); }
.toast-error { background: var(--danger); }
.toast-info { background: #374151; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Spinner ─────────────────────────────────────────────────────── */
.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

.spinner-dark {
  border-color: rgba(45, 106, 79, 0.25);
  border-top-color: var(--green);
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Honeypot: visually removed but present for bots. */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
