:root {
  --ink: #182230;
  --muted: #667085;
  --line: #d9e2ef;
  --primary: #1f5eff;
  --primary-strong: #1747bd;
  --success: #087443;
  --warning: #b54708;
  --danger: #b42318;
  --surface: #ffffff;
  --soft: #f6f8fb;
  --wash: #eef4ff;
  --shadow: 0 14px 34px rgba(24, 34, 48, .10);
}

html {
  background: var(--soft);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(31, 94, 255, .10), transparent 26rem),
    linear-gradient(180deg, #ffffff 0%, var(--soft) 48%, #eef2f7 100%);
  color: var(--ink);
  font-family: "Aptos", "Segoe UI", Arial, sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding-bottom: 84px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: rgba(19, 31, 49, .96);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  backdrop-filter: blur(14px);
}

.topbar-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.topbar-brand {
  min-width: 0;
}

.brand {
  display: block;
  font-size: 21px;
  line-height: 1.1;
  letter-spacing: 0;
}

.user-badge {
  display: block;
  min-height: 16px;
  color: #c8d7ea;
  font-size: 12px;
}

.screen {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 16px;
}

.landing-panel {
  padding: 8px 0 28px;
}

.landing-hero {
  display: grid;
  gap: 18px;
}

.landing-copy {
  order: 2;
}

.landing-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 12px;
  padding: 4px 10px;
  border: 1px solid #bad7c8;
  border-radius: 999px;
  background: #ecfdf3;
  color: #087443;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.landing-copy h1 {
  max-width: 720px;
  margin: 0 0 14px;
  color: #101828;
  font-size: 38px;
  line-height: 1.06;
  letter-spacing: 0;
}

.landing-lede {
  max-width: 650px;
  margin: 0 0 18px;
  color: #475467;
  font-size: 18px;
  line-height: 1.55;
}

.landing-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.landing-actions .btn {
  min-height: 48px;
  padding-right: 18px;
  padding-left: 18px;
  font-weight: 800;
}

.landing-steps {
  display: grid;
  gap: 10px;
}

.landing-steps div {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #dce7f3;
  border-radius: 8px;
  background: rgba(255, 255, 255, .78);
}

.landing-steps strong {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  background: #1f5eff;
  color: #fff;
  font-size: 13px;
}

.landing-steps span {
  color: #344054;
  font-weight: 800;
}

.landing-media {
  order: 1;
  overflow: hidden;
  min-height: 250px;
  border: 1px solid #dce7f3;
  border-radius: 8px;
  background: #dce7f3;
  box-shadow: var(--shadow);
}

.landing-media img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 250px;
  object-fit: cover;
}

.landing-info {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.landing-info section {
  padding: 16px;
  border: 1px solid #dce7f3;
  border-radius: 8px;
  background: rgba(255, 255, 255, .86);
}

.landing-info h2 {
  margin: 0 0 6px;
  font-size: 17px;
  line-height: 1.25;
}

.landing-info p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.auth-panel {
  min-height: calc(100vh - 104px);
  display: grid;
  place-items: center;
}

.auth-card,
.task-card,
.panel-card,
.settings-list {
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-card {
  width: min(430px, 100%);
  padding: 20px;
}

.auth-back {
  min-height: 32px;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary-strong);
  font-size: 14px;
  font-weight: 800;
}

.auth-back:hover {
  color: var(--primary);
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  margin-bottom: 16px;
  background: #e8eff8;
  border-radius: 8px;
}

.segmented button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 9px 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.segmented button.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(24, 34, 48, .13);
}

.form-control {
  min-height: 46px;
  margin-bottom: 12px;
  border-color: #c7d3e2;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 .2rem rgba(11, 99, 206, .14);
}

.hint {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.balance-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 17px;
  color: #fff;
  background: linear-gradient(135deg, #1f5eff, #087443);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(31, 94, 255, .18);
}

.balance-strip span {
  display: block;
  font-size: 13px;
  opacity: .9;
}

.balance-strip strong {
  display: block;
  font-size: 34px;
  line-height: 1.05;
}

.task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.task-card,
.panel-card {
  padding: 16px;
}

.task-card {
  display: flex;
  min-height: 190px;
  flex-direction: column;
}

.task-card h3,
.panel-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.25;
}

