:root {
  --accent: #0f766e;
  --accent-hover: #0d9488;
  --accent-soft: rgba(20, 184, 166, .13);
  --accent-glow: rgba(20, 184, 166, .22);
  --accent-end: #2563eb;
  --amber: #f59e0b;
  --text: #f5f7f4;
  --muted: #9aa6a1;
  --line: rgba(255, 255, 255, .08);
  --line-focus: rgba(20, 184, 166, .5);
  --danger: #f87171;
  --danger-bg: rgba(248, 113, 113, .11);
  --success: #34d399;
  --success-bg: rgba(52, 211, 153, .12);
  --card-bg: rgba(16, 20, 18, .82);
  --card-border: rgba(255, 255, 255, .11);
  --input-bg: rgba(255, 255, 255, .055);
  --input-border: rgba(255, 255, 255, .12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .22);
  --shadow-md: 0 16px 36px rgba(0, 0, 0, .24);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .06);
  --radius: 8px;
  --radius-lg: 8px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

html {
  color-scheme: dark light;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  position: relative;
  overflow-x: hidden;
  font: -apple-system-body;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background:
    linear-gradient(118deg, rgba(20, 184, 166, .16), transparent 34%),
    linear-gradient(246deg, rgba(245, 158, 11, .12), transparent 34%),
    linear-gradient(135deg, #101411 0%, #0b0f12 52%, #15130d 100%);
  -webkit-font-smoothing: antialiased;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body::before {
  background:
    linear-gradient(112deg, transparent 0 19%, rgba(255, 255, 255, .055) 19% 19.15%, transparent 19.15% 66%, rgba(245, 158, 11, .08) 66% 66.18%, transparent 66.18%),
    linear-gradient(90deg, rgba(255, 255, 255, .04), transparent 32% 68%, rgba(255, 255, 255, .025));
}

body::after {
  opacity: .32;
  background-image:
    linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 82%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 82%, transparent);
}

.layout {
  width: min(1040px, 100%);
  min-height: min(640px, calc(100vh - 64px));
  display: grid;
  grid-template-columns: minmax(320px, .9fr) minmax(380px, 440px);
  align-items: center;
  gap: clamp(28px, 5vw, 64px);
  position: relative;
  z-index: 1;
}

.layout-left {
  min-width: 0;
  padding: 28px 0;
}

.layout-right {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: 100%;
  min-height: 0;
}

.brand-mark-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.brand-icon {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .055);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.brand-icon svg {
  width: 30px;
  height: 30px;
  stroke: #5eead4;
  fill: none;
  stroke-width: 1.4;
}

.brand-pulse {
  width: min(180px, 38vw);
  height: 1px;
  background: linear-gradient(90deg, rgba(94, 234, 212, .85), rgba(245, 158, 11, .75), transparent);
}

.brand-name {
  max-width: 520px;
  font-size: 56px;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--text);
  line-height: 1.02;
}

.brand-name span {
  color: #f8faf7;
}

.brand-sub {
  margin-top: 14px;
  font-size: 20px;
  color: #d7ded8;
  font-weight: 650;
  letter-spacing: 0;
}

.brand-tagline {
  max-width: 430px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.brand-line {
  width: min(320px, 100%);
  height: 1px;
  margin-top: 30px;
  background: linear-gradient(90deg, rgba(94, 234, 212, .7), rgba(245, 158, 11, .55), transparent);
}

.brand-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 18px;
  color: #c8d0ca;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-metrics span {
  position: relative;
  padding-left: 12px;
}

.brand-metrics span::before {
  content: "";
  position: absolute;
  left: 0;
  top: .45em;
  width: 4px;
  height: 4px;
  background: var(--amber);
}

.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 64px);
  margin: 0;
  padding: 32px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(28px) saturate(1.25);
  -webkit-backdrop-filter: blur(28px) saturate(1.25);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-hover), var(--amber), var(--accent-end));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card-header {
  text-align: left;
  margin-bottom: 22px;
}

.card-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  border: 1px solid rgba(20, 184, 166, .22);
  border-radius: var(--radius);
  background: rgba(20, 184, 166, .11);
  color: #99f6e4;
}

.card-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
}

h1 {
  font-size: 22px;
  font-weight: 750;
  letter-spacing: 0;
  color: var(--text);
}

.subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13.5px;
}

.field {
  margin-top: 16px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  color: #c4cbc7;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}

.input-wrap input[type="password"] {
  padding-right: 64px;
}

.input-wrap input::placeholder {
  color: #68756f;
}

.input-wrap input:focus {
  outline: none;
  border-color: var(--line-focus);
  background: rgba(255, 255, 255, .075);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.input-wrap .toggle-pw {
  position: absolute;
  right: 8px;
  width: auto;
  margin: 0;
  padding: 5px 7px;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
}

.input-wrap .toggle-pw:hover {
  color: #99f6e4;
}

.error-box,
.success-box {
  display: none;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.45;
}

.error-box {
  border: 1px solid rgba(248, 113, 113, .22);
  background: var(--danger-bg);
  color: var(--danger);
}

.success-box {
  border: 1px solid rgba(52, 211, 153, .22);
  background: var(--success-bg);
  color: var(--success);
}

.verify-panel:not(.active) {
  display: none !important;
}

.verify-panel.active {
  display: block !important;
}

.btn {
  width: 100%;
  min-height: 46px;
  margin-top: 22px;
  padding: 11px 16px;
  border: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent), var(--accent-end));
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  transition: box-shadow .2s, transform .1s, filter .2s;
}

.btn:hover {
  box-shadow: 0 12px 30px rgba(15, 118, 110, .32);
  filter: brightness(1.08);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  filter: none;
}

.divider {
  position: relative;
  margin: 20px 0 14px;
  text-align: center;
}

.divider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px solid var(--line);
}

.divider span {
  position: relative;
  padding: 0 12px;
  background: var(--card-bg);
  color: var(--muted);
  font-size: 12px;
}

.links {
  color: var(--muted);
  font-size: 13.5px;
  text-align: center;
}

.links a {
  color: #5eead4;
  text-decoration: none;
  font-weight: 650;
  transition: color .15s;
}

.links a:hover {
  color: #fcd34d;
}

.field-hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2px;
  margin-bottom: 22px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .045);
}

.tabs button {
  min-width: 0;
  min-height: 38px;
  padding: 8px 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
  white-space: nowrap;
  transition: background .2s, color .2s, box-shadow .2s;
}

.tabs button:hover {
  color: #d7ded8;
}

.tabs button.active {
  background: rgba(255, 255, 255, .11);
  color: #fff;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .07);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.tab-stack {
  display: grid;
}

.tab-stack > .tab-pane {
  display: block;
  grid-area: 1 / 1;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}

.tab-stack > .tab-pane.active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

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

.code-row .input-wrap {
  min-width: 0;
}

.code-row .send-btn {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(20, 184, 166, .22);
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: #99f6e4;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s;
}

.code-row .send-btn:hover:not(:disabled) {
  border-color: rgba(245, 158, 11, .34);
  background: rgba(20, 184, 166, .2);
  color: #fcd34d;
}

.code-row .send-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

#mfa-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(9, 12, 14, .68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#mfa-overlay .mfa-modal {
  width: min(100%, 390px);
  padding: 30px 28px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  box-shadow: var(--shadow-lg);
}

#mfa-overlay .mfa-modal h2 {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 18px;
  font-weight: 750;
}

#mfa-overlay .mfa-modal .mfa-hint {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 13px;
}

#mfa-overlay .mfa-modal .input-wrap input {
  font-size: 18px;
  letter-spacing: .15em;
  text-align: center;
}

#mfa-overlay .mfa-modal .btn {
  margin-top: 16px;
}

#mfa-overlay .mfa-modal .error-box {
  margin-top: 10px;
}

@media (max-width: 860px) {
  body {
    align-items: flex-start;
    padding: 28px 16px;
  }

  .layout {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 28px;
    width: min(100%, 500px);
  }

  .layout-left {
    padding: 0;
    text-align: left;
  }

  .brand-mark-row {
    margin-bottom: 18px;
  }

  .brand-name {
    font-size: 36px;
  }

  .brand-sub {
    font-size: 17px;
  }

  .brand-tagline {
    max-width: none;
  }

  .brand-line {
    margin-top: 20px;
  }

  .layout-right {
    display: block;
  }

  .card {
    max-width: none;
    max-height: none;
    margin-left: 0;
    overflow: visible;
  }
}

