:root {
  --navy: #0E2240;
  --teal: #0D7B6A;
  --teal-l: #E8F5F3;
  --gold: #B8920A;
  --gold-l: #FDF8EC;
  --slate: #4A5E75;
  --mist: #F2F5F9;
  --border: #D8E0EB;
  --green: #1A6B3A;
  --green-l: #E6F4EC;
  --red: #9B2335;
  --red-l: #FDECEA;
  --amber: #C47B1A;
  --amber-l: #FEF3E2;
  --grey: #5A6E82;
  --grey-l: #F0F4F8;
}

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

body {
  font-family: 'Outfit', sans-serif;
  background: var(--mist);
  color: var(--navy);
  margin: 0;
}

h1, h2, h3, .font-serif {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  color: var(--navy);
}

.font-mono {
  font-family: 'DM Mono', monospace;
}

/* Top nav */
.bd-nav {
  background: var(--navy);
  padding: 11px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bd-brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}

.bd-brand .bd-brand-accent { color: var(--teal); }

.bd-nav-links { display: flex; align-items: center; gap: 18px; }
.bd-nav-links a { font-size: 12px; color: rgba(255,255,255,.6); text-decoration: none; }
.bd-nav-links a:hover { color: #fff; }

.bd-btn-login {
  border: 1px solid rgba(255,255,255,.2);
  padding: 6px 16px;
  border-radius: 4px;
  color: #fff !important;
}
.bd-btn-login:hover { border-color: var(--teal) !important; color: var(--teal) !important; }

/* Sidebar (Area shell) */
.bd-shell { display: flex; min-height: 100vh; }
.bd-sidebar {
  width: 218px;
  flex-shrink: 0;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.bd-sidebar-brand { padding: 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.bd-sidebar-brand .bd-sidebar-url { font-size: 9px; color: rgba(255,255,255,.28); margin-top: 2px; }
.bd-sidebar-role {
  font-family: 'DM Mono', monospace;
  font-size: 8px;
  color: var(--teal);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-top: 5px;
  padding: 2px 7px;
  background: rgba(13,123,106,.15);
  border-radius: 3px;
  display: inline-block;
}
.bd-sidebar-nav { flex: 1; padding: 8px 0; }
.bd-nav-section-label {
  padding: 6px 16px 2px;
  font-family: 'DM Mono', monospace;
  font-size: 8px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.22);
}
.bd-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  font-size: 11.5px;
  color: rgba(255,255,255,.48);
  border-left: 2px solid transparent;
  text-decoration: none;
}
.bd-nav-item:hover { color: rgba(255,255,255,.82); background: rgba(255,255,255,.04); }
.bd-nav-item.active { color: #fff; border-left-color: var(--teal); background: rgba(255,255,255,.06); font-weight: 500; }
.bd-sidebar-user {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 8px;
}
.bd-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(13,123,106,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: var(--teal);
  object-fit: cover; flex-shrink: 0;
}
.bd-sidebar-user-link { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; text-decoration: none; }
.bd-sidebar-user-link:hover .bd-sidebar-user-name { text-decoration: underline; }
.bd-sidebar-user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-sidebar-user form { flex-shrink: 0; }
.bd-content { flex: 1; padding: 24px 26px; overflow-x: auto; }

/* Buttons */
.bd-btn-primary {
  background: var(--teal);
  color: #fff;
  border: none;
  padding: 11px 28px;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.bd-btn-primary:hover { background: #0A6658; color: #fff; }

.bd-btn-secondary {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--border);
  padding: 11px 24px;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

/* Cards / forms */
.bd-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px 28px;
}

.bd-field { margin-bottom: 16px; }
.bd-field label {
  display: block;
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 6px;
}
.bd-field input, .bd-field select, .bd-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  color: var(--navy);
}
.bd-field input:focus, .bd-field select:focus, .bd-field textarea:focus {
  outline: none;
  border-color: var(--teal);
}

.bd-alert {
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 12.5px;
  margin-bottom: 16px;
}
.bd-alert-error { background: var(--red-l); color: var(--red); border: 1px solid rgba(155,35,53,.2); }
.bd-alert-info { background: var(--teal-l); color: var(--teal); border: 1px solid rgba(13,123,106,.2); }

/* Status badges */
.bd-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 4px; font-size: 10px; font-weight: 500; }
.bd-badge-received { background: var(--grey-l); color: var(--grey); }
.bd-badge-pending { background: var(--amber-l); color: var(--amber); }
.bd-badge-review { background: var(--teal-l); color: var(--teal); }
.bd-badge-actuary { background: var(--amber-l); color: var(--amber); }
.bd-badge-ready { background: var(--green-l); color: var(--green); }
.bd-badge-declined { background: var(--red-l); color: var(--red); }

.bd-footer {
  text-align: center;
  padding: 14px;
  font-size: 10px;
  color: #9AAABB;
}

/* Renewal calendar */
.bd-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.bd-cal-weekday { background: var(--mist); padding: 8px 6px; font-family: 'DM Mono', monospace; font-size: 9px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; color: var(--slate); text-align: center; }
.bd-cal-cell { background: #fff; min-height: 68px; padding: 6px 8px; display: flex; flex-direction: column; gap: 4px; }
.bd-cal-dim { background: var(--mist); }
.bd-cal-dim .bd-cal-daynum { color: #B7C2D0; }
.bd-cal-today { box-shadow: inset 0 0 0 2px var(--teal); }
.bd-cal-daynum { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--navy); }
.bd-cal-dot { background: var(--teal-l); color: var(--teal); border-radius: 4px; padding: 2px 6px; font-size: 9.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-footer .bd-brand-accent { color: var(--teal); }

/* Wizard step bar */
.bd-step-bar { display: flex; align-items: center; margin-bottom: 26px; }
.bd-step { display: flex; align-items: center; }
.bd-step-num {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; flex-shrink: 0;
}
.bd-step-num.on { background: var(--teal); color: #fff; }
.bd-step-num.off { background: var(--border); color: var(--slate); }
.bd-step-label { font-size: 11.5px; margin-left: 5px; }
.bd-step-label.on { font-weight: 500; color: var(--navy); }
.bd-step-label.off { color: #9AAABB; }
.bd-step-divider { flex: 1; height: 1px; background: var(--border); margin: 0 9px; }

/* Wizard market cards */
.bd-market-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 20px; }
.bd-market-card { background: #fff; border: 2px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.bd-market-card.sel { border-color: var(--teal); box-shadow: 0 4px 16px rgba(13,123,106,.15); }
.bd-market-card-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.bd-market-name { font-family: 'Cormorant Garamond', serif; font-size: 17px; font-weight: 600; color: var(--navy); }
.bd-coverage-lines { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.bd-check-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--navy); }
.bd-check-row input { width: 15px; height: 15px; accent-color: var(--teal); }
.bd-market-toggle { width: 18px; height: 18px; accent-color: var(--teal); }

.bd-wizard-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; }

table.bd-table { width: 100%; border-collapse: collapse; }
table.bd-table th { padding: 8px 12px; font-family: 'DM Mono', monospace; font-size: 9px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; color: var(--slate); text-align: left; border-bottom: 1px solid var(--border); }
table.bd-table td { padding: 10px 12px; font-size: 12px; color: var(--slate); border-bottom: 1px solid #F5F7FA; }

/* Confirmation reference cards */
.bd-ref-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-bottom: 22px; }
.bd-ref-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.bd-ref-card-hd { padding: 14px 16px 12px; }
.bd-ref-tag { font-family: 'DM Mono', monospace; font-size: 7.5px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; padding: 2px 7px; border-radius: 3px; margin-bottom: 8px; display: inline-block; background: var(--teal-l); color: var(--teal); }
.bd-ref-name { font-family: 'Cormorant Garamond', serif; font-size: 16px; font-weight: 600; color: var(--navy); margin-bottom: 10px; }
.bd-ref-number { font-family: 'DM Mono', monospace; font-size: 22px; font-weight: 500; letter-spacing: .06em; color: var(--teal); }
.bd-ref-body { padding: 10px 16px 14px; border-top: 1px solid var(--border); }
.bd-ref-row { display: flex; flex-direction: column; gap: 1px; margin-bottom: 8px; }
.bd-ref-label { font-family: 'DM Mono', monospace; font-size: 7px; font-weight: 500; letter-spacing: .07em; text-transform: uppercase; color: var(--slate); }
.bd-ref-value { font-size: 11px; font-weight: 500; color: var(--navy); }
.bd-ref-turnaround { margin-top: 10px; padding: 8px 11px; border-radius: 6px; font-size: 11px; font-weight: 500; background: var(--teal-l); color: var(--teal); }

.bd-security-note { background: var(--navy); border-radius: 8px; padding: 14px 18px; margin-bottom: 20px; }
.bd-security-note p { font-size: 11.5px; color: rgba(255,255,255,.6); font-weight: 300; line-height: 1.6; }
.bd-security-note strong { color: rgba(255,255,255,.9); font-weight: 500; }

.bd-timeline-entry { display: flex; align-items: flex-start; gap: 12px; padding-bottom: 14px; position: relative; }
.bd-timeline-entry:not(:last-child)::before { content: ''; position: absolute; left: 13px; top: 28px; bottom: 0; width: 1px; background: var(--border); }
.bd-timeline-num { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; position: relative; z-index: 1; }
.bd-timeline-num.done { background: var(--green-l); color: var(--green); border: 2px solid var(--green); }
.bd-timeline-num.next { background: var(--teal-l); color: var(--teal); border: 2px solid rgba(13,123,106,.3); }
.bd-timeline-num.future { background: var(--mist); color: var(--slate); border: 2px solid var(--border); }

/* GoTrue's MFA enroll QR comes back as a full standalone SVG with its own width/height attributes --
   override them so it fills whatever container hosts it. */
[data-qr-container] svg { width: 100%; height: 100%; }
