:root {
  --ink: #101C2C;
  --ink-deep: #0A1420;
  --parchment: #EFEBE1;
  --line: #D9D2C2;
  --text: #17212E;
  --muted: #7A7266;
  --brass: #B8863E;
  --brass-hover: #9C6F2E;
  --error: #AD4A3D;
  --success: #3F6B52;
  --radius: 2px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Public Sans', sans-serif;
  background: var(--parchment);
  color: var(--text);
  min-height: 100vh;
}

.wrap {
  display: grid;
  grid-template-columns: minmax(0, 40%) minmax(0, 60%);
  min-height: 100vh;
}

.side {
  background: linear-gradient(160deg, var(--ink) 0%, var(--ink-deep) 100%);
  color: #EFEBE1;
  position: relative;
  overflow: hidden;
  padding: 56px 56px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mark {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mark svg {
  flex-shrink: 0;
}

.brand-logo {
  height: 72px;
  width: auto;
  display: block;
}

.side-content {
  max-width: 420px;
}

.side-content h1 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: clamp(30px, 3.4vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
}

.side-content p {
  font-size: 15px;
  line-height: 1.6;
  color: #C8C2B4;
  margin: 0;
  max-width: 36ch;
}

.roofline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  opacity: 0.55;
}

.side-footer {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
  color: #A9A28F;
  border-top: 1px solid rgba(239, 235, 225, 0.14);
  padding-top: 18px;
}

.side-footer strong {
  color: #EFEBE1;
  font-weight: 600;
}

.emergency {
  font-size: 13px;
  color: #C8C2B4;
}

.emergency a {
  color: #EFEBE1;
  text-decoration: none;
  border-bottom: 1px solid rgba(239, 235, 225, 0.4);
}

.main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
}

.panel {
  width: 100%;
  max-width: 400px;
}

.panel-head {
  margin-bottom: 32px;
}

.panel-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-head-row .panel-head {
  margin-bottom: 24px;
  flex: 1 1 220px;
}

.agent-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  background: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 7px 14px;
  font-family: 'Public Sans', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--parchment);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.agent-login-btn:hover {
  background: var(--brass-hover);
  border-color: var(--brass-hover);
  color: var(--parchment);
}

.agent-badge {
  display: inline-block;
  background: var(--brass);
  color: var(--parchment);
  font-family: 'Public Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

@media (max-width: 480px) {
  .panel-head-row {
    flex-direction: column;
  }
  .agent-login-btn {
    align-self: flex-start;
  }
}

.eyebrow-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.back-link {
  background: none;
  border: none;
  padding: 0;
  font-family: 'Public Sans', sans-serif;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  display: none;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
}

.back-link.show {
  display: inline-flex;
}

.back-link:hover {
  color: var(--text);
}

.panel h2 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 26px;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.panel .sub {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  margin: 28px 0 22px;
}

.tab {
  background: none;
  border: none;
  padding: 0 0 10px;
  margin-right: 28px;
  font-family: 'Public Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  position: relative;
}

.tab.active {
  color: var(--text);
}

.tab.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--brass);
}

form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}