@media (max-height: 720px) and (min-width: 861px) {
  body {
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .layout {
    min-height: calc(100vh - 48px);
  }

  .brand-name {
    font-size: 46px;
  }

  .card {
    max-height: calc(100vh - 48px);
    padding: 28px;
  }

  .card-icon {
    margin-bottom: 12px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 18px 12px;
  }

  .card {
    padding: 28px 20px 24px;
  }

  .card-header {
    margin-bottom: 22px;
  }

  h1 {
    font-size: 20px;
  }

  .brand-name {
    font-size: 30px;
  }

  .brand-metrics {
    gap: 12px;
    font-size: 11px;
  }

  .tabs button {
    font-size: 12px;
  }

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

  .code-row .send-btn {
    width: 100%;
  }
}

@media (prefers-color-scheme: light) {
  :root {
    --text: #17201b;
    --muted: #68766f;
    --line: rgba(15, 23, 42, .09);
    --line-focus: rgba(13, 148, 136, .45);
    --danger: #dc2626;
    --danger-bg: rgba(220, 38, 38, .08);
    --success: #047857;
    --success-bg: rgba(4, 120, 87, .09);
    --card-bg: rgba(255, 255, 255, .86);
    --card-border: rgba(15, 23, 42, .1);
    --input-bg: rgba(255, 255, 255, .94);
    --input-border: rgba(15, 23, 42, .13);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .08);
    --shadow-md: 0 16px 38px rgba(15, 23, 42, .1);
    --shadow-lg: 0 24px 60px rgba(15, 23, 42, .14), inset 0 1px 0 rgba(255, 255, 255, .75);
    --accent-soft: rgba(13, 148, 136, .09);
    --accent-glow: rgba(13, 148, 136, .14);
  }

  body {
    background:
      linear-gradient(118deg, rgba(13, 148, 136, .12), transparent 34%),
      linear-gradient(246deg, rgba(245, 158, 11, .11), transparent 34%),
      linear-gradient(135deg, #f6f8f4 0%, #eef7f5 48%, #fff7ed 100%);
  }

  body::before {
    background:
      linear-gradient(112deg, transparent 0 19%, rgba(15, 23, 42, .06) 19% 19.15%, transparent 19.15% 66%, rgba(245, 158, 11, .12) 66% 66.18%, transparent 66.18%),
      linear-gradient(90deg, rgba(255, 255, 255, .5), transparent 32% 68%, rgba(255, 255, 255, .32));
  }

  body::after {
    opacity: .45;
    background-image:
      linear-gradient(rgba(15, 23, 42, .045) 1px, transparent 1px),
      linear-gradient(90deg, rgba(15, 23, 42, .04) 1px, transparent 1px);
  }

  .brand-icon {
    border-color: rgba(15, 23, 42, .12);
    background: rgba(255, 255, 255, .68);
  }

  .brand-icon svg {
    stroke: #0f766e;
  }

  .brand-name span {
    color: #13201a;
  }

  .brand-sub {
    color: #24322b;
  }

  .brand-metrics {
    color: #435149;
  }

  .card-icon {
    color: #0f766e;
    border-color: rgba(13, 148, 136, .2);
    background: rgba(13, 148, 136, .08);
  }

  .field label {
    color: #435149;
  }

  .input-wrap input::placeholder {
    color: #9ba8a1;
  }

  .input-wrap input:focus {
    background: #fff;
  }

  .input-wrap .toggle-pw:hover {
    color: #0f766e;
  }

  .links a {
    color: #0f766e;
  }

  .links a:hover {
    color: #b45309;
  }

  .tabs {
    border-color: rgba(15, 23, 42, .08);
    background: rgba(15, 23, 42, .045);
  }

  .tabs button {
    color: #68766f;
  }

  .tabs button:hover {
    color: #17201b;
  }

  .tabs button.active {
    background: #fff;
    color: #0f766e;
    box-shadow: var(--shadow-sm);
  }

  .code-row .send-btn {
    color: #0f766e;
    border-color: rgba(13, 148, 136, .18);
  }

  .code-row .send-btn:hover:not(:disabled) {
    background: rgba(13, 148, 136, .12);
    color: #b45309;
  }
}
