:root {
  --leaf: #193f26;
  --leaf-2: #2f6f3b;
  --moss: #7fa35d;
  --gold: #f5bd58;
  --honey: #ff8a1d;
  --cream: #fff8dc;
  --text: #f7ffe8;
  --muted: #d6e6bd;
  --panel: rgba(13, 38, 22, .78);
  --panel-strong: rgba(18, 54, 29, .9);
  --line: rgba(246, 205, 111, .38);
  --red: #ff746d;
  --shadow: 0 22px 70px rgba(5, 20, 9, .45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    linear-gradient(rgba(4, 20, 9, .36), rgba(4, 20, 9, .7)),
    url("/assets/forest-magic.png") center top / cover fixed,
    #102916;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 20%, rgba(245, 189, 88, .22), transparent 22rem),
    radial-gradient(circle at 84% 6%, rgba(127, 163, 93, .24), transparent 28rem);
}

button,
input {
  font: inherit;
}

button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(21, 56, 29, .82);
  font-weight: 900;
  cursor: pointer;
}

button:hover {
  border-color: var(--gold);
  box-shadow: 0 0 24px rgba(245, 189, 88, .22);
}

.hidden {
  display: none !important;
}

.shell {
  position: relative;
  width: min(1360px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 56px;
}

.topbar {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 54px;
  height: 54px;
  object-fit: cover;
  transform: scale(1.08);
  border: 1px solid rgba(255, 221, 140, .6);
  border-radius: 50%;
  box-shadow: 0 0 32px rgba(255, 138, 29, .35);
}

.brand strong {
  display: block;
  font-family: Comfortaa, Inter, sans-serif;
  font-size: 20px;
  color: #161005;
  background: linear-gradient(135deg, #ffad2f, #ffd86d);
  padding: 7px 12px;
  border-radius: 8px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .25);
}

.brand small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-weight: 800;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.download-chip,
.ghost-action {
  min-height: 40px;
  display: inline-grid;
  place-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #1b1205;
  background: linear-gradient(135deg, var(--honey), var(--gold));
  font-size: 13px;
  font-weight: 1000;
  text-decoration: none;
}

.ghost-action {
  color: var(--cream);
  background: rgba(20, 52, 29, .8);
}

.inline-link {
  width: max-content;
  color: var(--honey);
  font-weight: 1000;
  text-decoration: none;
}

.inline-link:hover {
  color: var(--gold);
  text-decoration: underline;
}

.hero {
  min-height: 230px;
  display: flex;
  align-items: end;
  padding: clamp(18px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(115deg, rgba(7, 24, 12, .8), rgba(16, 57, 30, .34));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 820px;
  font-family: Comfortaa, Inter, sans-serif;
  font-size: clamp(34px, 5vw, 62px);
  line-height: .95;
}

h1 span {
  display: inline-block;
  color: #120d04;
  background: linear-gradient(135deg, #ff8a1d, #ffd66a);
  padding: .08em .18em .14em;
  border-radius: 8px;
  box-shadow: 0 16px 44px rgba(7, 19, 7, .36);
}

h2 {
  font-size: clamp(28px, 4vw, 44px);
}

h3 {
  font-size: 22px;
}

.lead {
  max-width: 690px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.access-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 18px;
  margin-top: 18px;
}

.access-panel,
.side-panel,
.identity-panel,
.metric-card,
.qr-panel,
.links-panel,
.notice {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, var(--panel-strong), var(--panel));
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.access-panel,
.side-panel {
  padding: 18px;
}

.apps-panel {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, var(--panel-strong), var(--panel));
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.apps-panel-inline {
  margin-top: 0;
  grid-template-columns: 1fr;
  align-self: stretch;
}

.compact-app-grid,
.dashboard-apps {
  grid-template-columns: 1fr;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

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

.app-card {
  min-height: 132px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 15px;
  border: 1px solid rgba(255, 231, 158, .28);
  border-radius: 8px;
  color: var(--text);
  background: rgba(5, 24, 10, .5);
  text-decoration: none;
}

.compact-app-grid .app-card {
  min-height: 102px;
}

.app-card:hover {
  border-color: var(--gold);
  box-shadow: 0 0 26px rgba(245, 189, 88, .16);
}

.app-card span {
  width: max-content;
  padding: 5px 9px;
  border-radius: 999px;
  color: #1b1205;
  background: linear-gradient(135deg, var(--honey), var(--gold));
  font-size: 12px;
  font-weight: 1000;
}

.app-card strong {
  font-size: 20px;
}

.app-card small {
  color: var(--muted);
  line-height: 1.45;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

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

.tab.active,
.primary {
  color: #160f05;
  border-color: transparent;
  background: linear-gradient(135deg, var(--honey), var(--gold));
}

.form-panel {
  display: grid;
  gap: 14px;
}

.switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.switcher label {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(12, 42, 20, .72);
  font-weight: 900;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.switcher input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  flex: 0 0 18px;
  accent-color: var(--honey);
  margin: 0;
}

.field {
  display: grid;
  gap: 7px;
}

.field span,
.field small {
  color: var(--muted);
  font-weight: 800;
}

.text-action {
  min-height: 34px;
  width: max-content;
  border: 0;
  color: var(--gold);
  background: transparent;
  padding: 0;
}

.forgot-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 231, 158, .22);
  border-radius: 8px;
  background: rgba(5, 24, 10, .38);
}

.verify-box {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 12px;
  align-items: end;
  padding: 12px;
  border: 1px solid rgba(255, 231, 158, .22);
  border-radius: 8px;
  background: rgba(5, 24, 10, .38);
}

input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(255, 231, 158, .28);
  border-radius: 8px;
  color: var(--cream);
  background: rgba(5, 24, 10, .62);
  padding: 0 14px;
  outline: none;
}

input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 189, 88, .16);
}

