/* === Root Variables: Design Tokens === */
:root {
  --color-bg: #f9fafb;
  --color-fg: #111827;
  --color-muted: #6b7280;
  --color-primary: #015551;
  --color-primary-hover: #013f3d;
  --color-card-bg: #ffffff;
  --color-border: #d1d5db;
  --radius: 0.75rem;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --font-family: 'Inter', system-ui, sans-serif;
  --spacing: 1rem;
}

body {
  font-family: var(--font-family);
  background-color: var(--color-bg);
  color: var(--color-fg);
  margin: 0;
}

.dashboard.container {
  max-width: 920px;
  margin: 3rem auto;
  padding: 0 var(--spacing);
}

.dash-header h1 {
  margin-bottom: 0.25rem;
}

.dash-header .lead {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-muted);
  margin-bottom: 2rem;
}

/* CARD STYLES */
.card {
  background-color: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

/* FORM */
.order-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem 2rem;
  margin-bottom: 2rem;
}

.order-form .form-group {
  display: flex;
  flex-direction: column;
}

.order-form label {
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--color-fg);
  font-size: 0.95rem;
}

.order-form input[type="text"],
.order-form select {
  padding: 0.625rem 0.75rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: border 0.3s ease, box-shadow 0.3s ease;
}

.order-form input[type="text"]:focus,
.order-form select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(1, 85, 81, 0.2);
}

.order-form button.primary {
  grid-column: 1 / -1;
  justify-self: start;
  background-color: var(--color-primary);
  color: white;
  font-weight: 600;
  padding: 0.75rem 2rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}

.order-form button.primary:hover:not(:disabled) {
  background-color: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(1, 55, 51, 0.25);
}

.order-form button.primary:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* FORM STATUS */
#form-status {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-primary);
  min-height: 1.2em;
}

/* TABLE */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.data-table thead {
  background-color: var(--color-primary);
  color: white;
  font-weight: 700;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.95rem;
}

.data-table tbody tr:hover {
  background-color: #eff7f6;
}

/* Status column */
.data-table td:nth-child(3),
.data-table td:nth-child(4) {
  text-align: center;
  font-size: 1.1rem;
}

/* Spinner CSS */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

.hidden {
  display: none !important;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive */
@media (max-width: 720px) {
  .order-form {
    grid-template-columns: 1fr;
  }

  .order-form button.primary {
    width: 100%;
  }
}

/* === State Invoice Line === */
.state-invoice-line {
  margin-top: 1rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-fg);
  background-color: #ecfdf5;
  border-left: 4px solid var(--color-primary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  transition: all 0.3s ease;
  display: none;
}

.state-invoice-line.visible {
  display: block;
}

/* === LLC Name Availability Status === */
#name-availability {
  margin-top: 0.3rem;
  font-size: 0.9rem;
  font-weight: 600;
  min-height: 1.2em; /* prevent layout shift */
  transition: color 0.3s ease;
}

/* === Extra Invoice Line for LLC Name Monitoring === */
#extra-service-invoice {
  margin-top: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: #065f46;
  background-color: #ecfdf5;
  border-left: 4px solid var(--color-primary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  display: none; /* show only when applicable */
  user-select: none;
}

/* Accessibility helper (screen reader only) */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
