:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --navy: #0b2a6f;
  --blue: #2563eb;
  --blue-hover: #1d4ed8;
  --teal: #14b8a6;
  --text: #111827;
  --muted: #4b5563;
  --border: #e2e8f0;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.link {
  color: var(--blue);
  font-weight: 600;
}
.link:hover {
  text-decoration: underline;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  max-width: 1120px;
  margin: 0 auto;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--navy);
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--navy);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
}

.brand-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blue);
  background: rgba(37, 99, 235, 0.1);
  padding: 2px 7px;
  border-radius: 6px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 10px;
}
.nav-link:hover {
  color: var(--navy);
  background: #f1f5f9;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn-full {
  width: 100%;
}
.btn-primary {
  background: var(--blue);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--blue-hover);
}
.btn-secondary {
  background: #fff;
  color: var(--text);
  border-color: #cbd5e1;
}
.btn-secondary:hover:not(:disabled) {
  background: #f8fafc;
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover:not(:disabled) {
  background: var(--danger-hover);
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
}
.btn-ghost:hover:not(:disabled) {
  background: #f1f5f9;
  color: var(--text);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.hero {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 64px 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 36px;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  color: #115e59;
  font-size: 12px;
  font-weight: 600;
}

.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
}

h1 {
  margin: 0;
  color: var(--navy);
  letter-spacing: -0.02em;
}
h2,
h3 {
  margin: 0;
  color: var(--navy);
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
  margin-top: 14px;
}

.hero p {
  color: var(--muted);
  font-size: 17px;
  max-width: 560px;
}

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

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

.section {
  padding: 56px 0;
}

.site-footer {
  margin-top: auto;
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 32px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

/* Auth Shell */
.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.auth-box {
  width: 100%;
  max-width: 440px;
}

.auth-title {
  font-size: 24px;
  margin-bottom: 6px;
}

.auth-subtitle {
  margin: 0 0 22px 0;
  font-size: 14px;
  color: var(--muted);
}

.auth-footer {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  margin-top: 18px;
}

/* Forms */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
}

.input-wrap {
  position: relative;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.input:disabled {
  background: #f1f5f9;
  color: #64748b;
}

.toggle-pw {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.hint {
  font-size: 12px;
  color: #64748b;
  margin: 0;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.checkbox-row input {
  margin-top: 3px;
  width: 16px;
  height: 16px;
}

/* Alerts */
.alert {
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13.5px;
  border: 1px solid;
}
.alert-title {
  font-weight: 700;
  margin: 0 0 3px 0;
}
.alert-info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e3a8a;
}
.alert-success {
  background: #f0fdfa;
  border-color: #99f6e4;
  color: #134e4a;
}
.alert-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #78350f;
}
.alert-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #7f1d1d;
}

/* Password strength */
.pw-meter {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.pw-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}
.pw-bar {
  height: 5px;
  border-radius: 999px;
  background: #e2e8f0;
}
.pw-rules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 10px;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 12px;
  color: #64748b;
}
.pw-rules li.met {
  color: #0f766e;
  font-weight: 600;
}

/* Account Workspace Layout */
.workspace {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sidebar-group {
  margin-top: 20px;
}
.sidebar-heading {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #94a3b8;
  padding: 0 10px;
  margin: 0 0 6px 0;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}
.sidebar-link:hover {
  background: #f1f5f9;
  color: var(--text);
}
.sidebar-link.active {
  background: rgba(37, 99, 235, 0.1);
  color: var(--navy);
  font-weight: 600;
}
.sidebar-link.danger {
  color: var(--danger);
}
.sidebar-link.danger:hover {
  background: #fef2f2;
}

.workspace-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mobile-menu-btn {
  display: none;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-teal {
  background: #f0fdfa;
  color: #115e59;
  border: 1px solid #99f6e4;
}
.badge-amber {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.workspace-content {
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  padding: 26px 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  color: #64748b;
  border-bottom: 1px solid var(--border);
  padding: 8px 10px 8px 0;
}
.table td {
  border-bottom: 1px solid #f1f5f9;
  padding: 10px 10px 10px 0;
}

.codes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}
.code-chip {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
}
.tab-btn {
  border: none;
  background: transparent;
  padding: 8px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.tab-btn.active {
  background: #fff;
  color: var(--navy);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

@media (max-width: 900px) {
  .hero-grid,
  .grid-4,
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
  }
  .sidebar.open {
    display: flex;
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
}