.field-inline-error {
  margin: -8px 0 8px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 116, 109, .45);
  border-radius: 8px;
  color: var(--red);
  background: rgba(87, 18, 15, .32);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.35;
}

.field-inline-message {
  margin: -8px 0 8px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 214, 106, .45);
  border-radius: 8px;
  color: var(--gold);
  background: rgba(245, 189, 88, .12);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.35;
}

.notice {
  margin-top: 14px;
  padding: 14px;
}

.notice p {
  margin: 0;
}

.error {
  color: var(--red);
}

.side-panel {
  display: grid;
  gap: 12px;
}

.mini-card {
  padding: 16px;
  border: 1px solid rgba(255, 231, 158, .24);
  border-radius: 8px;
  background: rgba(5, 24, 10, .42);
}

.mini-card span,
.metric-card span,
.metric-card small,
.client-id {
  color: var(--muted);
}

.mini-card strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
}

.mini-card.accent strong {
  color: var(--gold);
}

.dashboard {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.account-view .hero {
  display: none;
}

.account-view .dashboard {
  margin-top: 18px;
}

.identity-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
}

.client-id {
  margin: 8px 0 0;
}

.status-orb {
  min-height: 40px;
  display: inline-grid;
  place-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--gold);
  font-weight: 1000;
}

.profile-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.secondary {
  color: var(--cream);
  background: rgba(20, 52, 29, .86);
}

.metric-grid,
.connect-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.connect-grid {
  grid-template-columns: 300px minmax(0, 1fr);
}

.metric-card,
.qr-panel,
.links-panel {
  padding: 18px;
}

.metric-card strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 26px;
}

.bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(4, 20, 9, .66);
}

.bar i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--moss), var(--gold));
}

.qr {
  width: 232px;
  min-height: 232px;
  display: grid;
  place-items: center;
  margin-top: 16px;
  padding: 6px;
  border-radius: 8px;
  background: var(--cream);
}

.links-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.links-head div,
.client-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.links-head button,
.client-actions button {
  min-height: 38px;
  padding: 0 12px;
  font-size: 13px;
}

