/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-top:      #0F2643;
  --bg-bottom:   #1A3A5C;
  --accent:      #4FC3F7;
  --accent-dark: #0D2137;
  --white:       #FFFFFF;
  --white-06:    rgba(255,255,255,0.06);
  --white-08:    rgba(255,255,255,0.08);
  --white-12:    rgba(255,255,255,0.12);
  --white-15:    rgba(255,255,255,0.15);
  --white-60:    rgba(255,255,255,0.60);
  --white-65:    rgba(255,255,255,0.65);
  --radius-sm:   10px;
  --radius-md:   14px;
  --radius-lg:   20px;
}

html { font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  min-height: 100vh;
  color: var(--white);
}

/* ── Page wrapper ─────────────────────────────────────────── */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 2rem 1rem 4rem;
}

/* ── Form shell ───────────────────────────────────────────── */
.form-shell {
  width: 100%;
  max-width: 680px;
}

/* ── Header ───────────────────────────────────────────────── */
.form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 0 1rem;
}

.form-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white-60);
  margin-bottom: 0.25rem;
}

.form-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--white);
}

.step-badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--white-15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--white);
  flex-shrink: 0;
}

/* ── Progress bar ─────────────────────────────────────────── */
.progress-bar-track {
  height: 4px;
  background: var(--white-15);
  border-radius: 4px;
  margin-bottom: 1.75rem;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--white);
  border-radius: 4px;
  transition: width 0.5s cubic-bezier(.4,0,.2,1);
}

/* ── Form sections ────────────────────────────────────────── */
.form-section {
  background: var(--white-06);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--white-08);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.section-icon { font-size: 1rem; }

.section-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
}

.section-hint {
  font-size: 0.85rem;
  color: var(--white-60);
  margin-top: -0.75rem;
  margin-bottom: 1rem;
}

/* ── Field groups ─────────────────────────────────────────── */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

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

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--white-65);
}

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

/* ── Inputs ───────────────────────────────────────────────── */
input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
  background: var(--white-08);
  border: 1px solid var(--white-15);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: 1rem;
  font-weight: 500;
  padding: 0.75rem 0.875rem;
  width: 100%;
  transition: border-color 0.2s;
  outline: none;
  font-family: inherit;
}

input::placeholder,
textarea::placeholder { color: rgba(255,255,255,0.3); }

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  background: rgba(79,195,247,0.08);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(255,255,255,0.5)' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  padding-right: 2.5rem;
}

select option { background: var(--bg-top); color: var(--white); }

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

/* ── Field errors ─────────────────────────────────────────── */
.field-error {
  font-size: 0.8rem;
  color: #f87171;
  margin-top: 0.2rem;
}

.error-banner {
  background: rgba(248,113,113,0.15);
  border: 1px solid rgba(248,113,113,0.4);
  border-radius: var(--radius-sm);
  color: #f87171;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

/* ── Services grid ────────────────────────────────────────── */
.services-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
}

.service-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.875rem;
  background: var(--white-08);
  border: 1px solid var(--white-12);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--white-65);
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.3;
}

.service-card:has(input:checked),
.service-card.selected {
  background: rgba(79,195,247,0.18);
  border-color: var(--accent);
  color: var(--white);
}

.service-card:hover { transform: scale(1.02); }

.service-card input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
}

/* ── Urgency chips ────────────────────────────────────────── */
.urgency-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.urgency-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  background: var(--white-08);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--white-65);
  transition: background 0.15s, color 0.15s;
  text-transform: none;
  letter-spacing: 0;
}

.urgency-chip:has(input:checked) {
  background: var(--white);
  color: var(--accent-dark);
}

.urgency-chip input[type="radio"] {
  display: none;
}

/* ── Submit row ───────────────────────────────────────────── */
.submit-row {
  margin-top: 1.5rem;
  text-align: center;
}

.btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--white);
  color: var(--accent-dark);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 1rem 2.5rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  width: 100%;
  justify-content: center;
}

.btn-submit:hover { opacity: 0.92; transform: translateY(-1px); }
.btn-submit:active { transform: translateY(0); }

