/* XBN standalone auth shell + login/register cards */

:root {
  --auth-background:
    radial-gradient(1200px 500px at 50% -10%, rgba(19, 188, 233, 0.12), transparent 60%),
    linear-gradient(165deg, #f5f8fd 0%, #e8eef8 48%, #f3f7fd 100%);
}

.auth-shell-body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--auth-background);
}

.auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.auth-shell__tools {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: clamp(10px, 1.8vh, 16px) 20px 0;
  width: min(100%, 1200px);
  margin: 0 auto;
  box-sizing: border-box;
}

.auth-shell__theme {
  min-width: 42px;
  min-height: 42px;
  padding: 0 10px;
}

.auth-main {
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vh, 48px) 16px clamp(12px, 2vh, 24px);
  box-sizing: border-box;
  width: 100%;
  min-height: 0;
}

.auth-footer {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px 10px;
  flex-wrap: wrap;
  padding: 12px 24px clamp(14px, 2.5vh, 24px);
  text-align: center;
  color: #8a97ad;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
}

.auth-footer a {
  color: #66758f;
  text-decoration: none;
}

.auth-footer a:hover {
  color: #1664ea;
  text-decoration: underline;
}

.auth-footer .sep {
  color: #c5d0e0;
  user-select: none;
}

.xbn-login {
  width: min(100%, 560px);
  box-sizing: border-box;
}