.task-card p,
.panel-card p {
  color: var(--muted);
}

.eyebrow {
  margin-bottom: 4px;
  color: #98a2b3;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 800;
}

.status-completed {
  background: #ecfdf3;
  color: var(--success);
}

.status-canceled {
  background: #f2f4f7;
  color: #667085;
}

.referral-level-select {
  width: min(180px, 100%);
}

.referral-search {
  display: flex;
  gap: 10px;
}

.referral-search .form-control {
  margin: 0;
}

.commission-guide {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.commission-guide span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.task-card .d-flex {
  margin-top: auto;
}

.task-record-muted {
  background: #f5f6f8;
  border-color: #e5e7eb;
  box-shadow: none;
  opacity: .86;
}

.task-record-muted h3,
.task-record-muted p,
.task-record-muted small,
.task-record-muted .small {
  color: #667085;
}

.mentor-contact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.mentor-contact-list a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid #dce7f3;
  border-radius: 8px;
  background: #fff;
  color: var(--primary-strong);
  text-decoration: none;
}

.mentor-contact-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.mentor-contact-list strong {
  overflow-wrap: anywhere;
  color: var(--primary-strong);
  font-size: 13px;
}

.amount {
  color: var(--success);
  font-weight: 800;
}

.settings-list {
  overflow: hidden;
}

.settings-list button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 58px;
  padding: 0 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-align: left;
  font-weight: 700;
}

.settings-list button:last-child {
  border-bottom: 0;
}

.settings-list i {
  font-style: normal;
  color: #98a2b3;
  font-size: 24px;
}

.site-footer {
  width: 100%;
  margin: 4px 0 0;
  padding: 0 0 82px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .92);
}

.site-footer-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 12px;
  padding: 12px 16px 8px;
  color: #475467;
}

.site-footer strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
}

.footer-contact-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.footer-contact-list a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #dce7f3;
  border-radius: 8px;
  background: #fff;
  color: var(--primary-strong);
  text-decoration: none;
}

.footer-contact-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.footer-contact-list strong {
  overflow-wrap: anywhere;
  color: var(--primary-strong);
  font-size: 13px;
}

.footer-empty,
.footer-privacy,
.footer-statement,
.footer-copyright {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
}

.footer-empty {
  margin-top: 8px;
}

.footer-statement {
  margin-top: 4px;
}

.footer-notice-link {
  min-height: 30px;
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 800;
  text-decoration: underline;
}

.footer-notice-link:hover {
  background: transparent;
  color: var(--primary);
}

.footer-copyright {
  width: min(1120px, 100%);
  margin: 12px auto 0;
  padding: 10px 16px 14px;
  border-top: 1px solid #e8edf4;
  color: #344054;
  text-align: center;
  font-weight: 700;
}

.footer-notice-modal {
  position: fixed;
  inset: 0;
  z-index: 99997;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(16, 24, 40, .48);
}

.footer-notice-panel {
  width: min(680px, 100%);
  max-height: min(76vh, 620px);
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 52px rgba(16, 24, 40, .24);
}

.footer-notice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.footer-notice-header h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.footer-notice-close {
  width: 34px;
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #667085;
  font-size: 26px;
  line-height: 1;
}

.footer-notice-body {
  overflow: auto;
  padding: 16px;
  color: #475467;
  font-size: 14px;
  line-height: 1.65;
}

.footer-notice-body p {
  margin: 0 0 12px;
}

.cookie-notice {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 92px;
  z-index: 99998;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
  padding: 13px;
  border: 1px solid #b9c9dd;
  border-radius: 8px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 16px 38px rgba(24, 34, 48, .18);
}

.cookie-notice strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 14px;
}

.cookie-notice p {
  margin: 0;
  color: #475467;
  font-size: 13px;
  line-height: 1.45;
}

.desktop-nav {
  display: none;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(14px);
}

.bottom-nav button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.bottom-nav button.active {
  background: var(--wash);
  color: var(--primary);
}

.data-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.data-row:last-child {
  border-bottom: 0;
}

.table {
  --bs-table-bg: transparent;
  font-size: 14px;
}