.submit-note {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.35);
  margin-top: 0.75rem;
  line-height: 1.5;
}

/* ── Success page ─────────────────────────────────────────── */
.success-shell {
  width: 100%;
  max-width: 520px;
  text-align: center;
  padding-top: 5rem;
}

.success-icon {
  width: 80px;
  height: 80px;
  background: var(--white-12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1.5rem;
  color: var(--white);
}

.success-shell h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.success-shell > p {
  color: var(--white-65);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.success-summary {
  background: var(--white-06);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  text-align: left;
  border: 1px solid var(--white-08);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--white-08);
  font-size: 0.9rem;
}

.summary-row:last-child { border-bottom: none; }
.summary-row span:first-child { color: var(--white-60); }
.summary-row span:last-child  { font-weight: 600; text-align: right; }

/* ── Admin: list page ─────────────────────────────────────── */
.admin-shell {
  width: 100%;
  max-width: 1100px;
  padding-top: 2rem;
}

.admin-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.admin-header h1 { font-size: 1.75rem; font-weight: 700; }

.badge {
  background: var(--accent);
  color: var(--accent-dark);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

.quote-table-wrapper { overflow-x: auto; }

.quote-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.quote-table th {
  background: var(--white-08);
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--white-60);
  font-weight: 600;
  white-space: nowrap;
}

.quote-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--white-08);
  color: var(--white);
  vertical-align: middle;
}

.quote-table tr:last-child td { border-bottom: none; }

.quote-table tr:hover td { background: var(--white-06); }

.urgency-tag, .status-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.urgency-tag { background: rgba(79,195,247,0.18); color: var(--accent); }
.status-new      { background: rgba(74,222,128,0.15); color: #4ade80; }
.status-reviewed { background: rgba(250,204,21,0.15); color: #facc15; }
.status-closed   { background: var(--white-08); color: var(--white-60); }

.btn-view {
  background: var(--white-12);
  color: var(--white);
  text-decoration: none;
  padding: 0.3rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 0.15s;
  white-space: nowrap;
}

.btn-view:hover { background: var(--white-15); }

.btn-back {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: opacity 0.15s;
}

.btn-back:hover { opacity: 0.75; }

.empty-state {
  text-align: center;
  padding: 4rem;
  color: var(--white-60);
  font-size: 1rem;
}

/* ── Admin: detail page ───────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

.detail-card {
  background: var(--white-06);
  border: 1px solid var(--white-08);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
}

.detail-card.full-width { grid-column: 1 / -1; }

.detail-card h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--white-60);
  margin-bottom: 0.875rem;
  font-weight: 700;
}

dl { display: grid; gap: 0.5rem; }

dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.4);
  font-weight: 600;
}

dd {
  font-size: 0.95rem;
  color: var(--white);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

dd a { color: var(--accent); text-decoration: none; }
dd a:hover { text-decoration: underline; }

.services-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.service-tag {
  background: rgba(79,195,247,0.15);
  color: var(--accent);
  border: 1px solid rgba(79,195,247,0.3);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .field-row        { grid-template-columns: 1fr; }
  .services-grid    { grid-template-columns: 1fr; }
  .detail-grid      { grid-template-columns: 1fr; }
  .detail-card.full-width { grid-column: 1; }
  .form-title       { font-size: 1.4rem; }
  .urgency-chips    { flex-direction: column; }
  .urgency-chip     { justify-content: flex-start; }
}

/* ── Dashboard shell ──────────────────────────────────────── */
.dash-shell {
  width: 100%;
  max-width: 1200px;
  padding-top: 2rem;
}

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.btn-new {
  background: var(--accent);
  color: var(--accent-dark);
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: opacity 0.2s;
  white-space: nowrap;
}

.btn-new:hover { opacity: 0.85; }

/* ── Stat cards ───────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.875rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--white-06);
  border: 1px solid var(--white-08);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: background 0.15s, border-color 0.15s;
}

.stat-card:hover { background: var(--white-08); }

.stat-card.stat-active {
  border-color: var(--accent);
  background: rgba(79,195,247,0.1);
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1;
}

.stat-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--white-60);
  font-weight: 600;
}

.stat-new .stat-number      { color: #4ade80; }
.stat-reviewed .stat-number { color: #facc15; }
.stat-closed .stat-number   { color: var(--white-60); }

/* ── Table card ───────────────────────────────────────────── */
.table-card {
  background: var(--white-06);
  border: 1px solid var(--white-08);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.quote-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.quote-table th {
  background: var(--white-08);
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--white-60);
  font-weight: 700;
  white-space: nowrap;
}

.quote-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--white-08);
  color: var(--white);
  vertical-align: middle;
}

