.guest-theme {
  --navy: #25364f;
  --blue: #7654a8;
  --sky: #f0ebf8;
}

.guest-theme .topbar {
  background: linear-gradient(115deg, #25364f, #604780);
}

.guest-theme .brand span,
.guest-login-card .login-mark {
  background: #9c7bc8;
}

.guest-login-layout {
  background: radial-gradient(circle at top right, #e9def5, transparent 42%), #f7f5fa;
}

.guest-sidebar {
  border-right-color: #ddd5ea;
}

.guest-sidebar .nav-item {
  display: block;
  text-decoration: none;
}

.header-login {
  background: #fff;
  color: #493665;
  padding: 8px 18px;
  font-size: 13px;
}

.guest-navigation {
  gap: 8px !important;
}

.nav-category {
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid #e6e0ed;
}

.nav-category > p {
  margin: 0 12px 7px;
  color: #776d83;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
}

.guest-sidebar .nav-child {
  padding-left: 28px;
}

.guest-sidebar .nav-item.disabled {
  color: #9b93a8;
  cursor: not-allowed;
}

.guest-sidebar .nav-item.disabled:hover {
  background: transparent;
  font-weight: 400;
}

.guest-placeholder {
  display: grid;
  min-height: 220px;
  max-width: 760px;
  align-content: center;
  justify-items: center;
  text-align: center;
  border-style: dashed;
  background: linear-gradient(145deg, #fff, #f7f3fb);
}

.guest-placeholder h2 {
  margin: 0 0 8px;
}

.guest-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 36px;
  align-items: center;
  margin-top: 30px;
  padding: clamp(30px, 5vw, 58px);
  border: 1px solid #ddd5ea;
  border-radius: 20px;
  background: linear-gradient(135deg, #fff, #f1eaf8);
  box-shadow: 0 18px 48px rgba(67, 44, 91, .08);
}

.guest-hero h2 {
  margin: 4px 0 12px;
  font-size: clamp(24px, 3vw, 38px);
}

.guest-hero p:not(.eyebrow) {
  margin: 0 0 24px;
  color: var(--muted);
}

.hero-mark {
  display: grid;
  width: 150px;
  height: 150px;
  place-items: center;
  justify-self: center;
  border-radius: 38px;
  background: linear-gradient(145deg, #7654a8, #ad8ad3);
  color: #fff;
  font-size: 68px;
  font-weight: 900;
  box-shadow: 0 18px 34px rgba(90, 60, 130, .22);
}

.download-panel {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  max-width: 840px;
  margin-top: 30px;
}

.download-panel h2,
.download-panel p {
  margin: 0;
}

.download-panel p {
  margin-top: 5px;
}

.download-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 12px;
  background: var(--sky);
  color: var(--blue);
  font-size: 24px;
  font-weight: 900;
}

.direct-debit-form {
  max-width: 920px;
}

.application-section .panel-header {
  margin-bottom: 20px;
}

.application-section .phone-field {
  padding: 0;
}

.application-confirm {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: flex-start;
  gap: 10px !important;
  padding: 14px;
  border: 1px solid #d8d0e1;
  border-radius: 9px;
  background: #faf8fc;
}

.application-confirm input {
  width: auto;
  margin-top: 2px;
}

.application-complete {
  max-width: 720px;
  padding: 36px;
  text-align: center;
}

.completion-mark {
  display: grid;
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  place-items: center;
  border-radius: 50%;
  background: #e4f5eb;
  color: #267246;
  font-size: 32px;
  font-weight: 900;
}

.application-complete dl {
  display: inline-grid;
  grid-template-columns: auto auto;
  gap: 8px 14px;
  margin: 18px 0 24px;
  padding: 12px 18px;
  border-radius: 8px;
  background: #f5f2f7;
  text-align: left;
}

.application-complete dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.application-complete dd {
  margin: 0;
  font-family: ui-monospace, monospace;
}

.application-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 24px 0;
}

.application-card {
  padding: 24px;
  border: 1px solid #ddd5e5;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 8px 24px rgb(49 34 61 / 7%);
}

.application-card:hover {
  border-color: #9275b1;
  transform: translateY(-1px);
}

.application-card > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 10px;
  background: #eee7f4;
  color: #67468c;
  font-size: 24px;
  font-weight: 800;
}

.application-card.caution > span {
  background: #faecef;
  color: #9a3f56;
}

.application-card h2 {
  margin: 16px 0 6px;
  font-size: 18px;
}

.application-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.guest-hero.compact {
  grid-template-columns: 1fr;
}

.form-section {
  padding: clamp(20px, 3vw, 30px);
}

.pdf-form-section {
  overflow: hidden;
  padding: 0;
  border-color: #b9afc4;
  border-radius: 8px;
}

.pdf-form-section > .panel-header,
.pdf-form-section > .choice-group,
.pdf-form-section > .date-grid {
  padding-right: clamp(18px, 3vw, 28px);
  padding-left: clamp(18px, 3vw, 28px);
}

.pdf-form-section > .panel-header {
  margin: 0;
  padding-top: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #cec6d6;
  background: #f5f2f7;
}

.pdf-form-section > .choice-group {
  margin: 0;
  padding-top: 18px;
  padding-bottom: 18px;
}

.date-grid {
  justify-content: end;
  padding-top: 18px;
  padding-bottom: 20px;
}

.date-field {
  width: min(300px, 100%);
}

.required-note {
  color: #8a3d63;
  font-size: 11px;
  font-weight: 700;
}

.form-grid {
  display: grid;
  gap: 18px;
}

.form-grid.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pdf-field-table {
  border-top: 1px solid #b9afc4;
}

.pdf-field-table .form-grid,
.pdf-field-table.form-grid {
  gap: 0;
}

.bank-name-grid {
  grid-template-columns: 1.25fr .9fr 1fr .72fr;
}

.master-lookup {
  position: relative;
  min-width: 0;
  border-right: 1px solid #d8d1df;
  border-bottom: 1px solid #d8d1df;
  background: #fff;
}

.master-lookup > label {
  height: 100%;
  border: 0;
}

.master-results {
  position: absolute;
  z-index: 20;
  top: calc(100% - 6px);
  right: 8px;
  left: 8px;
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid #b9afc4;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 12px 30px rgb(49 34 61 / 18%);
}

.master-option {
  display: grid;
  width: 100%;
  gap: 3px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #eee8f1;
  background: #fff;
  color: #40364a;
  text-align: left;
  cursor: pointer;
}

.master-option:last-child {
  border-bottom: 0;
}

.master-option:hover,
.master-option.active {
  background: #f1eaf5;
}

.master-option span,
.master-empty {
  color: #6f6478;
  font-size: 11px;
}

.master-empty {
  margin: 0;
  padding: 12px;
}

input[readonly] {
  background: #f5f2f7;
}

.bank-code-grid {
  grid-template-columns: .8fr .72fr .75fr 1.25fr;
  border-top: 1px solid #d8d1df;
}

.post-grid {
  grid-template-columns: 1fr 1fr 1.5fr;
}

.account-holder-grid {
  gap: 0;
}

.pdf-field-table label,
.pdf-field-table .phone-field {
  min-width: 0;
  padding: 11px 12px 13px;
  border-right: 1px solid #d8d1df;
  border-bottom: 1px solid #d8d1df;
  background: #fff;
}

.pdf-field-table label:last-child,
.pdf-field-table .full-width {
  border-right: 0;
}

.pdf-field-table label:last-child,
.pdf-field-table .phone-field:last-child {
  border-bottom: 0;
}

.form-grid label {
  display: grid;
  gap: 7px;
  color: #40364a;
  font-size: 13px;
  font-weight: 700;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  border: 1px solid #c9bfd4;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
}

.form-grid textarea {
  resize: vertical;
  line-height: 1.6;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(118, 84, 168, .14);
}

.form-grid small {
  color: var(--muted);
  font-weight: 400;
}

.phone-field {
  margin: 0;
  border: 0;
}

.phone-field legend {
  margin-bottom: 7px;
  color: #40364a;
  font-size: 13px;
  font-weight: 700;
}

.phone-inputs {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) auto minmax(80px, .75fr) auto minmax(110px, 1.2fr);
  gap: 10px;
  align-items: center;
  max-width: 560px;
}

