:root {
  color-scheme: light;
  --bg: #f4f6f5;
  --panel: #ffffff;
  --panel-2: #eef2f0;
  --text: #202624;
  --muted: #66736e;
  --line: #d7ded9;
  --accent: #285f57;
  --accent-2: #49697d;
  --accent-soft: #e2efec;
  --warning: #8a6133;
  --shadow: 0 18px 42px rgba(32, 38, 36, .08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}

a { color: inherit; text-decoration: none; }
a:hover, a:focus-visible { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

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

button,
.button-link {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

.account-topbar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 246, 245, .94);
  backdrop-filter: blur(14px);
}

.account-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 760;
}

.account-logo-mark {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #93aaa2;
  border-radius: 10px;
  background: var(--text);
  color: #fff;
  font-size: 13px;
  letter-spacing: 0;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.account-chip {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
}

.account-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: calc(100vh - 68px);
}

.account-sidebar {
  padding: 24px 18px;
  border-right: 1px solid var(--line);
}

.sidebar-label {
  margin: 0 0 14px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.account-sidebar nav {
  display: grid;
  gap: 4px;
}

.side-link {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 700;
}

.side-link:hover,
.side-link:focus-visible,
.side-link.active {
  background: var(--accent-soft);
  color: var(--text);
  text-decoration: none;
}

.side-link.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.sidebar-logout {
  margin: 20px 0 0;
}

.sidebar-logout button {
  width: 100%;
  justify-content: center;
}

.account-main {
  padding: 34px clamp(22px, 4vw, 58px) 64px;
}

.account-console {
  width: min(980px, 100%);
  margin: 0 auto;
}

.overview-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 24px;
  align-items: end;
  padding: clamp(26px, 4vw, 46px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(135deg, #ffffff 0%, #f7faf8 100%);
  box-shadow: var(--shadow);
}

.eyebrow,
.card-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.overview-panel h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1.05;
  font-weight: 760;
}

.account-muted,
.settings-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.status-block {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.status-badge {
  width: fit-content;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.status-block strong { font-size: 20px; }
.status-block small { color: var(--muted); font-size: 12px; }

.console-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 22px;
}

.console-actions a,
.card-links a,
.account-actions a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-weight: 720;
}

.console-actions a:first-child {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

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

.settings-card,
.account-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(32, 38, 36, .05);
}

.settings-card {
  min-height: 168px;
}

.settings-card h2,
.account-card h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

.card-links,
.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.compact-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.compact-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.compact-list span {
  color: var(--muted);
  font-size: 13px;
}

.account-shell {
  width: min(620px, 100%);
  margin: 20px auto 0;
}

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

.account-form h1 {
  margin: 0;
  font-size: 30px;
}

.account-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 740;
}

.account-form hr {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
}

.account-actions form { margin: 0; }

.account-flashes {
  width: min(980px, 100%);
  margin: 0 auto 14px;
}