.modal-content {
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.toast-message {
  position: fixed;
  left: 50%;
  bottom: 94px;
  z-index: 99999;
  max-width: min(460px, calc(100% - 32px));
  transform: translateX(-50%) translateY(16px);
  padding: 11px 15px;
  border-radius: 8px;
  background: #101828;
  color: #fff;
  box-shadow: 0 12px 30px rgba(16, 24, 40, .25);
  opacity: 0;
  pointer-events: none;
  transition: .18s ease;
}

.toast-message.show {
  opacity: 1;
  transform: translateX(-50%);
}

@media (max-width: 420px) {
  .screen {
    padding: 12px;
  }

  .landing-panel {
    padding-top: 4px;
  }

  .landing-copy h1 {
    font-size: 32px;
  }

  .landing-lede {
    font-size: 16px;
  }

  .landing-actions {
    display: grid;
  }

  .landing-actions .btn {
    width: 100%;
  }

  .balance-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .task-grid {
    grid-template-columns: 1fr;
  }

  .cookie-notice {
    grid-template-columns: 1fr;
  }

  .cookie-notice .btn {
    width: 100%;
  }
}

@media (min-width: 760px) {
  .app-shell {
    padding-bottom: 0;
  }

  .topbar {
    padding: calc(14px + env(safe-area-inset-top)) 28px 14px;
  }

  .topbar-inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .topbar-brand {
    justify-self: start;
  }

  .topbar-inner > .btn {
    justify-self: end;
  }

  .screen {
    padding: 24px 20px 40px;
  }

  .landing-panel {
    padding: 28px 0 44px;
  }

  .landing-hero {
    grid-template-columns: minmax(0, 1fr) minmax(400px, .92fr);
    align-items: center;
    gap: 34px;
  }

  .landing-copy {
    order: 1;
  }

  .landing-media {
    order: 2;
    min-height: 480px;
  }

  .landing-media img {
    min-height: 480px;
  }

  .landing-copy h1 {
    font-size: 56px;
  }

  .landing-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .landing-steps div {
    align-items: flex-start;
    flex-direction: column;
    min-height: 112px;
    padding: 14px;
  }

  .landing-info {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 20px;
  }

  .desktop-nav {
    box-sizing: border-box;
    width: min(1040px, calc(100% - 40px));
    margin: 14px auto 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    overflow-x: auto;
    padding: 6px;
    border: 1px solid #dbe5f2;
    border-radius: 8px;
    background: rgba(255, 255, 255, .86);
    box-shadow: 0 10px 24px rgba(24, 34, 48, .08);
    backdrop-filter: none;
  }

  .desktop-nav button {
    min-height: 36px;
    flex: 0 0 auto;
    border: 0;
    padding: 0 16px;
    border-radius: 6px;
    background: transparent;
    color: #475467;
    font-size: 14px;
    font-weight: 800;
  }

  .desktop-nav button:hover {
    background: #f2f6fc;
    color: var(--primary-strong);
  }

  .desktop-nav button.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 8px 18px rgba(31, 94, 255, .18);
  }

  .desktop-nav button:focus-visible {
    outline: 2px solid rgba(31, 94, 255, .28);
    outline-offset: 2px;
  }

  .desktop-nav::-webkit-scrollbar {
    height: 0;
  }

  .desktop-nav {
    scrollbar-width: none;
  }

  .desktop-nav button.active:hover {
    background: var(--primary-strong);
    color: #fff;
  }

  .bottom-nav {
    display: none;
  }

  .site-footer {
    padding: 0;
  }

  .site-footer-inner {
    grid-template-columns: minmax(0, 1fr) minmax(320px, auto);
    align-items: start;
    padding: 12px 20px 8px;
  }

  .footer-contacts {
    justify-self: end;
    text-align: right;
  }

  .footer-contacts .footer-contact-list {
    justify-content: flex-end;
  }

  .cookie-notice {
    bottom: 18px;
  }

  .balance-strip {
    margin-bottom: 20px;
    padding: 20px 22px;
  }

  .task-grid {
    gap: 16px;
  }
}

@media (min-width: 1120px) {
  .screen {
    width: min(1120px, 100%);
  }

  .desktop-nav {
    width: min(1080px, calc(100% - 40px));
  }
}