.phone-inputs span {
  color: #675c71;
  font-size: 20px;
}

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

.choice-group {
  display: flex;
  gap: 18px;
  margin: 0 0 22px;
  padding: 0;
  border: 0;
}

.choice-group legend {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
}

.choice {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  border: 1px solid #d8d0e1;
  border-radius: 9px;
  background: #faf8fc;
  font-size: 13px;
}

.conditional-fields[hidden] {
  display: none;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

.form-actions form {
  margin: 0;
}

.form-errors {
  max-width: 920px;
  background: #fbecef;
  color: #812e45;
}

.form-errors ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.confirmation-panel {
  max-width: 920px;
}

.confirmation-list {
  margin: 0;
}

.confirmation-list > div {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  border-top: 1px solid #e5dfeb;
}

.confirmation-list dt,
.confirmation-list dd {
  margin: 0;
  padding: 13px 12px;
}

.confirmation-list dt {
  color: #61566c;
  font-size: 12px;
  font-weight: 800;
}

.confirmation-list dd {
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .guest-shell {
    grid-template-columns: 1fr;
  }

  .guest-shell .guest-sidebar {
    display: flex;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid #ddd5ea;
  }

  .guest-navigation {
    display: flex !important;
    align-items: center;
    overflow-x: auto;
  }

  .nav-category {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0 0 0 8px;
    border-top: 0;
    border-left: 1px solid #e6e0ed;
  }

  .nav-category > p,
  .guest-shell .environment {
    display: none;
  }

  .guest-sidebar .nav-child {
    padding-left: 14px;
  }

  .guest-hero {
    grid-template-columns: 1fr;
  }

  .application-card-grid {
    grid-template-columns: 1fr;
  }

  .hero-mark {
    display: none;
  }

  .download-panel {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .download-panel .status-pill {
    grid-column: 2;
  }

  .form-grid.two-columns {
    grid-template-columns: 1fr;
  }

  .bank-name-grid,
  .bank-code-grid,
  .post-grid {
    grid-template-columns: 1fr;
  }

  .master-lookup {
    border-right: 0;
  }

  .pdf-field-table label {
    border-right: 0;
  }

  .date-grid {
    justify-content: stretch;
  }

  .date-field {
    width: 100%;
  }

  .phone-inputs {
    grid-template-columns: 1fr auto 1fr auto 1fr;
    gap: 6px;
  }

  .choice-group {
    display: grid;
  }

  .confirmation-list > div {
    grid-template-columns: 1fr;
  }

  .confirmation-list dt {
    padding-bottom: 0;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .form-actions .button {
    width: 100%;
  }
}