.account-flashes p {
  margin: 0 0 8px;
  padding: 10px 14px;
  border: 1px solid #b8cbc5;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

@media (max-width: 900px) {
  .account-layout {
    grid-template-columns: 1fr;
  }

  .account-sidebar {
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
  }

  .sidebar-label,
  .sidebar-logout {
    display: none;
  }

  .account-sidebar nav {
    display: flex;
    min-width: max-content;
  }

  .side-link.active {
    box-shadow: inset 0 -3px 0 var(--accent);
  }

  .overview-panel {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

@media (max-width: 640px) {
  .account-topbar {
    height: auto;
    align-items: start;
    flex-direction: column;
    padding: 16px;
  }

  .topbar-nav {
    width: 100%;
    overflow-x: auto;
  }

  .account-main {
    padding: 22px 16px 52px;
  }

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

  .overview-panel {
    padding: 22px;
  }
}


.auth-layout {
  width: min(980px, 100%);
  margin: 18px auto 0;
  display: grid;
  grid-template-columns: minmax(260px, .9fr) minmax(320px, 1.1fr);
  gap: 18px;
  align-items: stretch;
}

.auth-layout.compact {
  width: min(820px, 100%);
}

.auth-brief,
.auth-panel,
.settings-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 10px 26px rgba(32, 38, 36, .06);
}

.auth-brief {
  padding: 28px;
  display: grid;
  align-content: start;
  gap: 18px;
  background: linear-gradient(145deg, #ffffff 0%, #eef4f1 100%);
}

.auth-brief h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.08;
}

.auth-brief p {
  margin: 0;
  color: var(--muted);
}

.auth-panel {
  padding: 24px;
}

.auth-panel h2,
.settings-panel h2 {
  margin: 0;
  font-size: 22px;
}

.auth-steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.auth-steps li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 4px 10px;
  padding: 12px;
  border: 1px solid rgba(40, 95, 87, .16);
  border-radius: 10px;
  background: rgba(255, 255, 255, .62);
}

.auth-steps span {
  grid-row: span 2;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.auth-steps strong {
  line-height: 1.2;
}

.auth-steps small,
.form-note,
.form-link,
.brief-box span {
  color: var(--muted);
  font-size: 13px;
}

.brief-box {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(40, 95, 87, .18);
  border-radius: 10px;
  background: rgba(255,255,255,.68);
}

.account-form button[type="submit"],
.auth-panel button[type="submit"],
.settings-panel button[type="submit"] {
  width: fit-content;
  min-width: 150px;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.form-note,
.form-link {
  margin: 0;
}

.form-link a {
  color: var(--accent);
  font-weight: 800;
}

.otp-input {
  max-width: 220px;
  font-size: 24px;
  letter-spacing: .32em;
  font-weight: 800;
}

.settings-page {
  width: min(980px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.settings-title {
  padding: 26px 0 4px;
}

.settings-title h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.08;
}

.settings-title p:not(.eyebrow) {
  max-width: 680px;
  margin: 10px 0 0;
  color: var(--muted);
}

.settings-panel {
  padding: 22px;
  display: grid;
  gap: 16px;
}

.panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.panel-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

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

.settings-panel hr {
  width: 100%;
  margin: 2px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

@media (max-width: 820px) {
  .auth-layout,
  .auth-layout.compact {
    grid-template-columns: 1fr;
  }

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

.brief-box.simple {
  margin-top: 4px;
  background: #fff;
}


.auth-page .account-topbar {
  background: rgba(244, 246, 245, .98);
}

.auth-main {
  min-height: calc(100vh - 68px);
  display: grid;
  align-items: center;
  padding-top: 28px;
  padding-bottom: 58px;
}

.auth-main .auth-layout {
  margin-top: 0;
}


.auth-secondary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.secondary-button {
  min-height: 40px;
  min-width: 150px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
}

.secondary-button:hover,
.secondary-button:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}


.auth-button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.auth-button-row form {
  margin: 0;
}

.form-note.is-danger {
  color: #a33b31;
  font-weight: 760;
}

.passkey-list li strong::before {
  content: "";
  width: 10px;
  height: 10px;
  display: inline-block;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.passkey-setup-panel {
  gap: 18px;
}

.auth-layout.single {
  grid-template-columns: minmax(320px, 520px);
  justify-content: center;
}

.auth-layout.single .auth-panel {
  width: 100%;
}

.danger-panel {
  border-color: #d7b6b1;
  background: #fffafa;
}

.danger-panel h2 {
  color: #8d2f27;
}

.danger-button,
.account-form .danger-button[type="submit"],
.settings-panel .danger-button[type="submit"] {
  width: fit-content;
  min-width: 170px;
  background: #9f342b;
  border-color: #9f342b;
  color: #fff;
}

.topbar-logout {
  margin: 0 0 0 4px;
}

.topbar-logout button {
  min-height: 36px;
  padding: 0 14px;
  border-color: var(--text);
  background: var(--text);
  color: #fff;
}

.topbar-logout button:hover,
.topbar-logout button:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
}

.account-section-page .settings-panel {
  margin-top: 0;
}

.detail-list li {
  align-items: center;
}

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

.mini-grid > div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.mini-grid strong {
  display: block;
  margin-bottom: 6px;
}

.mini-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 640px) {
  .topbar-logout {
    margin-left: auto;
  }

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

.oauth-return-panel {
  text-align: left;
}

.primary-link {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.primary-link:hover,
.primary-link:focus-visible {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}
