/* Customer Maintenance Request Portal */

:root {
  --bg: #f4f6f9;
  --bg-subtle: #eef1f6;
  --card: #fff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --muted: #64748b;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #eff6ff;
  --ok: #059669;
  --ok-soft: #ecfdf5;
  --warn: #d97706;
  --warn-soft: #fffbeb;
  --urgent: #dc2626;
  --urgent-soft: #fef2f2;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --mono: ui-monospace, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  padding-bottom: 2rem;
}

.hidden { display: none !important; }

.layout {
  display: grid;
  gap: 1rem;
  margin-top: 0;
  padding-bottom: 1rem;
}

@media (min-width: 980px) {
  .layout {
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    align-items: start;
  }
  .results-column { position: sticky; top: 1rem; }
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

.panel-title {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.muted {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.no-margin { margin-bottom: 0 !important; }

.required-mark { color: var(--urgent); font-weight: 700; }

.form-error {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.75rem;
  background: var(--urgent-soft);
  border: 1px solid #fca5a5;
  border-radius: 8px;
  color: var(--urgent);
  font-size: 0.8125rem;
  font-weight: 600;
}

.form-section {
  border: none;
  margin: 0 0 1.15rem;
  padding: 0;
}

.form-section legend {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.65rem;
  padding: 0;
}

.field-grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .field-grid { grid-template-columns: 1fr 1fr; }
  .field-full { grid-column: 1 / -1; }
}

.field {
  display: grid;
  gap: 0.25rem;
}

.field span {
  font-size: 0.8125rem;
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font: inherit;
  font-size: 0.875rem;
  width: 100%;
  background: #fff;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 0.35rem;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
}

.check input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--brand);
}

.escalation-section {
  padding: 0.85rem;
  background: var(--warn-soft);
  border: 1px solid #fcd34d;
  border-radius: 10px;
}

.escalation-note {
  margin: 0 0 0.65rem;
  font-size: 0.8125rem;
  color: #92400e;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  padding-top: 0.25rem;
}

.btn-ghost {
  background: transparent;
  color: var(--brand);
  border: none;
  padding: 0.35rem 0.5rem;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-ghost:hover { text-decoration: underline; }

.results-placeholder {
  min-height: 12rem;
}

.success-panel .success-badge {
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ok-soft);
  color: var(--ok);
  border-radius: 999px;
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 0.65rem;
}

.priority-rec {
  margin: 0 0 0.85rem;
  padding: 0.55rem 0.75rem;
  background: var(--brand-soft);
  border: 1px solid #93c5fd;
  border-radius: 8px;
  font-size: 0.8125rem;
}

.summary-box {
  padding: 0.75rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  margin-bottom: 0.65rem;
  line-height: 1.45;
}

.summary-box h3 {
  margin: 0 0 0.35rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.summary-box p { margin: 0; }

.summary-internal {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
}

.summary-customer {
  background: #fafafa;
  border: 1px solid var(--border);
}

.json-block { margin-bottom: 0.85rem; }

.json-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.json-head h3 {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.code-sm {
  margin: 0;
  padding: 0.75rem;
  background: #0f172a;
  color: #cbd5e1;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  line-height: 1.5;
  overflow: auto;
  max-height: 220px;
  white-space: pre-wrap;
  word-break: break-word;
}

.ops-map {
  padding: 0.75rem 0.85rem;
  background: var(--bg-subtle);
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  margin-bottom: 0.65rem;
  font-size: 0.8125rem;
}

.ops-map h3 {
  margin: 0 0 0.4rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.ops-map ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.ops-map li { margin-bottom: 0.25rem; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 0 2rem;
  font-size: 0.8125rem;
  color: var(--muted);
  background: var(--card);
  margin-top: 0.5rem;
}

.site-footer p { margin: 0; text-align: center; }

@media (max-width: 979px) {
  .results-column { margin-top: 0.5rem; }
}

@media (max-width: 640px) {
  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; text-align: center; }
}