.xbn-login__card {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid color-mix(in srgb, #1664ea 16%, #d9e3f0);
  border-radius: 20px;
  padding: clamp(28px, 4vw, 44px);
  box-shadow:
    0 12px 32px rgba(15, 45, 95, 0.08),
    0 2px 8px rgba(15, 45, 95, 0.04);
  position: relative;
  box-sizing: border-box;
  height: auto;
}

.xbn-login__card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(90deg, #071424, #1664ea 45%, #13bce9);
}

.xbn-login__brand {
  display: grid;
  justify-items: center;
  gap: clamp(6px, 1vh, 10px);
  margin-bottom: clamp(16px, 2.5vh, 24px);
  text-align: center;
}

.xbn-login__brand img {
  display: block;
  width: min(220px, 78vw);
  height: auto;
  max-height: clamp(48px, 8vh, 68px);
  object-fit: contain;
}

.xbn-login__brand-mark {
  margin: 0;
  color: #087e8b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.xbn-login__title {
  margin: 0 0 clamp(6px, 1vh, 8px);
  color: #0d1b35;
  font-size: clamp(1.65rem, 2.6vw + 0.4rem, 2.15rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  text-align: center;
}

.xbn-login__subtitle {
  margin: 0 0 clamp(18px, 3vh, 28px);
  color: #66758f;
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
}

.xbn-login__alert {
  background: #fff0f0;
  border: 1px solid #f1b6b6;
  color: #b42318;
  border-radius: 10px;
  padding: 12px 14px;
  font-weight: 650;
  font-size: 13px;
  margin-bottom: 18px;
}

.xbn-login__field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.xbn-login__field > span.label {
  font-size: 13px;
  font-weight: 750;
  color: #0d1b35;
}

.xbn-login__control {
  position: relative;
}

.xbn-login__control input {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border: 1.5px solid #d9e3f0;
  border-radius: 12px;
  background: #f8faff;
  color: #0d1b35;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.xbn-login__control--password input {
  padding-right: 52px;
}

.xbn-login__control input:hover {
  border-color: color-mix(in srgb, #1664ea 35%, #d9e3f0);
}

.xbn-login__control input:focus {
  background: #fff;
  border-color: #1664ea;
  box-shadow: 0 0 0 4px rgba(22, 100, 234, 0.14);
}

.xbn-login__control input:-webkit-autofill,
.xbn-login__control input:-webkit-autofill:hover,
.xbn-login__control input:-webkit-autofill:focus {
  -webkit-text-fill-color: #0d1b35;
  box-shadow: 0 0 0 1000px #f8faff inset;
  transition: background-color 9999s ease-out;
}

.xbn-login__toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #66758f;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.xbn-login__toggle:hover,
.xbn-login__toggle:focus-visible {
  color: #1664ea;
  background: rgba(22, 100, 234, 0.08);
  outline: none;
}

.xbn-login__field.is-invalid input {
  border-color: #c43b45;
  background: #fff8f8;
}

.xbn-login__error {
  display: none;
  color: #c43b45;
  font-size: 12px;
  font-weight: 650;
}

.xbn-login__field.is-invalid .xbn-login__error {
  display: block;
}

.xbn-login__options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  flex-wrap: wrap;
  margin: 6px 0 24px;
}

.xbn-login__remember {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 650;
  color: #475569;
  cursor: pointer;
  min-height: 44px;
}

.xbn-login__remember input {
  width: 18px;
  height: 18px;
  accent-color: #1664ea;
}

.xbn-login__forgot {
  color: #1664ea;
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.xbn-login__forgot:hover {
  text-decoration: underline;
}

.xbn-login__submit {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 12px;
  padding: 14px 20px;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  background: linear-gradient(135deg, #071424 0%, #1664ea 58%, #13bce9 140%);
  box-shadow: 0 8px 22px rgba(22, 100, 234, 0.28);
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.xbn-login__submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(22, 100, 234, 0.34);
  filter: brightness(1.03);
}

.xbn-login__submit:focus-visible {
  outline: 3px solid rgba(22, 100, 234, 0.35);
  outline-offset: 2px;
}

.xbn-login__submit:disabled,
.xbn-login__submit.is-loading {
  cursor: wait;
  opacity: 0.9;
  transform: none;
  filter: none;
}

.xbn-login__submit .loader {
  display: none;
}

.xbn-login__divider {
  position: relative;
  text-align: center;
  margin: 22px 0 18px;
}

.xbn-login__divider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: #e2e8f0;
}

.xbn-login__divider span {
  position: relative;
  z-index: 1;
  display: inline-block;
  padding: 0 14px;
  background: #fff;
  color: #8a97ad;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.xbn-login__register {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: 1.5px solid #d9e3f0;
  border-radius: 12px;
  background: #fff;
  color: #0d1b35;
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.xbn-login__register:hover {
  border-color: #1664ea;
  color: #1664ea;
  background: #f8faff;
}

@media (max-width: 768px) {
  .xbn-login {
    width: min(100%, calc(100% - 32px));
  }
  .xbn-login__card {
    border-radius: 18px;
  }
}

@media (max-width: 480px) {
  .auth-main {
    padding-inline: 12px;
  }
  .xbn-login {
    width: min(100%, calc(100% - 24px));
  }
  .xbn-login__options {
    flex-direction: column;
    align-items: flex-start;
  }
  .xbn-login__brand img {
    width: min(160px, 72vw);
  }
}

@media (max-height: 760px) {
  .auth-shell__tools {
    padding-top: 8px;
  }
  .auth-main {
    padding-top: 16px;
    padding-bottom: 12px;
    place-items: start center;
  }
  .auth-footer {
    padding-top: 8px;
    padding-bottom: 14px;
  }
  .xbn-login__card {
    padding: 28px;
  }
  .xbn-login__brand {
    margin-bottom: 14px;
  }
  .xbn-login__brand img {
    max-height: 64px;
  }
  .xbn-login__subtitle {
    margin-bottom: 18px;
  }
  .xbn-login__options {
    margin-bottom: 16px;
  }
  .xbn-login__divider {
    margin: 14px 0 12px;
  }
}

@media (max-height: 640px) {
  .auth-main {
    padding-top: 12px;
    padding-bottom: 8px;
  }
  .xbn-login__card {
    padding: 22px 20px;
  }
  .xbn-login__control input,
  .xbn-login__control select {
    min-height: 46px;
  }
  .xbn-login__submit,
  .xbn-login__register {
    min-height: 46px;
  }
}

[data-theme="dark"] .auth-shell-body {
  --auth-background:
    radial-gradient(1000px 420px at 50% -8%, rgba(22, 100, 234, 0.18), transparent 55%),
    linear-gradient(165deg, #081426 0%, #0c1a2e 55%, #081426 100%);
}
[data-theme="dark"] .xbn-login__card {
  background: #101f35;
  border-color: #29405c;
}
[data-theme="dark"] .xbn-login__title,
[data-theme="dark"] .xbn-login__field > span.label,
[data-theme="dark"] .xbn-login__register {
  color: #edf5ff;
}
[data-theme="dark"] .xbn-login__subtitle,
[data-theme="dark"] .xbn-login__remember,
[data-theme="dark"] .auth-footer a {
  color: #9eb0c7;
}
[data-theme="dark"] .xbn-login__control input,
[data-theme="dark"] .xbn-login__register {
  background: #142741;
  border-color: #29405c;
  color: #edf5ff;
}
[data-theme="dark"] .xbn-login__divider span {
  background: #101f35;
  color: #9eb0c7;
}
[data-theme="dark"] .xbn-login__divider::before {
  background: #29405c;
}
[data-theme="dark"] .auth-footer .sep {
  color: #3a516c;
}

@media (prefers-reduced-motion: reduce) {
  .xbn-login__submit,
  .xbn-login__submit .loader,
  .xbn-account-type {
    transition: none !important;
    animation: none !important;
  }
}

/* —— Wide chooser + register form variants —— */

.xbn-login--wide {
  width: min(100%, 1060px);
}

.xbn-login--wide .xbn-login__card {
  max-width: 1060px;
  padding: clamp(28px, 3.5vw, 40px);
}

.xbn-login--form {
  width: min(100%, 760px);
}

.xbn-login--form .xbn-login__card {
  max-width: 760px;
  padding: clamp(28px, 3.5vw, 40px);
}

.xbn-login__control select {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border: 1.5px solid #d9e3f0;
  border-radius: 12px;
  background: #f8faff;
  color: #0d1b35;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.xbn-login__control select:hover {
  border-color: color-mix(in srgb, #1664ea 35%, #d9e3f0);
}

.xbn-login__control select:focus {
  background: #fff;
  border-color: #1664ea;
  box-shadow: 0 0 0 4px rgba(22, 100, 234, 0.14);
}

.xbn-login__back {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin: 0 0 22px;
  color: #1664ea;
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
}

.xbn-login__back:hover {
  text-decoration: underline;
}

.xbn-login__submit:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  filter: none;
  box-shadow: none;
}

.account-types {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  width: 100%;
  margin-bottom: clamp(18px, 3vh, 28px);
  align-items: stretch;
}

.xbn-account-type {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  gap: 10px;
  min-width: 0;
  min-height: 100%;
  margin: 0;
  padding: 22px 20px 18px;
  border: 1.5px solid #d9e3f0;
  border-radius: 16px;
  background: #fff;
  color: #0d1b35;
  cursor: pointer;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  word-break: break-word;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.xbn-account-type input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.xbn-account-type__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: #1664ea;
  background: rgba(22, 100, 234, 0.08);
  border: 1px solid rgba(22, 100, 234, 0.18);
}

.xbn-account-type__title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.xbn-account-type__desc {
  color: #66758f;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

.xbn-account-type__hint {
  color: #8a97ad;
  font-size: 12px;
  font-weight: 650;
}

.xbn-account-type__badge {
  display: none;
  align-items: center;
  gap: 6px;
  width: max-content;
  margin-top: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(22, 100, 234, 0.1);
  color: #1664ea;
  font-size: 12px;
  font-weight: 750;
}

.xbn-account-type:hover {
  border-color: color-mix(in srgb, #1664ea 45%, #d9e3f0);
  background: #f8faff;
}

.xbn-account-type:focus-within,
.xbn-account-type.is-selected,
.xbn-account-type:has(input:checked) {
  border-color: #1664ea;
  background: #f3f8ff;
  box-shadow: 0 0 0 4px rgba(22, 100, 234, 0.12);
}

.xbn-account-type.is-selected .xbn-account-type__badge,
.xbn-account-type:has(input:checked) .xbn-account-type__badge {
  display: inline-flex;
}

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

.xbn-register-section {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px;
  background: #f8faff;
}

.xbn-register-section h2 {
  margin: 0 0 14px;
  color: #0d1b35;
  font-size: 1rem;
  font-weight: 800;
}

.xbn-register-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.xbn-register-legal {
  margin: 0;
  color: #66758f;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.xbn-register-legal a {
  color: #1664ea;
  font-weight: 750;
  text-decoration: none;
}

.xbn-register-legal a:hover {
  text-decoration: underline;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.xbn-login__alert--success {
  background: #e8f7ee;
  border-color: #86efac;
  color: #14532d;
}

.xbn-plan-cards {
  display: grid;
  gap: 10px;
  border: 0;
  padding: 0;
  margin: 12px 0 0;
}

.xbn-plan-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1.5px solid #c9d7ea;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.xbn-plan-card input {
  margin: 0;
  width: 18px;
  height: 18px;
  accent-color: #1664ea;
}

.xbn-plan-card__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.xbn-plan-card__name {
  font-weight: 750;
  color: #0f172a;
  font-size: 1rem;
}

.xbn-plan-card__meta,
.xbn-plan-card__benefit {
  font-size: 0.86rem;
  color: #64748b;
  line-height: 1.35;
}

.xbn-plan-card__price {
  font-weight: 800;
  font-size: 1.15rem;
  color: #0f172a;
  white-space: nowrap;
  text-align: right;
}

.xbn-plan-card:hover {
  border-color: #93c5fd;
}

.xbn-plan-card.is-selected,
.xbn-plan-card:has(input:checked) {
  border-color: #1664ea;
  background: #f4f8ff;
  box-shadow: 0 0 0 1px #1664ea inset;
}

.xbn-plan-cards.is-invalid .xbn-plan-card {
  border-color: #fca5a5;
}

.xbn-plan-coupon {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-top: 14px;
}

.xbn-plan-coupon__btn {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 16px;
}

.xbn-plan-provider-note {
  margin: 12px 0 0;
  font-size: 0.9rem;
  color: #475569;
}

.xbn-plan-summary {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid #d7e3f4;
  border-radius: 14px;
  background: #f8fbff;
}

.xbn-plan-summary h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 750;
  color: #0f172a;
}

.xbn-plan-summary dl {
  margin: 0;
  display: grid;
  gap: 8px;
}

.xbn-plan-summary dl > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.xbn-plan-summary dt {
  margin: 0;
  color: #64748b;
  font-size: 0.9rem;
}

.xbn-plan-summary dd {
  margin: 0;
  font-weight: 650;
  color: #0f172a;
  text-align: right;
}

.xbn-plan-summary__due dd {
  font-size: 1.1rem;
  font-weight: 800;
  color: #1664ea;
}

.xbn-plan-consent {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 14px;
}

@media (max-width: 900px) {
  .xbn-login--wide {
    width: min(100%, 920px);
  }
  .account-types {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .account-types > :last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .xbn-login--wide,
  .xbn-login--form {
    width: min(100%, calc(100% - 32px));
  }
}

@media (max-width: 640px) {
  .account-types {
    grid-template-columns: 1fr;
  }
  .account-types > :last-child {
    grid-column: auto;
  }
  .xbn-register-grid {
    grid-template-columns: 1fr;
  }
  .xbn-login--wide .xbn-login__title {
    font-size: 1.55rem;
  }
  .xbn-login .btn,
  .xbn-login button[type="submit"],
  .xbn-register-grid + .row-actions .btn,
  .xbn-login__actions .btn {
    width: 100%;
  }
  .xbn-plan-card {
    grid-template-columns: auto 1fr;
  }
  .xbn-plan-card input {
    align-self: start;
    margin-top: 2px;
  }
  .xbn-plan-card__price {
    grid-column: 2;
    text-align: left;
    margin-top: 2px;
  }
  .xbn-plan-coupon {
    flex-direction: column;
    align-items: stretch;
  }
  .xbn-plan-coupon__btn {
    width: 100%;
  }
}

[data-theme="dark"] .xbn-account-type {
  background: #142741;
  border-color: #29405c;
  color: #edf5ff;
}
[data-theme="dark"] .xbn-account-type__desc,
[data-theme="dark"] .xbn-account-type__hint,
[data-theme="dark"] .xbn-register-legal {
  color: #9eb0c7;
}
[data-theme="dark"] .xbn-account-type:hover,
[data-theme="dark"] .xbn-account-type.is-selected,
[data-theme="dark"] .xbn-account-type:has(input:checked),
[data-theme="dark"] .xbn-account-type:focus-within {
  background: #173255;
  border-color: #3b82f6;
}
[data-theme="dark"] .xbn-register-section {
  background: #142741;
  border-color: #29405c;
}
[data-theme="dark"] .xbn-register-section h2 {
  color: #edf5ff;
}
[data-theme="dark"] .xbn-login__control select {
  background: #142741;
  border-color: #29405c;
  color: #edf5ff;
}
[data-theme="dark"] .xbn-plan-card {
  background: #0f1f35;
  border-color: #29405c;
}
[data-theme="dark"] .xbn-plan-card__name,
[data-theme="dark"] .xbn-plan-card__price,
[data-theme="dark"] .xbn-plan-summary h3,
[data-theme="dark"] .xbn-plan-summary dd {
  color: #edf5ff;
}
[data-theme="dark"] .xbn-plan-card__meta,
[data-theme="dark"] .xbn-plan-card__benefit,
[data-theme="dark"] .xbn-plan-provider-note,
[data-theme="dark"] .xbn-plan-summary dt {
  color: #9eb0c7;
}
[data-theme="dark"] .xbn-plan-card.is-selected,
[data-theme="dark"] .xbn-plan-card:has(input:checked) {
  background: #173255;
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6 inset;
}
[data-theme="dark"] .xbn-plan-summary {
  background: #0f1f35;
  border-color: #29405c;
}
[data-theme="dark"] .xbn-plan-summary__due dd {
  color: #60a5fa;
}
[data-theme="dark"] .xbn-login__alert--success {
  background: #123222;
  border-color: #166534;
  color: #bbf7d0;
}
