/* FuelDash R105 — global account page and continuous theme surfaces. */
:root {
  --fd-r105-red: #ff3b34;
  --fd-r105-light-bg: #f5f5f7;
  --fd-r105-light-card: rgba(255, 255, 255, 0.88);
  --fd-r105-light-control: rgba(237, 237, 241, 0.86);
  --fd-r105-light-border: rgba(92, 92, 102, 0.20);
  --fd-r105-dark-bg: #050505;
  --fd-r105-dark-card: rgba(18, 18, 21, 0.90);
  --fd-r105-dark-control: rgba(39, 39, 44, 0.88);
  --fd-r105-dark-border: rgba(255, 255, 255, 0.14);
}

html[data-fd-theme="light"],
html[data-fd-theme="light"] body,
html[data-fd-theme="light"] #app,
html[data-fd-theme="light"] #app .app-shell,
html[data-fd-theme="light"] #app .app-content,
html[data-fd-theme="light"] .fd-feature-page,
html[data-fd-theme="light"] .fd-feature-shell,
html[data-fd-theme="light"] .fd-feature-content {
  background-color: #f5f5f7 !important;
  background-image: none !important;
}

html[data-fd-theme="dark"],
html[data-fd-theme="dark"] body,
html[data-fd-theme="dark"] #app,
html[data-fd-theme="dark"] #app .app-shell,
html[data-fd-theme="dark"] #app .app-content,
html[data-fd-theme="dark"] .fd-feature-page,
html[data-fd-theme="dark"] .fd-feature-shell,
html[data-fd-theme="dark"] .fd-feature-content {
  background-color: #050505 !important;
  background-image: none !important;
}

