@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700;800&display=swap');

:root{
  --primary: #800020;
  --primary-hover: #990026;
  --bg: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --panel: rgba(255,255,255,.88);
  --panel-2: rgba(248,250,252,.92);
  --border: rgba(128,0,32,.18);
  --glass: rgba(128,0,32,.05);
  --pass: #15803d;
  --fail: #b91c1c;
  --warning: #f59e0b;
  --shadow: 0 22px 70px rgba(15,23,42,.10);
  --radius: 16px;
}

*{ box-sizing: border-box; }
html,body{ min-height:100%; }
body{
  margin:0;
  font-family: 'Outfit', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  background-image:
    radial-gradient(at 0% 0%, rgba(128,0,32,.04) 0, transparent 48%),
    radial-gradient(at 55% 0%, rgba(128,0,32,.025) 0, transparent 50%),
    linear-gradient(180deg, #fff 0%, #fff 48%, #fafafa 100%);
  color: var(--text);
}

.app-shell{
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  padding:18px 22px;
  border-bottom:1px solid rgba(128,0,32,.12);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(14px);
  position: sticky;
  top:0;
  z-index:10;
  box-shadow: 0 12px 34px rgba(15,23,42,.05);
}

.brand{ display:flex; gap:12px; align-items:center; min-width: 0; }
.brand__logo{
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border-radius:13px;
  background: var(--primary);
  color:#fff;
  font-weight:800;
  box-shadow: 0 12px 28px rgba(128,0,32,.22);
}
.brand__title{
  font-weight:800;
  letter-spacing:.2px;
  color: var(--text);
}
.brand__subtitle{
  color:var(--muted);
  font-size:12px;
  margin-top:2px;
}

.topbar__nav{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.topbar__link{
  color: var(--primary);
  text-decoration:none;
  font-size:13px;
  font-weight:700;
  padding:8px 12px;
  border-radius:999px;
  border: 1px solid rgba(128,0,32,.12);
  background: rgba(128,0,32,.04);
  transition: all .2s ease;
}
.topbar__link:hover{
  border-color: var(--primary);
  background: var(--primary);
  color:#fff;
}

.main{
  flex:1;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 44px 18px 56px;
}

.footer{
  padding:18px 22px;
  border-top:1px solid rgba(128,0,32,.10);
  color: var(--muted);
  font-size:12px;
  text-align:center;
  background: rgba(255,255,255,.78);
}

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

.card--flow{ padding: 2rem; }
.card-title{
  margin:0 0 1.5rem;
  font-size:2.5rem;
  line-height:1.15;
  font-weight:600;
  color: var(--text);
}
.muted{ color: var(--muted); }
.pre{ white-space: pre-wrap; color: var(--fail); }

.landing-instructions{
  margin: 0 0 1.75rem;
  padding: 1.25rem;
  border-radius: 16px;
  border: 1px solid rgba(128,0,32,.14);
  background: rgba(128,0,32,.04);
}
.card > .landing-instructions:first-of-type{
  margin-top: -.35rem;
}
.instruction-eyebrow{
  color: var(--primary);
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: .55rem;
}
.instruction-copy{
  margin: 0 0 1rem;
  color: var(--text);
  font-size: .98rem;
  line-height: 1.55;
}
.instruction-subtitle{
  margin: 1.1rem 0 .65rem;
  color: var(--text);
  font-weight: 800;
}
.alias-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
}
.alias-chip{
  display: block;
  padding: .55rem .65rem;
  border-radius: 999px;
  border: 1px solid rgba(128,0,32,.12);
  background: rgba(255,255,255,.78);
  color: var(--primary);
  font-family: inherit;
  font-size: .82rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.instruction-group{
  margin-top: 1rem;
}
.instruction-list{
  list-style: none;
  counter-reset: setup-step;
  display: grid;
  gap: .65rem;
  margin: 0;
  padding: 0;
}
.instruction-list li{
  counter-increment: setup-step;
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: .75rem;
  align-items: start;
  color: var(--text);
  line-height: 1.45;
}
.instruction-list li::before{
  content: counter(setup-step);
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: .82rem;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(128,0,32,.16);
}
.instruction-step-text{
  padding-top: .25rem;
}

.page-header{ margin-bottom:1rem; }
.page-title{
  margin:0;
  font-size:2.5rem;
  line-height:1.15;
  font-weight:600;
}
.page-subtitle{
  margin:.5rem 0 0;
  color: var(--muted);
  font-size:1rem;
}

.field{ margin: 1.1rem 0; }
.label{
  font-size:.76rem;
  color: var(--muted);
  margin-bottom:.5rem;
  font-weight:700;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.input,
.textarea{
  width:100%;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--border);
  color: var(--text);
  padding:.65rem 0;
  outline:none;
  font-family:inherit;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.input{
  font-size:1.65rem;
  font-weight:400;
}
select.input{
  cursor:pointer;
}
.textarea{
  font-size:1.05rem;
  line-height:1.55;
  min-height:110px;
  resize:vertical;
  border: 1px solid var(--border);
  border-radius:14px;
  background: rgba(248,250,252,.72);
  padding:1rem;
}
.input:focus,
.textarea:focus{
  border-color: var(--primary);
  box-shadow: 0 10px 28px rgba(128,0,32,.08);
}

.toolbar{
  display:flex;
  gap:10px;
  align-items:center;
  margin: 1rem 0 1.2rem;
  flex-wrap:wrap;
}

.btn{
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.15rem;
  font-weight:700;
  cursor:pointer;
  background: var(--glass);
  color: var(--text);
  transition: transform .05s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease, color .2s ease;
  text-decoration:none;
  text-align:center;
  font-family:inherit;
  font-size:1rem;
}
.btn:hover{
  border-color: var(--primary);
  background: rgba(128,0,32,.07);
}
.btn:active{ transform: translateY(1px); }
.btn:disabled{ opacity:.55; cursor:not-allowed; }
.btn--wide{ width:100%; display:block; }
.btn--primary{
  background: var(--primary);
  border-color: var(--primary);
  color:#fff;
  box-shadow: 0 12px 28px rgba(128,0,32,.22);
}
.btn--primary:hover{
  background: var(--primary-hover);
  color:#fff;
}
.btn--secondary{ background: rgba(248,250,252,.82); }
.btn--pass{
  background: rgba(21,128,61,.10);
  border-color: rgba(21,128,61,.35);
  color: var(--pass);
}
.btn--pass:hover{
  background: var(--pass);
  border-color: var(--pass);
  color:#fff;
  box-shadow: 0 10px 28px rgba(21,128,61,.18);
}
.btn--fail{
  background: rgba(185,28,28,.10);
  border-color: rgba(185,28,28,.35);
  color: var(--fail);
}
.btn--fail:hover{
  background: var(--fail);
  border-color: var(--fail);
  color:#fff;
  box-shadow: 0 10px 28px rgba(185,28,28,.18);
}

.actions{ display:flex; gap:12px; flex-wrap:wrap; margin-top: 1rem; }
.actions--primary .btn{ flex: 1 1 260px; padding: 1.25rem; font-size:1.15rem; }
.actions--secondary .btn{ flex: 1 1 150px; }

.error{
  margin-top:1rem;
  padding:.9rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(185,28,28,.32);
  background: rgba(185,28,28,.08);
  color: var(--fail);
}
.hidden{ display:none; }

.flow-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-bottom:1rem;
}
.flow-title{
  font-weight:800;
  font-size:.95rem;
  color:var(--text);
}
.flow-subtitle{
  color:var(--muted);
  font-size:.82rem;
  margin-top:.25rem;
}

.progress{
  flex: 0 0 220px;
  height: 10px;
  background: rgba(128,0,32,.08);
  border: 1px solid rgba(128,0,32,.12);
  border-radius: 999px;
  overflow:hidden;
}
.progress__bar{
  height:100%;
  width:0%;
  background: linear-gradient(90deg, var(--primary), var(--primary-hover));
  border-radius:999px;
  transition: width .25s ease;
}

.scenario-meta{ margin-bottom:1rem; }
.scenario-tag{
  display:inline-block;
  font-size:.78rem;
  color:var(--primary);
  padding:.45rem .7rem;
  border-radius:999px;
  border:1px solid rgba(128,0,32,.15);
  background: rgba(128,0,32,.05);
  font-weight:700;
}
.scenario-heading{ margin:.4rem 0 1.2rem; }
.scenario-code{
  font-size:.8rem;
  color: var(--primary);
  font-weight:800;
  letter-spacing:.04em;
}
.scenario-title{
  font-size:2rem;
  line-height:1.2;
  font-weight:600;
  margin-top:.35rem;
}

.scenario-block{
  margin: 1rem 0;
  padding: 1rem;
  border-radius: 14px;
  border:1px solid rgba(128,0,32,.13);
  background: var(--glass);
}
.scenario-label{
  font-size:.76rem;
  color:var(--muted);
  margin-bottom:.45rem;
  font-weight:700;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.scenario-text{
  font-size:1rem;
  line-height:1.55;
  color:var(--text);
}

.pill-row{ display:flex; gap:10px; flex-wrap:wrap; margin: 1rem 0; }
.pill{
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .55rem .8rem;
  font-size:.85rem;
  background: var(--glass);
  color:var(--primary);
  font-weight:700;
}

.table-wrap{
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow:auto;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.table{
  width:100%;
  border-collapse:collapse;
  min-width:900px;
}
.table th,
.table td{
  text-align:left;
  padding:.8rem;
  border-bottom:1px solid rgba(128,0,32,.08);
  vertical-align:top;
  font-size:.82rem;
}
.table th{
  position:sticky;
  top:0;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(8px);
  z-index:1;
  color:var(--primary);
  font-weight:800;
}

.empty{
  padding:1rem;
  color:var(--muted);
}

@media (max-width: 720px){
  .topbar{
    align-items:flex-start;
    flex-direction:column;
  }
  .topbar__nav{ justify-content:flex-start; }
  .main{ padding-top:28px; }
  .flow-header{ align-items:flex-start; flex-direction:column; }
  .progress{ flex-basis:auto; width:100%; }
  .card{ padding:1.4rem; }
  .card-title,
  .page-title{ font-size:2rem; }
  .scenario-title{ font-size:1.55rem; }
  .input{ font-size:1.35rem; }
  .actions--primary .btn{ flex-basis:100%; }
}