.client-actions {
  margin: 14px 0;
}

.links-list {
  display: grid;
  gap: 10px;
}

.dashboard-apps {
  display: grid;
  gap: 12px;
}

.primary-link-box {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.primary-link-box code {
  min-height: 42px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 11px 12px;
  border: 1px solid rgba(255, 231, 158, .22);
  border-radius: 8px;
  color: var(--cream);
  background: rgba(5, 24, 10, .62);
}

.file-copy-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.file-copy-actions button {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
}

.agreement-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

.agreement-check input {
  width: 22px;
  height: 22px;
  min-height: 22px;
  margin-top: 2px;
  appearance: none;
  -webkit-appearance: none;
  border: 2px solid rgba(255, 199, 91, .75);
  border-radius: 4px;
  background: rgba(5, 24, 10, .45);
  outline: none;
  box-shadow: none;
  flex: 0 0 22px;
  cursor: pointer;
}

.agreement-check input:checked {
  background-color: var(--honey);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M5 11.5l4 4 8-9' fill='none' stroke='%231b1205' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"), linear-gradient(135deg, var(--honey), var(--gold));
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px, auto;
}

.agreement-check input:focus {
  box-shadow: none;
}

.agreement-check a {
  color: var(--gold);
}

.register-page .apps-panel {
  display: none !important;
}

body.account-view .login-top-link {
  display: none;
}

.vpn-file-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.vpn-file-card {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 14px;
  border: 1px solid rgba(255, 231, 158, .24);
  border-radius: 8px;
  background: rgba(5, 24, 10, .42);
}

.vpn-file-card h4,
.vpn-file-card p {
  margin: 0;
}

.vpn-file-card p {
  color: var(--muted);
  line-height: 1.45;
}

.file-badge {
  width: max-content;
  padding: 5px 9px;
  border-radius: 999px;
  color: #1b1205;
  background: linear-gradient(135deg, var(--honey), var(--gold));
  font-size: 12px;
  font-weight: 1000;
}

.mini-qr {
  width: 180px;
  min-height: 180px;
  display: grid;
  place-items: center;
  padding: 6px;
  border-radius: 8px;
  background: var(--cream);
}

.vpn-file-card code {
  min-height: 42px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 11px 12px;
  border: 1px solid rgba(255, 231, 158, .22);
  border-radius: 8px;
  color: var(--cream);
  background: rgba(5, 24, 10, .62);
}

.link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.link-row code {
  min-height: 42px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 11px 12px;
  border: 1px solid rgba(255, 231, 158, .22);
  border-radius: 8px;
  color: var(--cream);
  background: rgba(5, 24, 10, .62);
}

@media (max-width: 820px) {
  .shell {
    width: min(100% - 22px, 1280px);
  }

  .topbar,
  .identity-panel,
  .links-head {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions,
  .links-head div {
    width: 100%;
  }

  .download-chip,
  .ghost-action,
  .links-head button {
    flex: 1;
  }

  .hero {
    min-height: auto;
    padding: 18px;
  }

  h1 {
    font-size: clamp(28px, 12vw, 44px);
    line-height: 1.02;
  }

  h1 span {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .lead {
    font-size: 17px;
  }

  .access-grid,
  .apps-panel,
  .app-grid,
  .metric-grid,
  .connect-grid {
    grid-template-columns: 1fr;
  }

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

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

  .switcher label {
    justify-content: flex-start;
    padding: 0 16px;
  }

  .qr {
    width: 100%;
  }

  .verify-box,
  .profile-actions {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .profile-actions {
    flex-direction: column;
  }

  .link-row {
    grid-template-columns: 1fr;
  }

  .link-row button,
  .primary-link-box button {
    width: 100%;
  }

  .primary-link-box code,
  .vpn-file-card code,
  .link-row code {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .vpn-file-grid {
    grid-template-columns: 1fr;
  }

  .mini-qr {
    width: 100%;
  }
}