.quote-table tbody tr:last-child td { border-bottom: none; }
.quote-table tbody tr:hover td { background: rgba(255,255,255,0.03); }

.td-id   { color: var(--white-60); font-size: 0.8rem; }
.td-name { font-weight: 600; }
.td-email a { color: var(--accent); text-decoration: none; }
.td-email a:hover { text-decoration: underline; }
.td-date { color: var(--white-60); white-space: nowrap; font-size: 0.82rem; }
.td-empty { color: var(--white-60); }

.td-services {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  max-width: 260px;
}

.svc-pill {
  background: rgba(79,195,247,0.12);
  color: var(--accent);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Status & urgency tags ────────────────────────────────── */
.urgency-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(79,195,247,0.15);
  color: var(--accent);
  white-space: nowrap;
}

.status-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-new      { background: rgba(74,222,128,0.15);  color: #4ade80; }
.status-reviewed { background: rgba(250,204,21,0.15);  color: #facc15; }
.status-closed   { background: var(--white-08);         color: var(--white-60); }

/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
  background: var(--white-06);
  border: 1px solid var(--white-08);
  border-radius: var(--radius-lg);
  text-align: center;
  padding: 4rem 2rem;
  color: var(--white-60);
}

.empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state p { font-size: 1rem; }

/* ── Status update bar ────────────────────────────────────── */
.status-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  background: var(--white-06);
  border: 1px solid var(--white-08);
  border-radius: var(--radius-md);
  padding: 0.875rem 1.25rem;
  margin-bottom: 1.25rem;
}

.status-bar-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--white-60);
  font-weight: 600;
}

.status-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-status {
  padding: 0.3rem 0.875rem;
  border-radius: 999px;
  border: none;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-status:hover { opacity: 0.8; }
.btn-status-new      { background: rgba(74,222,128,0.2);  color: #4ade80; }
.btn-status-reviewed { background: rgba(250,204,21,0.2);  color: #facc15; }
.btn-status-closed   { background: var(--white-12);        color: var(--white-60); }

/* ── Detail grid ──────────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.detail-card {
  background: var(--white-06);
  border: 1px solid var(--white-08);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
}

.detail-card.full-width { grid-column: 1 / -1; }

.detail-card h3 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--white-60);
  margin-bottom: 0.875rem;
  font-weight: 700;
}

dl { display: grid; gap: 0.5rem; }

dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.4);
  font-weight: 600;
  margin-top: 0.5rem;
}

dd {
  font-size: 0.95rem;
  color: var(--white);
  font-weight: 500;
  margin: 0;
}

dd a { color: var(--accent); text-decoration: none; }
dd a:hover { text-decoration: underline; }

.services-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.service-tag {
  background: rgba(79,195,247,0.15);
  color: var(--accent);
  border: 1px solid rgba(79,195,247,0.3);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* ── Navigation buttons ───────────────────────────────────── */
.btn-back {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: opacity 0.15s;
  white-space: nowrap;
}

.btn-back:hover { opacity: 0.75; }

.btn-view {
  background: var(--white-12);
  color: var(--white);
  text-decoration: none;
  padding: 0.3rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 0.15s;
  white-space: nowrap;
}

.btn-view:hover { background: var(--white-15); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .stat-grid   { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-card.full-width { grid-column: 1; }

  .quote-table th:nth-child(5),
  .quote-table td:nth-child(5) { display: none; } /* hide services on small screens */
}

@media (max-width: 600px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-header { flex-direction: column; align-items: flex-start; }
  .quote-table th:nth-child(4),
  .quote-table td:nth-child(4) { display: none; } /* hide email too */
}