html[data-fd-theme] :where(body,#app,.app-shell,.app-content,.fd-feature-page,.fd-feature-shell,.fd-feature-content)::before,
html[data-fd-theme] :where(body,#app,.app-shell,.app-content,.fd-feature-page,.fd-feature-shell,.fd-feature-content)::after {
  content: none !important;
  display: none !important;
  background: none !important;
  box-shadow: none !important;
}

.fd-main-header-actions {
  margin-left: auto;
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 40px;
}

.fd-profile-button {
  position: relative;
  width: 40px !important;
  min-width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 !important;
  display: inline-grid !important;
  place-items: center !important;
  border-radius: 50% !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

html[data-fd-theme="light"] .fd-profile-button {
  color: #26262b !important;
  background: var(--fd-r105-light-control) !important;
  border: 1px solid var(--fd-r105-light-border) !important;
}

html[data-fd-theme="dark"] .fd-profile-button {
  color: #f5f5f7 !important;
  background: var(--fd-r105-dark-control) !important;
  border: 1px solid var(--fd-r105-dark-border) !important;
}

.fd-profile-button svg {
  width: 21px !important;
  height: 21px !important;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fd-profile-button > i {
  display: none;
  position: absolute;
  right: 2px;
  top: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fd-r105-red);
  border: 1.5px solid currentColor;
}

.fd-profile-button[data-state="attention"] > i { display: block; }
.fd-profile-button[data-state="busy"] svg { animation: fd-r105-profile-pulse 1.2s ease-in-out infinite; }
@keyframes fd-r105-profile-pulse { 50% { opacity: .45; } }

.fd-feature-page[data-fd-feature-view="account"] {
  z-index: 1800 !important;
  overflow: hidden !important;
}

.fd-feature-page[data-fd-feature-view="account"] .fd-feature-shell {
  width: min(100%, 760px) !important;
  min-height: 100dvh !important;
  margin: 0 auto !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.fd-feature-page[data-fd-feature-view="account"] .fd-account-page-header {
  flex: 0 0 auto;
  padding-top: calc(18px + env(safe-area-inset-top)) !important;
  padding-bottom: 12px !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

.fd-feature-page[data-fd-feature-view="account"] .fd-account-page-header .fd-feature-back {
  width: 40px !important;
  min-width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  display: grid !important;
  place-items: center !important;
  box-shadow: none !important;
}

.fd-feature-page[data-fd-feature-view="account"] .fd-account-page-header .fd-feature-back svg {
  width: 20px !important;
  height: 20px !important;
  margin: 0 !important;
}

.fd-account-page-title {
  flex: 0 0 auto;
  padding: 0 20px 18px;
}
.fd-account-page-title small,
.fd-account-page-title h1,
.fd-account-page-title p { margin: 0; }
.fd-account-page-title small {
  display: block;
  color: var(--fd-r105-red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .18em;
}
.fd-account-page-title h1 {
  margin-top: 5px;
  font-size: clamp(29px, 8vw, 40px);
  line-height: 1.04;
  letter-spacing: -.035em;
}
.fd-account-page-title p {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.45;
  opacity: .66;
}

.fd-feature-page[data-fd-feature-view="account"] .fd-feature-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  padding: 0 20px calc(32px + env(safe-area-inset-bottom)) !important;
  overscroll-behavior-x: none;
}

.fd-account-page {
  display: grid;
  gap: 16px;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
}

.fd-account-page-status,
.fd-account-page-card,
.fd-tankbook-cloud-row {
  border-radius: 24px !important;
  box-shadow: none !important;
  overflow: hidden;
}

html[data-fd-theme="light"] :is(.fd-account-page-status,.fd-account-page-card,.fd-tankbook-cloud-row) {
  background: var(--fd-r105-light-card) !important;
  border: 1px solid var(--fd-r105-light-border) !important;
  color: #17171a !important;
  -webkit-backdrop-filter: blur(14px) saturate(115%) !important;
  backdrop-filter: blur(14px) saturate(115%) !important;
}

html[data-fd-theme="dark"] :is(.fd-account-page-status,.fd-account-page-card,.fd-tankbook-cloud-row) {
  background: var(--fd-r105-dark-card) !important;
  border: 1px solid var(--fd-r105-dark-border) !important;
  color: #f7f7f8 !important;
  -webkit-backdrop-filter: blur(14px) saturate(115%) !important;
  backdrop-filter: blur(14px) saturate(115%) !important;
}

.fd-account-page-status,
.fd-account-page-card { padding: 22px !important; }
.fd-account-page-status small,
.fd-account-page-card .fd-feature-card__head small {
  color: var(--fd-r105-red) !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: .16em !important;
}
.fd-account-page-status h2,
.fd-account-page-card h2 {
  margin: 6px 0 0 !important;
  font-size: 24px !important;
  line-height: 1.12 !important;
  letter-spacing: -.025em !important;
}
.fd-account-page-status p,
.fd-account-page-card > p {
  margin: 12px 0 0 !important;
  font-size: 15px !important;
  line-height: 1.5 !important;
  opacity: .72;
}
.fd-account-page-status > div > small:last-child {
  display: block;
  margin-top: 10px;
  color: inherit !important;
  font-size: 12px !important;
  letter-spacing: 0 !important;
  opacity: .55;
}

.fd-account-page-card .fd-feature-card__head {
  margin-bottom: 18px !important;
}
.fd-account-page-card .fd-feature-card__head > span {
  font-size: 12px !important;
  font-weight: 500 !important;
  opacity: .58;
}

.fd-account-page-card .fd-auth-switch {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 4px !important;
  margin: 0 0 18px !important;
  padding: 4px !important;
  border-radius: 16px !important;
  box-shadow: none !important;
}
html[data-fd-theme="light"] .fd-account-page-card .fd-auth-switch { background: var(--fd-r105-light-control) !important; border: 1px solid var(--fd-r105-light-border) !important; }
html[data-fd-theme="dark"] .fd-account-page-card .fd-auth-switch { background: var(--fd-r105-dark-control) !important; border: 1px solid var(--fd-r105-dark-border) !important; }
.fd-account-page-card .fd-auth-switch button {
  min-height: 44px !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: transparent !important;
  color: inherit !important;
  font-size: 14px !important;
  font-weight: 650 !important;
  box-shadow: none !important;
}
.fd-account-page-card .fd-auth-switch button.is-active { background: var(--fd-r105-red) !important; color: #fff !important; }

.fd-account-page-card .fd-auth-form {
  display: grid !important;
  gap: 14px !important;
}
.fd-account-page-card .fd-auth-form label {
  display: grid !important;
  gap: 7px !important;
  font-size: 13px !important;
  font-weight: 650 !important;
}
.fd-account-page-card .fd-auth-form label > small,
.fd-account-page-card .fd-auth-explanation {
  font-size: 12px !important;
  line-height: 1.45 !important;
  font-weight: 400 !important;
  opacity: .62;
}
.fd-account-page-card .fd-auth-form input {
  width: 100% !important;
  height: 50px !important;
  min-height: 50px !important;
  padding: 0 15px !important;
  border-radius: 15px !important;
  box-shadow: none !important;
  font-size: 16px !important;
}
html[data-fd-theme="light"] .fd-account-page-card .fd-auth-form input { background: var(--fd-r105-light-control) !important; color: #17171a !important; border: 1px solid var(--fd-r105-light-border) !important; }
html[data-fd-theme="dark"] .fd-account-page-card .fd-auth-form input { background: var(--fd-r105-dark-control) !important; color: #f7f7f8 !important; border: 1px solid var(--fd-r105-dark-border) !important; }

.fd-account-page-card :is(.fd-auth-primary,.fd-auth-secondary) {
  width: 100% !important;
  min-height: 48px !important;
  padding: 0 16px !important;
  border-radius: 15px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  box-shadow: none !important;
}
.fd-account-page-card .fd-auth-primary { background: var(--fd-r105-red) !important; color: #fff !important; border: 1px solid var(--fd-r105-red) !important; }
html[data-fd-theme="light"] .fd-account-page-card .fd-auth-secondary { background: var(--fd-r105-light-control) !important; color: #2f2f35 !important; border: 1px solid var(--fd-r105-light-border) !important; }
html[data-fd-theme="dark"] .fd-account-page-card .fd-auth-secondary { background: var(--fd-r105-dark-control) !important; color: #f4f4f5 !important; border: 1px solid var(--fd-r105-dark-border) !important; }
.fd-account-page-card .fd-auth-link {
  justify-self: center;
  min-height: 38px;
  padding: 0 8px;
  border: 0 !important;
  background: transparent !important;
  color: var(--fd-r105-red) !important;
  font-size: 13px !important;
  font-weight: 650 !important;
  box-shadow: none !important;
}
.fd-account-page-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.fd-account-page-actions--stack { grid-template-columns: 1fr; }
.fd-account-page-actions--stack .fd-auth-link { justify-self: start; }
.fd-auth-form-status:empty { display: none !important; }
.fd-auth-form-status { margin: 0 !important; font-size: 13px !important; line-height: 1.4 !important; }
.fd-auth-form-status[data-type="error"] { color: #d72d27 !important; }
.fd-auth-form-status[data-type="success"] { color: #2eaf68 !important; }

.fd-recovery-code {
  display: block;
  margin: 18px 0;
  padding: 14px;
  border-radius: 15px;
  font-size: clamp(15px, 4.5vw, 20px);
  line-height: 1.4;
  text-align: center;
  letter-spacing: .06em;
  overflow-wrap: anywhere;
}
html[data-fd-theme="light"] .fd-recovery-code { background: var(--fd-r105-light-control); border: 1px solid var(--fd-r105-light-border); }
html[data-fd-theme="dark"] .fd-recovery-code { background: var(--fd-r105-dark-control); border: 1px solid var(--fd-r105-dark-border); }
.fd-recovery-confirm { display: flex !important; align-items: flex-start !important; gap: 10px !important; margin: 16px 0 !important; font-size: 13px !important; font-weight: 500 !important; }
.fd-recovery-confirm input { width: 22px !important; min-width: 22px !important; height: 22px !important; margin: 0 !important; }

.fd-tankbook-cloud-row { padding: 0 !important; }
.fd-tankbook-cloud-row > button {
  width: 100% !important;
  min-height: 82px !important;
  padding: 16px 18px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px;
  text-align: left !important;
  color: inherit !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
.fd-tankbook-cloud-row > button > span { display: grid; gap: 3px; min-width: 0; }
.fd-tankbook-cloud-row small { color: var(--fd-r105-red); font-size: 10px; font-weight: 800; letter-spacing: .15em; }
.fd-tankbook-cloud-row strong { font-size: 17px; line-height: 1.2; }
.fd-tankbook-cloud-row em { font-size: 12px; font-style: normal; opacity: .58; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fd-tankbook-cloud-row svg { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .56; }

.fd-feature-page[data-fd-feature-view="tankbook"] .fd-backup-actions button {
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
}
.fd-feature-page[data-fd-feature-view="tankbook"] .fd-backup-actions button > span {
  align-items: center !important;
  justify-items: center !important;
  text-align: center !important;
}

html[data-fd-theme="light"] #app .station-sort {
  background: var(--fd-r105-light-bg) !important;
  border-color: var(--fd-r105-light-border) !important;
  box-shadow: none !important;
}
html[data-fd-theme="light"] #app .station-sort button:not(.is-active) {
  background: var(--fd-r105-light-bg) !important;
  color: #4d4d54 !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
html[data-fd-theme="light"] #app .station-sort button.is-active {
  background: var(--fd-r105-red) !important;
  color: #fff !important;
}

@media (max-width: 480px) {
  .fd-account-page-title { padding-inline: 16px; }
  .fd-feature-page[data-fd-feature-view="account"] .fd-feature-content { padding-inline: 16px !important; }
  .fd-account-page-status,
  .fd-account-page-card { padding: 18px !important; }
  .fd-account-page-actions { grid-template-columns: 1fr; }
}
