@font-face {
  font-family: Montserrat;
  src: url("montserrat.ttf") format("truetype");
  font-weight: 100 900;
  font-display: block;
}

:root {
  --blue: #2d297c;
  --orange: #ff9d5a;
  --background: #f4f2fc;
  --ink: #19172d;
  --muted: #59536e;
  --purple: #4e2a9c;
  --border: #ded6f4;
  --divider: #e7e1f2;
}

* { box-sizing: border-box; }
.font-pending body { visibility: hidden; }
body { margin: 0; background: var(--background); color: var(--ink); font: 500 14px/1.45 Montserrat, Arial, sans-serif; }
body:has(dialog[open]) { overflow: hidden; }
a { color: var(--purple); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
.brand img, .drawer-head img, .foot .logo img { height: auto; }
body > svg[hidden] { position: absolute; width: 0; height: 0; }
p, dl, dd { margin: 0; }
h1, h2 { margin: 0; line-height: 1.2; font-size: 20px; font-weight: 750; }
:focus-visible { outline: 3px solid #845de2; outline-offset: 3px; }
.sr-only, .skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip { position: absolute; z-index: 2; top: 8px; left: 8px; background: white; padding: 10px; }

.wrap { width: min(1200px, calc(100% - 32px)); margin-inline: auto; }
.site-header { background: var(--blue); color: white; }
.topbar {
  min-height: 88px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}
.brand { justify-self: start; }
.brand img { display: block; width: 90px; }
.desktop-nav { display: flex; align-items: center; gap: 6px; }
.desktop-nav a, .exit { color: white; font-weight: 700; }
.desktop-nav a { padding: 11px 12px; border-radius: 8px; }
.desktop-nav a[aria-current="page"] { background: #443d93; color: var(--orange); }
.exit { justify-self: end; }
.exit::before { content: "↪ "; color: var(--orange); }
.menu-button {
  display: none;
  justify-self: end;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--orange);
}
.menu-button .icon { width: 25px; height: 25px; }
.drawer {
  inset: 0 auto 0 0;
  margin: 0;
  width: min(280px, 100%);
  height: 100%;
  max-height: none;
  padding: 20px;
  border: 0;
  background: #f7f7fd;
  color: var(--blue);
}
.drawer[open] { display: flex; flex-direction: column; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.drawer-head img { width: 94px; display: block; }
.drawer nav, .drawer-end { display: grid; gap: 5px; }
.drawer nav a, .drawer-end > a { color: inherit; font-size: 16px; font-weight: 700; padding: 10px; }
.drawer nav a[aria-current="page"] { color: var(--orange); }
.drawer-end { margin-top: auto; padding-top: 20px; }
.drawer-end .social { justify-content: flex-start; margin: 0 10px 8px; }

main { padding-block: 24px 44px; }
main.profile { padding-bottom: 72px; }
.crumb { color: var(--muted); margin-bottom: 13px; overflow-wrap: anywhere; }
.crumb a { color: inherit; }
.card {
  min-width: 0;
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fefefe;
  box-shadow: 0 2px 8px #21105808;
  overflow-wrap: anywhere;
}
.card h2, .credit-page h1, .login-card h1, .card-heading { display: flex; align-items: center; gap: 12px; }
.card h2 { margin-bottom: 15px; }
.tile {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #eee8fd;
  color: #6335db;
}
.icon { display: inline-block; width: 19px; height: 19px; flex: none; vertical-align: middle; }
.icon-button {
  display: inline-grid;
  place-items: center;
  flex: none;
  padding: 0;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: #eee8fd;
  color: #6335db;
}
.button, .text-button, .site-footer .call {
  font-family: Montserrat, Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
}
.button, .text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 22px;
  border: 0;
  border-radius: 12px;
  background: var(--orange);
  color: white;
  text-align: center;
}
.button:hover { background: #ec8b49; text-decoration: none; }
.text-button { background: transparent; color: var(--purple); }
.text-button:hover { text-decoration: underline; }
.center { display: flex; width: fit-content; margin: 10px auto 0; }

.banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 16px 24px;
  border: 1px solid #dfd4fa;
  border-radius: 16px;
  background: #ede8fa;
}
.banner strong { font-size: 16px; }
.banner p { color: var(--muted); }
.banner .money, .banner a, .summary-value { margin: 0 0 0 auto; }
.banner a { font-size: 16px; font-weight: 700; }
.summary-value { font-size: 20px; font-weight: 800; }
.money { font-size: 28px; font-weight: 800; line-height: 1.2; margin-bottom: 12px; }
.money small { font-size: 14px; font-weight: 700; white-space: nowrap; }
.good { color: #19613a; }
.bad { color: #9b271f; }
.muted { color: var(--muted); }
.pill { padding: 1px 8px; border-radius: 14px; background: #e4f4eb; font-size: 13px; font-weight: 700; }
.pill.bad { background: #fce8e7; }
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.detail {
  display: grid;
  grid-template-columns: minmax(125px, 1fr) minmax(0, 367px);
  gap: 12px;
  align-items: center;
  min-height: 40px;
  padding: 9px 0;
  border-top: 1px solid var(--divider);
  color: var(--muted);
}
.detail dd { display: flex; justify-content: flex-end; align-items: center; gap: 8px; text-align: right; color: var(--ink); font-weight: 600; }
.detail .icon-button { width: 22px; height: 22px; border-radius: 7px; }
.detail .icon-button .icon { width: 14px; height: 14px; }
.profile-credit .detail dd, .profile-docs .detail dd { justify-content: flex-start; text-align: left; }
.profile-credit a, .profile-docs a, .add-device { color: var(--orange); }
.tooltip-trigger { position: relative; }
.tooltip {
  display: none;
  position: absolute;
  right: 0;
  bottom: calc(100% + 5px);
  z-index: 1;
  border-radius: 6px;
  padding: 4px 7px;
  color: white;
  background: #261d43;
  white-space: nowrap;
  font-size: 12px;
}
.tooltip-trigger:focus-visible .tooltip, .tooltip-trigger[aria-expanded="true"] .tooltip { display: block; }
@media (hover: hover) { .tooltip-trigger:hover .tooltip { display: block; } }

.payment-card { margin-bottom: 16px; }
.payment-card h2, .devices h2, .plan h2 { padding-bottom: 14px; border-bottom: 1px solid var(--divider); }
.payment-body, .device-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px; }
.payment-aside { color: var(--muted); }
.amount-form { max-width: 368px; }
label { display: block; margin-bottom: 5px; color: var(--muted); font-weight: 550; }
input:not([type="checkbox"]):not([type="hidden"]) {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 8px 14px;
  color: var(--ink);
  background: #fcfbff;
  border: 1px solid #dcd1f2;
  border-radius: 10px;
  font-weight: 650;
}
.amount-form .button { min-width: 140px; margin-top: 14px; }
.payment-brands { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 8px; }
.payment-brands img { object-fit: contain; }
.bank-logo { display: block; height: auto; margin-bottom: 10px; }
.payment-aside ol { padding-left: 19px; margin: 0; }
.actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 26px; margin-top: 25px; font-weight: 700; }
.actions a { display: inline-flex; gap: 8px; align-items: center; }
.narrow { width: min(100%, 600px); }
.card-heading { padding-bottom: 16px; }
.card-heading p { font-size: 13px; margin-top: 3px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px 0; border-top: 1px solid var(--divider); }
th { font-size: 13px; color: var(--muted); font-weight: 600; }
th:last-child, td:last-child { text-align: right; }
.history-table td:last-child { font-weight: 750; white-space: nowrap; }
.history-table .table-time { margin-left: 8px; }
.back { display: inline-block; margin-top: 16px; font-weight: 700; }
.empty { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 120px; }
.announcements { display: grid; gap: 16px; }
.announcement h2 { border-bottom: 1px solid var(--divider); padding-bottom: 14px; }
.announcement p { white-space: pre-wrap; }
.plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.plan { text-align: center; }
.plan h2 { display: block; }
.plan p { color: var(--muted); margin: 0 0 14px; }
.plan .button, .plan .text-button { padding-inline: 12px; min-width: min(140px, 100%); }
.device-body { align-items: center; }
.device-table { table-layout: fixed; overflow-wrap: anywhere; }
.device-table th, .device-table td { padding: 7px 0; }
.device-table thead th { border-top: none; }
.device-table th:first-child { width: clamp(105px, 28%, 145px); }
.device-table th:last-child { width: 42px; }
.device-table th:nth-child(2), .device-table td:nth-child(2) { padding-inline: 8px; }
.remote { justify-self: center; height: auto; }
.add-device { padding-inline: 0; }
.login-page { padding-block: 64px; }
.login-card { width: min(100%, 450px); margin-inline: auto; }
.login-card p { margin-block: 12px 16px; }
.login-card input:not([type="checkbox"]):not([type="hidden"]) { margin-bottom: 14px; }
.checkbox { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.checkbox input { accent-color: var(--purple); }
.login-card .button { width: 100%; }
.credit-intro { margin-block: 16px; line-height: 1.6; }
.credit-status {
  padding: 12px 16px;
  border: 1px solid #dfd4fa;
  border-radius: 12px;
  background: #ede8fa;
  font-weight: 600;
}
.credit-page .button { margin-top: 16px; }

.modal {
  width: min(480px, calc(100% - 32px));
  padding: 24px;
  color: var(--ink);
  background: #fefefe;
  border: 1px solid var(--border);
  border-radius: 18px;
  text-align: center;
  box-shadow: 0 10px 40px #21105838;
}
dialog::backdrop { background: #20194475; }
.modal h2 { margin-bottom: 10px; }
.modal form { margin-top: 16px; }
.modal input { max-width: 200px; margin: 0 auto 12px; text-align: center; letter-spacing: .15em; }

.profile-edit label,
.profile-edit form p { text-align: left; }
.profile-edit input:not([type="hidden"]) { max-width: none; text-align: left; letter-spacing: normal; }
.profile-edit form p { margin-bottom: 12px; font-size: .9em; }

.site-footer { background: white; color: var(--blue); }
.site-footer a { color: inherit; }
.band { padding: 62px 0 0; background: linear-gradient(var(--background) 54%, white 54%); }
.phones {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  width: min(1200px, calc(100% - 32px));
  min-height: 185px;
  margin: auto;
  padding: 0 4.8% 0 5.85%;
  border-radius: 23px;
  background: var(--blue);
  color: white;
}
.phone { display: flex; align-items: center; gap: 14px; width: fit-content; font-size: 16px; }
.phone:nth-child(2) { order: 2; }
.phone i { display: grid; place-items: center; width: 55px; height: 55px; border-radius: 50%; background: white; flex: none; }
.phone img { width: 37px; height: 37px; object-fit: contain; }
.phone b { display: block; margin-top: 3px; font-size: 19px; }
.site-footer .call {
  position: absolute;
  top: -61px;
  right: 9.2%;
  display: grid;
  place-content: center;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: var(--orange);
  color: white;
  text-align: center;
}
.dots { position: absolute; top: -55px; right: 21%; width: 47px; height: 37px; }
.foot {
  width: min(1200px, calc(100% - 32px));
  margin: auto;
  padding: 89px 0 65px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: auto repeat(5, minmax(35px, auto));
  gap: 0 28px;
  overflow-wrap: anywhere;
}
.foot .logo { grid-area: 1 / 1 / 5 / 2; width: 187px; }
.foot .logo img { display: block; width: 100%; }
.foot .columns, .foot .columns section, .foot .bottom, .foot .bottom > div:first-child, .foot .links { display: contents; }
.foot h2, .foot .email { color: #2f2e3d; font-size: 17px; font-weight: 600; }
.foot h2 { grid-row: 1; }
.foot .email { grid-area: 1 / 4; }
.foot .columns section:first-child > *, .foot .columns section:first-child a { grid-column: 2; }
.foot .columns section:nth-child(2) > *, .foot .columns section:nth-child(2) a { grid-column: 3; }
.foot .links a, .foot .copy {
  align-self: end;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.55;
}
.foot .links a { color: #2f2a84; }
.foot .links a:nth-child(1) { grid-row: 2; }
.foot .links a:nth-child(2) { grid-row: 3; }
.foot .links a:nth-child(3) { grid-row: 4; }
.foot .links a:nth-child(4) { grid-row: 5; }
.foot .links a:nth-child(5) { grid-row: 6; }
.foot .bottom .links a { grid-column: 4; }
.foot .bottom .links a:nth-child(1) { grid-row: 4; }
.foot .bottom .links a:nth-child(2) { grid-row: 5; }
.foot .bottom .links a:nth-child(3) { grid-row: 6; }
.social { display: flex; gap: 12px; }
.social a { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--blue); }
.social a:nth-child(2) { background: var(--orange); }
.foot .social { grid-area: 2 / 4 / 4 / 5; align-self: center; gap: clamp(8px, 2.6vw, 40px); }
.foot .social a { width: 46px; height: 46px; flex: none; }
.foot .social svg { width: 24px; height: 24px; }
.foot .copy { grid-area: 6 / 1; color: #777580; }

@media (max-width: 1020px) {
  .phones { padding-inline: 22px; }
  .phone { gap: 7px; font-size: 13px; }
  .phone b { font-size: 14px; }
  .phone i { width: 44px; height: 44px; }
  .phone img { width: 26px; height: 26px; }
  .site-footer .call { right: 4%; width: 125px; height: 125px; }
}
@media (max-width: 767px) {
  .topbar { min-height: 64px; grid-template-columns: 1fr 1fr; }
  .brand img { width: 68px; }
  .desktop-nav, .exit { display: none; }
  .menu-button { display: grid; place-items: center; }
  main { padding-block: 24px 22px; }
  .profile-grid { grid-template-columns: 1fr; gap: 12px; }
  .card { padding: 15px 16px; }
  .card h2, h1 { font-size: 17px; }
  .card h2 { margin-bottom: 9px; }
  .detail { grid-template-columns: minmax(0, 1fr) minmax(0, 58%); gap: 8px; font-size: 13px; }
  .detail dd { gap: 6px; }
  .money { font-size: 24px; margin: 10px 0; }
  .banner { display: grid; grid-template-columns: 36px minmax(0, 1fr); padding: 13px 16px; gap: 3px 10px; }
  .banner .tile { grid-row: span 2; }
  .banner strong, .banner a { font-size: 14px; }
  .banner .money, .banner a, .summary-value { grid-column: 2; margin: 0; }
  .notice { row-gap: 6px; }
  .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .plan { padding-inline: 10px; }
  .plan h2 { font-size: 14px; }
  .plan .button, .plan .text-button { padding-inline: 5px; }
  .plan p, .plan .money small { font-size: 12px; }
  .device-body { display: block; }
  .device-table { font-size: 12px; }
  .remote { display: none; }
  .payment-body { grid-template-columns: 1fr; gap: 14px; }
  .amount-form { max-width: none; }
  .amount-form .button { display: flex; margin-inline: auto; }
  .payment-aside { padding-top: 10px; border-top: 1px solid var(--divider); font-size: 13px; }
  .bank-logo { width: 148px; }
  .actions { font-size: 12px; gap: 10px 14px; margin-top: 17px; }
  .history-table td, .history-table th { padding-block: 9px; }
  .history-table .table-time { margin-left: 4px; font-size: 12px; }
  .band { padding: 44px 20px 0; background: linear-gradient(var(--background) 47%, white 47%); }
  .phones { width: 100%; grid-template-columns: 1fr; min-height: auto; padding: 10px 8px; gap: 16px; border-radius: 16px; }
  .phone { gap: 8px; font-size: 12px; }
  .phone:nth-child(2) { order: 0; }
  .phone b { margin-top: 4px; }
  .site-footer .call { top: -42px; right: 20px; width: 126px; height: 126px; }
  .dots { top: -42px; right: 140px; width: 32px; height: 28px; }
  .foot { display: block; width: 100%; max-width: 480px; padding: 36px 28px 26px; }
  .foot .logo { display: block; width: 129px; margin: 0 auto 35px; }
  .foot .columns, .foot .bottom { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
  .foot .columns { grid-template-rows: auto repeat(5, minmax(24px, auto)); }
  .foot .columns section:first-child > *, .foot .columns section:first-child a { grid-column: 1; }
  .foot .columns section:nth-child(2) > *, .foot .columns section:nth-child(2) a { grid-column: 2; }
  .foot .columns h2 { margin-bottom: 18px; }
  .foot .email { display: block; margin: 40px 0 24px; }
  .foot .bottom { grid-template-rows: repeat(3, auto); row-gap: 7px; }
  .foot .bottom .links a { grid-column: 2; }
  .foot .bottom .links a:nth-child(1) { grid-row: 1; }
  .foot .bottom .links a:nth-child(2) { grid-row: 2; }
  .foot .bottom .links a:nth-child(3) { grid-row: 3; }
  .foot .social { grid-area: 1 / 1 / 3 / 2; align-self: start; gap: 8px; }
  .foot .social a { width: 32px; height: 32px; }
  .foot .social svg { width: 19px; height: 19px; }
  .foot .copy { grid-area: 3 / 1; }
  .foot .links a, .foot .copy, .foot h2, .foot .email { font-size: 14px; }
}
@media (max-width: 350px) {
  .site-footer .call { width: 98px; height: 98px; right: 10px; }
  .dots { right: 103px; }
  .foot { padding-inline: 20px; }
  .payment-brands img { width: 49px; height: 34px; }
}

.profile-error {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  min-height: 244px;
  text-align: center;
  font-size: 19px;
  font-weight: 700;
}
.profile-error .tile { width: 42px; height: 42px; background: #fce8e7; color: #9b271f; }
.profile-error .icon { width: 23px; height: 23px; }
@media (max-width: 767px) {
  .profile-error { min-height: 210px; font-size: 16px; }
}

.exit-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}
.exit-button:hover { text-decoration: underline; }
.exit::before { content: none; }
.exit-button::before { content: "↪ "; color: var(--orange); }
.drawer-end .exit-button { padding: 10px; font-size: 16px; font-weight: 700; }
.server-message { margin-bottom: 16px; }
.server-message[role="alert"], .server-error p { color: #9b271f; }
.server-message.pairing-error[role="alert"] {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #cf182b;
  font-weight: 700;
}
.pairing-error .icon { flex: none; width: 20px; height: 20px; }
.server-error .text-button { margin-top: 8px; padding-inline: 0; }
button:disabled { cursor: wait; opacity: .7; }

@media (min-width: 768px) {
  main.accidents-empty { padding-bottom: 244px; }
}