.field .hint {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.field-group:first-of-type {
  padding-top: 0;
  border-top: none;
}
.field-group-title {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.input-row {
  position: relative;
  border-bottom: 1.5px solid var(--line);
  transition: border-color 0.15s ease;
}

.input-row:focus-within {
  border-color: var(--brass);
}

.input-row input {
  width: 100%;
  border: none;
  background: transparent;
  padding: 9px 2px;
  font-family: 'Public Sans', sans-serif;
  font-size: 15px;
  color: var(--text);
  outline: none;
}

.input-row input::placeholder {
  color: #B3AB9A;
}

.input-row textarea {
  width: 100%;
  border: none;
  background: transparent;
  padding: 9px 2px;
  font-family: 'Public Sans', sans-serif;
  font-size: 15px;
  color: var(--text);
  outline: none;
  resize: vertical;
}

.input-row textarea::placeholder {
  color: #B3AB9A;
}

.toggle-visibility {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  font-family: 'Public Sans', sans-serif;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--ink);
  font-family: 'Public Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.link-btn:hover {
  border-color: var(--ink);
}

button.primary {
  background: var(--ink);
  color: #EFEBE1;
  border: none;
  padding: 14px 20px;
  font-family: 'Public Sans', sans-serif;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.15s ease;
}

button.primary:hover {
  background: var(--brass-hover);
}

button.secondary {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--ink);
  padding: 12.5px 20px;
  font-family: 'Public Sans', sans-serif;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

button.secondary:hover {
  background: var(--ink);
  color: #EFEBE1;
}

.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 26px 0;
  color: var(--muted);
  font-size: 12px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.alt-verify-link {
  font-size: 13px;
  color: var(--muted);
  text-align: left;
  margin-top: 2px;
}

.alt-verify-link button {
  background: none;
  border: none;
  padding: 0;
  color: var(--muted);
  font-family: 'Public Sans', sans-serif;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.alt-verify-link button:hover {
  color: var(--text);
}

.new-customer-box {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.new-customer-box p {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0 0 12px;
  line-height: 1.5;
}

.code-row {
  display: flex;
  gap: 10px;
}

.code-row input {
  width: 44px;
  height: 52px;
  text-align: center;
  font-size: 20px;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--text);
  outline: none;
  font-family: 'Public Sans', sans-serif;
}

.code-row input:focus {
  border-color: var(--brass);
}

.resend {
  font-size: 13px;
  color: var(--muted);
}

.resend button {
  background: none;
  border: none;
  padding: 0;
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  font-family: 'Public Sans', sans-serif;
  font-size: 13px;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 2px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}

.radio-option input[type="radio"] {
  accent-color: var(--ink);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.form-error {
  background: #FBF0EE;
  border: 1px solid #E3B6AE;
  color: var(--error);
  font-size: 13px;
  padding: 10px 12px;
  line-height: 1.5;
}

.banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #FBF8F1;
  border: 1px solid var(--line);
  padding: 12px 14px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 6px;
}

@media (max-width: 860px) {
  .wrap {
    grid-template-columns: 1fr;
  }

  .side {
    padding: 32px 24px 28px;
    min-height: auto;
  }

  .side-content p {
    display: none;
  }

  .roofline {
    display: none;
  }

  .side-footer {
    display: none;
  }

  .main {
    padding: 36px 24px 56px;
  }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 32, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: var(--parchment);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 32px 32px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 60px rgba(10, 20, 32, 0.35);
}

.modal-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-card h3 {
  font-family: 'Fraunces', serif;
  font-size: 21px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
}

.modal-sub {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 22px;
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  font-size: 15px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
}
.modal-close-btn:hover {
  color: var(--text);
}

.cb-page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--parchment);
  transition: opacity 0.25s ease;
}

.cb-page-loader-hide {
  opacity: 0;
  pointer-events: none;
}

.cb-page-loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--line);
  border-top-color: var(--brass);
  border-radius: 50%;
  animation: cb-page-loader-spin 0.8s linear infinite;
}

@keyframes cb-page-loader-spin {
  to { transform: rotate(360deg); }
}

/* ---- Help with password (shared: login page + customer pages) ---- */
.pw-help-row { margin-top: 10px; text-align: left; }
.pw-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Public Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
}
.pw-help:hover, .pw-help:focus-visible { color: var(--text); }
.pw-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font-size: 11px;
  line-height: 1;
}
.pw-help::after {
  content: attr(data-tip);
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  white-space: nowrap;
  background: #0F1B2A;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-2px);
  transition: opacity .15s ease, transform .15s ease;
  z-index: 50;
}
.pw-help:hover::after, .pw-help:focus-visible::after { opacity: 1; transform: translateY(0); }
.pw-help-top { margin-bottom: 14px; }
