:root {
  color-scheme: light;
  --ink: #05080c;
  --muted: #526478;
  --line: rgba(26, 124, 255, .16);
  --soft: #f4fbff;
  --blue: #1a7cff;
  --cyan: #27f3ff;
  --violet: #9a35ff;
  --gradient: linear-gradient(115deg, #27f3ff 0%, #1a7cff 48%, #9a35ff 100%);
  --shadow: 0 18px 52px rgba(5, 8, 12, .11);
  --shadow-soft: 0 10px 28px rgba(18, 38, 83, .08);
  --focus: 0 0 0 4px rgba(39, 243, 255, .24);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: #f7fbff; color: var(--ink); font-family: Inter, "Segoe UI", Arial, sans-serif; }
a { color: inherit; text-decoration: none; }
:where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid rgba(39, 243, 255, .56);
  outline-offset: 3px;
}
.portal-header {
  background: linear-gradient(135deg, #05080c 0%, #07111d 58%, #0f2542 100%);
  color: #fff;
  padding: 22px clamp(18px, 4vw, 42px);
  box-shadow: 0 10px 30px rgba(5, 8, 12, .18);
}
.portal-header-inner { max-width: 1120px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.portal-brand { display: flex; align-items: center; gap: 14px; font-weight: 950; }
.portal-brand img { width: 178px; max-height: 58px; object-fit: contain; }
.portal-nav { display: flex; flex-wrap: wrap; gap: 10px; }
.portal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid rgba(184, 243, 255, .22);
  border-radius: 8px;
  padding: 0 14px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-weight: 900;
  transition: transform .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.portal-btn.primary { background: var(--gradient); border-color: transparent; color: #fff; }
.portal-btn.light { background: #fff; color: var(--ink); border-color: var(--line); }
.portal-btn:hover { transform: translateY(-2px); border-color: rgba(39, 243, 255, .34); box-shadow: var(--shadow-soft); }
.portal-main { max-width: 1120px; margin: 0 auto; padding: clamp(22px, 4vw, 42px); }
.portal-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}
.portal-kicker {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--blue);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 950;
}
.portal-card, .login-card, .proposal-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}
.portal-card, .login-card, .proposal-panel, .portal-action-card {
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.portal-card:before, .login-card:before, .proposal-panel:before, .portal-action-card:before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
}
.login-card { max-width: 480px; margin: 58px auto; padding: 30px; }
h1, h2, h3 { margin: 0; line-height: 1.08; }
h1 { font-size: clamp(34px, 5vw, 58px); }
h2 { font-size: 27px; }
p { color: var(--muted); line-height: 1.65; }
label { display: block; margin-bottom: 14px; font-weight: 900; }
input, select, textarea {
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 50px;
  padding: 12px 13px;
  font: inherit;
  transition: border-color .2s ease, box-shadow .2s ease;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: var(--focus); outline: 0; }
[aria-invalid="true"] { border-color: #d63638; box-shadow: 0 0 0 3px rgba(214, 54, 56, .08); }
.field-error {
  display: block;
  margin-top: 6px;
  color: #9b1c1f;
  font-size: 13px;
  font-weight: 850;
}
.alert, .notice {
  border-radius: 8px;
  padding: 13px 14px;
  font-weight: 850;
  margin-bottom: 16px;
}
.alert { border: 1px solid rgba(214, 54, 56, .2); background: rgba(214, 54, 56, .08); color: #9b1c1f; }
.notice { border: 1px solid rgba(26, 124, 255, .2); background: rgba(26, 124, 255, .08); color: var(--ink); }
.portal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 24px; }
.portal-card { padding: 22px; }
.portal-card small { display: block; color: var(--muted); text-transform: uppercase; font-size: 12px; font-weight: 950; }
.portal-section { margin-top: 34px; }
.portal-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0 34px;
}
.portal-action-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: #fff;
  box-shadow: 0 14px 38px rgba(5, 8, 12, .08);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.portal-action-card:hover { transform: translateY(-3px); border-color: rgba(26, 124, 255, .34); box-shadow: var(--shadow); }
.portal-action-card.selected {
  border-color: rgba(26, 124, 255, .34);
  box-shadow: 0 18px 44px rgba(26, 124, 255, .14);
}
.portal-action-card.selected:before { height: 5px; background: var(--gradient); }
.portal-action-card small {
  display: block;
  color: var(--blue);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 950;
}
.portal-action-card strong {
  display: block;
  margin: 7px 0;
  color: var(--ink);
  font-size: 20px;
}
.portal-action-card span { color: var(--muted); line-height: 1.55; }
.portal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.portal-form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.wizard-form { padding: clamp(22px, 4vw, 34px); }
.wizard-section {
  padding: 0 0 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.wizard-section:last-of-type { border-bottom: 0; margin-bottom: 0; }
.wizard-section small {
  display: inline-flex;
  margin-bottom: 14px;
  color: var(--blue);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 950;
}
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.check-row input { width: auto; margin-top: 4px; accent-color: var(--blue); }
.status-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(26, 124, 255, .1);
  color: var(--blue);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}
.status-pill.open,
.status-pill.requested,
.status-pill.pending,
.status-pill.draft,
.status-pill.sent,
.status-pill.viewed { background: rgba(26, 124, 255, .1); color: var(--blue); }
.status-pill.client_reply { background: rgba(214, 54, 56, .1); color: #9b1c1f; }
.status-pill.in_progress,
.status-pill.submitted,
.status-pill.confirmed { background: rgba(154, 53, 255, .12); color: #6e22ba; }
.status-pill.waiting_client,
.status-pill.payment_submitted { background: rgba(245, 158, 11, .16); color: #946200; }
.status-pill.resolved,
.status-pill.completed,
.status-pill.accepted,
.status-pill.approved,
.status-pill.paid { background: rgba(0, 160, 90, .12); color: #047a46; }
.status-pill.closed,
.status-pill.rejected,
.status-pill.blocked,
.status-pill.cancelled,
.status-pill.void { background: rgba(82, 100, 120, .12); color: var(--muted); }
.progress { height: 10px; border-radius: 999px; background: rgba(26, 124, 255, .1); overflow: hidden; margin-top: 12px; }
.progress.large { height: 14px; margin-top: 24px; }
.progress span { display: block; height: 100%; background: var(--gradient); border-radius: inherit; }
.proposal-panel { padding: clamp(24px, 5vw, 52px); margin-bottom: 22px; }
.proposal-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 22px; align-items: start; }
.proposal-price { border: 1px solid var(--line); border-radius: 8px; padding: 18px; background: var(--soft); min-width: 230px; }
.proposal-price small { display: block; color: var(--muted); text-transform: uppercase; font-weight: 950; }
.proposal-price strong { display: block; margin-top: 8px; color: var(--blue); font-size: 38px; line-height: 1; }
pre { white-space: pre-wrap; word-break: break-word; border: 1px solid var(--line); border-radius: 8px; padding: 16px; background: var(--soft); color: var(--ink); font: inherit; }
.mini-list { display: grid; gap: 10px; margin-top: 16px; }
.mini-item {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: var(--soft);
}
.mini-item strong { color: var(--ink); }
.mini-item em { color: var(--muted); font-style: normal; font-size: 13px; }
.message-thread {
  display: grid;
  gap: 14px;
  margin: 18px 0 22px;
}
.message-bubble {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  background: var(--soft);
}
.message-bubble.admin {
  border-color: rgba(154, 53, 255, .2);
  background: rgba(154, 53, 255, .06);
}
.message-bubble.client {
  border-color: rgba(26, 124, 255, .18);
  background: #fff;
}
.message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.message-bubble p { margin: 0; color: var(--ink); }
.reply-form { border-top: 1px solid var(--line); padding-top: 18px; }
.milestone-list {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}
.milestone-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}
.milestone-item > span {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(26, 124, 255, .24);
  border-radius: 50%;
  background: var(--soft);
}
.milestone-item.in_progress > span { border-color: var(--violet); background: rgba(154, 53, 255, .12); }
.milestone-item.completed > span { border-color: #047a46; background: #047a46; }
.milestone-item strong { color: var(--ink); font-size: 18px; }
.milestone-item p { margin: 6px 0 0; }
@media (max-width: 760px) {
  .portal-header-inner, .portal-nav, .portal-heading { flex-direction: column; align-items: flex-start; }
  .portal-grid, .proposal-hero, .portal-actions, .portal-layout, .form-grid { grid-template-columns: 1fr; }
  .portal-btn, .portal-form-actions .portal-btn { width: 100%; }
}
