/* ============================================================
 * Reset + base
 * ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0 solid hsl(var(--border));
}

html,
body {
  height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.5;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

img,
svg,
iconify-icon {
  display: inline-block;
  vertical-align: middle;
  max-width: 100%;
}

iconify-icon {
  flex-shrink: 0;
  transition: opacity 160ms ease;
}

/* Pre-define placeholder — reserves layout space + soft pulse while
   the web component bootstraps from the CDN. width/height come from
   the inline style attribute emitted by the icon partial. */
iconify-icon:not(:defined) {
  display: inline-block;
  background: currentColor;
  border-radius: 3px;
  opacity: 0.08;
  animation: icon-skeleton 1.2s ease-in-out infinite;
}

iconify-icon:defined {
  opacity: 1;
}

@keyframes icon-skeleton {
  0%, 100% { opacity: 0.08; }
  50%      { opacity: 0.18; }
}

@media (prefers-reduced-motion: reduce) {
  iconify-icon:not(:defined) { animation: none; }
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-weight: 600;
}

:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
  border-radius: calc(var(--radius) - 2px);
}

::placeholder {
  color: hsl(var(--muted-foreground));
  opacity: 1;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
 * Utilities (minimal subset; not a full Tailwind)
 * ============================================================ */

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.hidden { display: none; }

.flex-col { flex-direction: column; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

.w-full { width: 100%; }
.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 28rem; }
.max-w-2xl { max-width: 42rem; }
.h-9 { height: 2.25rem; }
.h-10 { height: 2.5rem; }
.h-full { height: 100%; }

.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-foreground { color: hsl(var(--foreground)); }
.text-muted-foreground { color: hsl(var(--muted-foreground)); }
.text-primary { color: hsl(var(--primary)); }
.text-destructive { color: hsl(var(--destructive)); }

.bg-card { background: hsl(var(--card)); }
.bg-muted { background: hsl(var(--muted)); }
.bg-primary { background: hsl(var(--primary)); }

.border-default { border: 1px solid hsl(var(--border)); }
.rounded-md { border-radius: calc(var(--radius) - 2px); }
.rounded-lg { border-radius: var(--radius); }
.rounded-full { border-radius: 9999px; }

.tracking-tight { letter-spacing: -0.025em; }
.leading-relaxed { line-height: 1.625; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================
 * Button
 * ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.25rem;
  padding: 0 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease,
    opacity 120ms ease;
  white-space: nowrap;
  user-select: none;
}

.btn:disabled {
  pointer-events: none;
  opacity: 0.5;
}

.btn-sm {
  height: 2rem;
  padding: 0 0.75rem;
  font-size: 0.8125rem;
}

.btn-lg {
  height: 2.5rem;
  padding: 0 1.5rem;
}

.btn-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}

.btn-primary:hover {
  background: hsl(var(--primary) / 0.9);
}

.btn-secondary {
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

.btn-secondary:hover {
  background: hsl(var(--secondary) / 0.8);
}

.btn-outline {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  border-color: hsl(var(--input));
}

.btn-outline:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.btn-ghost {
  background: transparent;
  color: hsl(var(--foreground));
}

.btn-ghost:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.btn-destructive {
  background: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
  border-color: hsl(var(--destructive));
}

.btn-destructive:hover {
  background: hsl(var(--destructive) / 0.9);
}

.btn-link {
  height: auto;
  padding: 0;
  color: hsl(var(--primary));
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.btn-link:hover {
  text-decoration-thickness: 2px;
}

.btn-success {
  background: hsl(var(--success));
  color: hsl(var(--success-foreground));
  border-color: hsl(var(--success));
}

.btn-success:hover {
  background: hsl(var(--success) / 0.9);
}

.btn-loading {
  pointer-events: none;
  opacity: 1;
}

.btn-spinner {
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-inline-end-color: transparent;
  display: inline-block;
  animation: btn-spin 700ms linear infinite;
}

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .btn-spinner { animation-duration: 1.6s; }
}

/* ============================================================
 * Card
 * ============================================================ */

.card {
  display: flex;
  flex-direction: column;
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
}

.card-header {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 1.5rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.card-description {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.5;
}

.card-content {
  padding: 0 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card-header + .card-content {
  padding-top: 0;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid hsl(var(--border));
}

.card-footer-plain {
  padding-top: 0;
  border-top: 0;
}

/* ============================================================
 * Input / Label / Select / Textarea
 * ============================================================ */

.label {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  color: hsl(var(--foreground));
}

.input,
.select,
.textarea {
  display: flex;
  width: 100%;
  height: 2.25rem;
  padding: 0 0.75rem;
  font-size: 0.875rem;
  line-height: 1;
  color: hsl(var(--foreground));
  background: hsl(var(--background));
  border: 1px solid hsl(var(--input));
  border-radius: calc(var(--radius) - 2px);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.textarea {
  height: auto;
  min-height: 4rem;
  padding: 0.5rem 0.75rem;
  line-height: 1.5;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.15);
}

.input:disabled,
.select:disabled,
.textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.input[readonly],
.textarea[readonly] {
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  cursor: not-allowed;
}

.input[readonly]:focus,
.textarea[readonly]:focus {
  border-color: hsl(var(--input));
  box-shadow: none;
}

.input-group:has(.input[readonly]) iconify-icon {
  opacity: 0.6;
}

.field-hint iconify-icon {
  vertical-align: -2px;
  margin-inline-end: 0.25rem;
}

.select {
  appearance: none;
  -webkit-appearance: none;
  padding-inline-end: 2rem;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='hsl(0 0%25 45.1%25)' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

[dir="rtl"] .select {
  background-position: left 0.75rem center;
}

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

.input-group iconify-icon {
  position: absolute;
  inset-inline-start: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  color: hsl(var(--muted-foreground));
  pointer-events: none;
}

.input-group .input,
.input-group .select {
  padding-inline-start: 2.25rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.field-hint {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.field-error {
  font-size: 0.75rem;
  color: hsl(var(--destructive));
}

/* Password show/hide toggle — injected by app.js around every
   input[type="password"]. The input is wrapped so the eye button can sit
   inside the field on the trailing edge. */
.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field .input {
  padding-inline-end: 2.5rem;
}

.password-toggle {
  position: absolute;
  inset-inline-end: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: hsl(var(--muted-foreground));
  border-radius: calc(var(--radius) - 4px);
  cursor: pointer;
  transition: color 120ms ease, background-color 120ms ease;
}

.password-toggle:hover {
  color: hsl(var(--foreground));
  background: hsl(var(--muted));
}

.password-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.4);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 560px) {
  .form-row-2 {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============================================================
 * Alert
 * ============================================================ */

.alert {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  column-gap: 0.875rem;
  align-items: start;
  padding: 0.875rem 1rem 0.875rem 1rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  overflow: hidden;
}

.alert::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: hsl(var(--muted-foreground));
}

.alert > iconify-icon:first-child {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  font-size: 1rem;
  margin-top: 0;
  flex-shrink: 0;
}

.alert > div { min-width: 0; }

.alert-title {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
  color: hsl(var(--foreground));
}

.alert-description {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: hsl(var(--muted-foreground));
  margin-top: 0.1875rem;
}

.alert-destructive { background: hsl(var(--destructive) / 0.06); border-color: hsl(var(--destructive) / 0.25); }
.alert-destructive::before { background: hsl(var(--destructive)); }
.alert-destructive > iconify-icon:first-child { background: hsl(var(--destructive) / 0.12); color: hsl(var(--destructive)); }

.alert-warning { background: hsl(var(--warning) / 0.08); border-color: hsl(var(--warning) / 0.25); }
.alert-warning::before { background: hsl(var(--warning)); }
.alert-warning > iconify-icon:first-child { background: hsl(var(--warning) / 0.16); color: hsl(38 92% 38%); }

.alert-success { background: hsl(var(--success) / 0.06); border-color: hsl(var(--success) / 0.25); }
.alert-success::before { background: hsl(var(--success)); }
.alert-success > iconify-icon:first-child { background: hsl(var(--success) / 0.14); color: hsl(var(--success)); }

.alert-info { background: hsl(var(--accent)); border-color: hsl(var(--border)); }
.alert-info::before { background: hsl(var(--primary)); }
.alert-info > iconify-icon:first-child { background: hsl(var(--primary) / 0.1); color: hsl(var(--primary)); }

.alert-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.625rem;
}

/* ============================================================
 * Badge
 * ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border-radius: 9999px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  white-space: nowrap;
}

.badge-secondary {
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

.badge-outline {
  background: transparent;
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
}

.badge-success {
  background: hsl(var(--success) / 0.15);
  color: hsl(var(--success));
}

.badge-destructive {
  background: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}

/* ============================================================
 * Avatar
 * ============================================================ */

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  border-radius: 9999px;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  overflow: hidden;
}

.avatar-fallback {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: hsl(var(--primary-foreground));
  background: hsl(var(--primary));
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
 * Separator
 * ============================================================ */

.separator {
  border: 0;
  background: hsl(var(--border));
  height: 1px;
  width: 100%;
  margin: 0;
}

/* ============================================================
 * Breadcrumb
 * ============================================================ */

.breadcrumb-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.375rem;
  list-style: none;
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
}

.breadcrumb-item a {
  color: hsl(var(--muted-foreground));
  transition: color 120ms ease;
}

.breadcrumb-item a:hover {
  color: hsl(var(--foreground));
}

.breadcrumb-separator {
  display: inline-flex;
  color: hsl(var(--muted-foreground));
}

[dir="rtl"] .breadcrumb-separator iconify-icon {
  transform: scaleX(-1);
}

.breadcrumb-page {
  color: hsl(var(--foreground));
  font-weight: 500;
}

/* ============================================================
 * App shell — sidebar + topbar + main
 * ============================================================ */

.app-shell {
  --sidebar-width: 240px;
  --topbar-height: 56px;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
  min-height: 100svh;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
}

@media (max-width: 880px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.25rem 0.75rem;
  background: hsl(var(--sidebar));
  color: hsl(var(--sidebar-foreground));
  border-inline-end: 1px solid hsl(var(--sidebar-border));
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
}

@media (max-width: 880px) {
  .sidebar {
    position: static;
    height: auto;
  }
}

.sidebar-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
}

.sidebar-logo {
  height: 28px;
  width: auto;
  max-width: 160px;
}

.sidebar-brand-sub {
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: hsl(var(--muted-foreground));
}

.sidebar-group-label {
  padding: 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: hsl(var(--sidebar-foreground));
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  list-style: none;
}

.sidebar-menu-button {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.625rem;
  border-radius: calc(var(--radius) - 2px);
  color: hsl(var(--sidebar-foreground));
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 120ms ease, color 120ms ease;
}

.sidebar-menu-button:hover {
  background: hsl(var(--sidebar-accent) / 0.7);
}

.sidebar-menu-button[data-active="true"],
.sidebar-menu-button.is-active {
  background: hsl(var(--sidebar-accent));
  color: hsl(var(--sidebar-accent-foreground));
}

.sidebar-menu-button iconify-icon {
  color: hsl(var(--muted-foreground));
}

.sidebar-menu-button[data-active="true"] iconify-icon,
.sidebar-menu-button.is-active iconify-icon {
  color: hsl(var(--foreground));
}

.sidebar-menu-button-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-menu-button-title {
  font-weight: 500;
}

.sidebar-menu-button-desc {
  font-size: 0.6875rem;
  color: hsl(var(--muted-foreground));
}

/* ----- Topbar ----- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--topbar-height);
  padding: 0 1.5rem;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-spacer {
  flex: 1;
}

.topbar-user-group {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.topbar-user {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0.5rem;
  color: hsl(var(--foreground));
}

.topbar-user-meta {
  display: flex;
  flex-direction: column;
  text-align: end;
  line-height: 1.2;
}

.topbar-user-name {
  font-size: 0.875rem;
  font-weight: 500;
}

.topbar-user-email {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

/* ----- Main / page ----- */

.app-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: hsl(var(--background));
}

.page {
  width: 100%;
  max-width: 720px;
  padding: 2rem 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (max-width: 640px) {
  .page {
    padding: 1.25rem 1rem 3rem;
  }
}

.page-header {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.page-title {
  font-size: 1.875rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: hsl(var(--foreground));
}

.page-lede {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.55;
  max-width: 60ch;
}

/* ============================================================
 * App grid (Uygulama Listesi) — 3 cards
 * ============================================================ */

.app-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 720px) {
  .app-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.app-card-icon {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: calc(var(--radius) - 2px);
}

.app-card-icon-blue {
  background: hsl(214 95% 50% / 0.12);
  color: hsl(214 95% 50%);
}

.app-card-icon-green {
  background: hsl(var(--success) / 0.15);
  color: hsl(var(--success));
}

.app-card-icon-muted {
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}

.card-dashed {
  border-style: dashed;
  background: hsl(var(--muted) / 0.4);
  opacity: 0.9;
}

/* ============================================================
 * Auth split (sign-in / sign-up / recovery / verification)
 * ============================================================ */

.auth-shell {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
  min-height: 100svh;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
}

@media (min-width: 1024px) {
  .auth-shell {
    grid-template-columns: 1fr 1fr;
  }
}

.auth-pane {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2.5rem 1.25rem;
}

@media (min-width: 640px) {
  .auth-pane {
    padding: 2.5rem;
  }
}

@media (min-width: 1024px) {
  .auth-pane {
    padding: 4rem;
    align-items: flex-end;
    padding-inline-end: 5rem;
    border-inline-end: 1px solid hsl(var(--border));
  }
}

@media (min-width: 1280px) {
  .auth-pane {
    padding-inline-end: 7rem;
  }
}

.auth-pane-inner {
  width: 100%;
  max-width: 22rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.auth-brand img {
  height: 40px;
  width: auto;
  max-width: 200px;
}

.auth-heading {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.auth-heading-title {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.auth-heading-subtitle {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.auth-links a {
  color: hsl(var(--foreground));
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.auth-links a:hover {
  text-decoration-thickness: 2px;
}

/* ============================================================
 * Promo panel (right column on wide screens — animated)
 * ============================================================ */

.promo-panel {
  display: none;
  position: relative;
  overflow: hidden;
  color: #ffffff;
  background: #060607;
  isolation: isolate;
  min-height: 100%;
}

@media (min-width: 1024px) {
  .promo-panel {
    display: flex;
  }
}

.promo-panel-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.promo-panel-base {
  background: linear-gradient(180deg, #060607 0%, #0a0d12 45%, #0e1820 80%, #102230 100%);
  z-index: -8;
}

.promo-panel-cone {
  z-index: -7;
  background: conic-gradient(
    from 210deg at 80% 15%,
    rgba(20, 184, 166, 0.22) 0deg,
    rgba(56, 189, 248, 0.14) 60deg,
    transparent 180deg,
    transparent 360deg
  );
  filter: blur(40px);
  animation: promo-cone-spin 28s linear infinite;
  transform-origin: 80% 15%;
}

.promo-blobs {
  z-index: -6;
}

.promo-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.55;
  will-change: transform, opacity;
}

.promo-blob-teal {
  width: 30rem;
  height: 30rem;
  top: -6rem;
  left: -4rem;
  background: radial-gradient(circle, #14b8a6 0%, rgba(20, 184, 166, 0) 70%);
  animation: promo-blob-drift-a 18s linear infinite;
}

.promo-blob-sky {
  width: 26rem;
  height: 26rem;
  bottom: -4rem;
  right: -3rem;
  background: radial-gradient(circle, #38bdf8 0%, rgba(56, 189, 248, 0) 70%);
  animation: promo-blob-drift-b 22s linear infinite;
}

.promo-blob-cyan {
  width: 22rem;
  height: 22rem;
  top: 35%;
  right: 20%;
  background: radial-gradient(circle, #22d3ee 0%, rgba(34, 211, 238, 0) 70%);
  opacity: 0.4;
  animation: promo-blob-drift-c 16s linear infinite;
}

.promo-blob-emerald {
  width: 20rem;
  height: 20rem;
  bottom: 10%;
  left: 25%;
  background: radial-gradient(circle, #34d399 0%, rgba(52, 211, 153, 0) 70%);
  opacity: 0.35;
  animation: promo-blob-drift-d 14s linear infinite;
}

.promo-panel-lines {
  z-index: -5;
  position: absolute;
  inset: -10%;
  width: 120%;
  height: 120%;
  animation: promo-lines-drift 24s linear infinite;
}

.promo-panel-shimmer {
  z-index: -1;
  background: linear-gradient(
    115deg,
    transparent 30%,
    rgba(255, 255, 255, 0.06) 45%,
    rgba(255, 255, 255, 0.14) 50%,
    rgba(255, 255, 255, 0.06) 55%,
    transparent 70%
  );
  background-size: 220% 100%;
  mix-blend-mode: overlay;
  animation: promo-shimmer 6.5s linear infinite;
}

.promo-panel-vignette {
  z-index: -4;
  background: radial-gradient(ellipse at center, transparent 35%, rgba(0, 0, 0, 0.45) 90%);
}

.promo-panel-diagonal {
  z-index: -3;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, transparent 40%, rgba(0, 0, 0, 0.18) 100%);
}

.promo-panel-noise {
  z-index: -2;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.promo-panel-edge {
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  z-index: -1;
  background: linear-gradient(90deg, transparent 0%, rgba(45, 212, 191, 0.55) 50%, transparent 100%);
}

.promo-panel-content {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 2rem;
  padding: 3rem 3.5rem;
  width: 100%;
}

.promo-panel-title {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #ffffff;
  text-shadow: 0 1px 24px rgba(0, 0, 0, 0.35);
}

@media (min-width: 1280px) {
  .promo-panel-title { font-size: 2.5rem; }
}

.promo-brand {
  background: linear-gradient(90deg, #4ade80 0%, #2dd4bf 35%, #22d3ee 65%, #60a5fa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

.promo-panel-desc {
  color: #d4d4d8;
  font-size: 1rem;
  line-height: 1.65;
}

.promo-social {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.promo-social-stack {
  display: flex;
}

.promo-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  border: 2px solid #0a0a0a;
  object-fit: cover;
  background: #1a1a1a;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18), 0 4px 8px rgba(0, 0, 0, 0.35);
}

.promo-avatar + .promo-avatar {
  margin-inline-start: -0.75rem;
}

@keyframes promo-cone-spin {
  from { transform: rotate(0deg) scale(1.06); }
  to   { transform: rotate(360deg) scale(1.06); }
}

@keyframes promo-blob-drift-a {
  0%   { transform: translate3d(0, 0, 0) scale(1.06); }
  20%  { transform: translate3d(3rem, 1.5rem, 0) scale(1.1); }
  40%  { transform: translate3d(4rem, 3.5rem, 0) scale(1.14); }
  60%  { transform: translate3d(1.5rem, 4rem, 0) scale(1.12); }
  80%  { transform: translate3d(-1rem, 2rem, 0) scale(1.08); }
  100% { transform: translate3d(0, 0, 0) scale(1.06); }
}

@keyframes promo-blob-drift-b {
  0%   { transform: translate3d(0, 0, 0) scale(1.04); }
  20%  { transform: translate3d(-3rem, -1.5rem, 0) scale(1.08); }
  40%  { transform: translate3d(-4rem, -3rem, 0) scale(1.12); }
  60%  { transform: translate3d(-2rem, -4rem, 0) scale(1.1); }
  80%  { transform: translate3d(1rem, -2rem, 0) scale(1.06); }
  100% { transform: translate3d(0, 0, 0) scale(1.04); }
}

@keyframes promo-blob-drift-c {
  0%   { transform: translate3d(0, 0, 0) scale(1.05); }
  25%  { transform: translate3d(2.5rem, -2rem, 0) scale(1.12); }
  50%  { transform: translate3d(0, -3.5rem, 0) scale(1.16); }
  75%  { transform: translate3d(-2.5rem, -2rem, 0) scale(1.1); }
  100% { transform: translate3d(0, 0, 0) scale(1.05); }
}

@keyframes promo-blob-drift-d {
  0%   { transform: translate3d(0, 0, 0) scale(1.04); }
  25%  { transform: translate3d(-2rem, 2.5rem, 0) scale(1.1); }
  50%  { transform: translate3d(0, 4rem, 0) scale(1.14); }
  75%  { transform: translate3d(2rem, 2.5rem, 0) scale(1.08); }
  100% { transform: translate3d(0, 0, 0) scale(1.04); }
}

@keyframes promo-lines-drift {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg); }
  25%  { transform: translate3d(-1.5%, 1%, 0) rotate(0.3deg); }
  50%  { transform: translate3d(0, 1.5%, 0) rotate(0deg); }
  75%  { transform: translate3d(1.5%, 1%, 0) rotate(-0.3deg); }
  100% { transform: translate3d(0, 0, 0) rotate(0deg); }
}

@keyframes promo-shimmer {
  from { background-position: -150% 0; }
  to   { background-position: 250% 0; }
}

@keyframes promo-avatar-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18), 0 4px 8px rgba(0, 0, 0, 0.35); }
  50%      { box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.55), 0 4px 14px rgba(45, 212, 191, 0.25); }
}

.promo-avatar:nth-child(1) { animation: promo-avatar-pulse 4s ease-in-out infinite; }
.promo-avatar:nth-child(2) { animation: promo-avatar-pulse 4s ease-in-out infinite 1s; }
.promo-avatar:nth-child(3) { animation: promo-avatar-pulse 4s ease-in-out infinite 2s; }
.promo-avatar:nth-child(4) { animation: promo-avatar-pulse 4s ease-in-out infinite 3s; }

@media (prefers-reduced-motion: reduce) {
  .promo-panel-cone,
  .promo-blob,
  .promo-panel-lines,
  .promo-panel-shimmer,
  .promo-avatar {
    animation: none !important;
  }
}

/* ============================================================
 * Switch (toggle)
 * ============================================================ */

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.switch input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 2.25rem;
  height: 1.25rem;
  background: hsl(var(--input));
  border-radius: 9999px;
  position: relative;
  cursor: pointer;
  transition: background 140ms ease;
  flex-shrink: 0;
  margin: 0;
}

.switch input[type="checkbox"]::before {
  content: "";
  position: absolute;
  width: 1rem;
  height: 1rem;
  top: 0.125rem;
  inset-inline-start: 0.125rem;
  background: #ffffff;
  border-radius: 9999px;
  transition: transform 140ms ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.switch input[type="checkbox"]:checked {
  background: hsl(var(--primary));
}

.switch input[type="checkbox"]:checked::before {
  transform: translateX(1rem);
}

[dir="rtl"] .switch input[type="checkbox"]:checked::before {
  transform: translateX(-1rem);
}

.switch input[type="checkbox"]:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

/* ============================================================
 * Security method card (switch + accordion body)
 * ============================================================ */

.security-method-header {
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.security-method-text {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
}

.security-method-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
}

.security-method-body {
  border-top: 1px solid hsl(var(--border));
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.security-method-body[hidden] {
  display: none;
}

/* ============================================================
 * Sessions list (security page)
 * ============================================================ */

.sessions-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  list-style: none;
}

.session-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
}

.session-item-icon {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}

.session-item-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.session-item-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-item-meta {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

/* TOTP + lookup_secret grouped renders */
.totp-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
}

@media (min-width: 560px) {
  .totp-grid { grid-template-columns: auto 1fr; }
}

.totp-node {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.totp-node img {
  width: 160px;
  height: 160px;
  padding: 0.5rem;
  background: #ffffff;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
}

.totp-node .form-text-node {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  padding: 0.5rem 0.625rem;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  word-break: break-all;
}

.lookup-node {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lookup-node .form-text-node {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  background: hsl(var(--muted) / 0.5);
  border: 1px dashed hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  letter-spacing: 0.05em;
}

.form-text-node {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

/* ============================================================
 * Toast (Sonner-like)
 * ============================================================ */

.toast-stack {
  position: fixed;
  bottom: 1.25rem;
  inset-inline-end: 1.25rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(360px, calc(100vw - 2.5rem));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.625rem;
  align-items: flex-start;
  padding: 0.75rem 0.875rem;
  background: hsl(var(--popover));
  border: 1px solid hsl(var(--border));
  border-inline-start-width: 4px;
  border-inline-start-color: hsl(var(--success));
  border-radius: var(--radius);
  box-shadow: 0 6px 24px hsl(var(--foreground) / 0.08),
              0 2px 6px hsl(var(--foreground) / 0.04);
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 240ms ease, transform 240ms ease;
}

.toast-in { opacity: 1; transform: translateY(0); }
.toast-out { opacity: 0; transform: translateY(8px); }

.toast-success {
  border-inline-start-color: hsl(var(--success));
}

.toast-success .toast-icon {
  color: hsl(var(--success));
  background: hsl(var(--success) / 0.15);
}

.toast-destructive {
  border-inline-start-color: hsl(var(--destructive));
}

.toast-destructive .toast-icon {
  color: hsl(var(--destructive));
  background: hsl(var(--destructive) / 0.12);
}

.toast-icon {
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: calc(var(--radius) - 2px);
}

.toast-body {
  line-height: 1.45;
  word-break: break-word;
}

.toast-close {
  width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: calc(var(--radius) - 2px);
  color: hsl(var(--muted-foreground));
  background: transparent;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.toast-close:hover {
  background: hsl(var(--accent));
  color: hsl(var(--foreground));
}

@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; transform: none; }
}

/* ============================================================
 * Error page card (centered)
 * ============================================================ */

.centered-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 1rem;
}

.error-debug {
  text-align: start;
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
  padding: 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ============================================================
 * MFA summary card (security page top)
 * ============================================================ */

.mfa-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
}

.mfa-summary-body {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  min-width: 0;
  flex: 1;
}

.mfa-summary-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: hsl(var(--accent));
  color: hsl(var(--primary));
  flex-shrink: 0;
}

.mfa-summary:has(.mfa-summary-icon iconify-icon[icon*="warning"]) .mfa-summary-icon {
  background: hsl(var(--warning) / 0.15);
  color: hsl(38 92% 38%);
}

.mfa-summary-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
}

.mfa-summary-desc {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.375rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  align-items: center;
}

/* ============================================================
 * Wizard steps (TOTP enrollment)
 * ============================================================ */

.wizard-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  counter-reset: step;
}

.wizard-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.875rem;
}

.wizard-step-marker {
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-size: 0.8125rem;
  font-weight: 600;
  flex-shrink: 0;
}

.wizard-step-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.wizard-step-title {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
}

.wizard-step-desc {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  margin: 0;
}

/* ============================================================
 * TOTP enrollment (QR + manual secret)
 * ============================================================ */

.totp-enroll {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: center;
  margin-top: 0.5rem;
}

@media (min-width: 560px) {
  .totp-enroll { grid-template-columns: auto 1fr; }
}

.totp-qr img {
  width: 160px;
  height: 160px;
  padding: 0.5rem;
  background: #ffffff;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  display: block;
}

.totp-secret {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
}

.field-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field-optional {
  font-weight: 400;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  margin-inline-start: 0.25rem;
}

.totp-secret-code {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  padding: 0.625rem 0.75rem;
  background: hsl(var(--muted));
  border: 1px dashed hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  letter-spacing: 0.08em;
  word-break: break-all;
  user-select: all;
}

/* OTP code input — large, centered */
.input-otp {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  letter-spacing: 0.5em;
  text-align: center;
  padding-inline: 0.5rem;
  height: 3.25rem;
  max-width: 14rem;
}

/* ============================================================
 * Backup codes (one-time display)
 * ============================================================ */

.backup-codes {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  line-height: 1.8;
  padding: 1rem 1.125rem;
  background: hsl(var(--muted));
  border: 1px dashed hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  letter-spacing: 0.06em;
  white-space: pre-wrap;
  word-break: break-all;
  user-select: all;
  margin: 0.75rem 0;
}

.backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.backup-actions .btn { gap: 0.375rem; }

/* ============================================================
 * Checkbox row (ack)
 * ============================================================ */

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
  background: hsl(var(--accent));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  cursor: pointer;
  user-select: none;
}

.checkbox-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.125rem;
  height: 1.125rem;
  border: 1.5px solid hsl(var(--border));
  border-radius: 4px;
  background: hsl(var(--background));
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  margin: 0;
  transition: background 120ms ease, border-color 120ms ease;
}

.checkbox-row input[type="checkbox"]:checked {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
}

.checkbox-row input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8l3.5 3.5L13 5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px 14px;
}

.checkbox-row input[type="checkbox"]:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

/* ============================================================
 * Card footer split (two button rows)
 * ============================================================ */

.card-footer-split {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-start;
}

/* ============================================================
 * Modal (native <dialog>)
 * ============================================================ */

.modal {
  width: min(420px, calc(100vw - 2rem));
  max-width: 92vw;
  padding: 0;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
  box-shadow: 0 24px 48px hsl(var(--foreground) / 0.18),
              0 6px 16px hsl(var(--foreground) / 0.08);
}

.modal-lg { width: min(560px, calc(100vw - 2rem)); }

.modal-close {
  position: absolute;
  inset-block-start: 0.625rem;
  inset-inline-end: 0.625rem;
  width: 1.875rem;
  height: 1.875rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: calc(var(--radius) - 2px);
  color: hsl(var(--muted-foreground));
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.modal-close:hover {
  background: hsl(var(--accent));
  color: hsl(var(--foreground));
}

.modal-header { position: relative; padding-inline-end: 2.75rem; }

.modal::backdrop {
  background: hsl(var(--foreground) / 0.45);
  backdrop-filter: blur(2px);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1.125rem 1.25rem 0.5rem;
}

.modal-icon {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: hsl(var(--destructive) / 0.12);
  color: hsl(var(--destructive));
  flex-shrink: 0;
}

.modal-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}

.modal-body {
  padding: 0.5rem 1.25rem 0.25rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: hsl(var(--muted-foreground));
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.25rem 1.125rem;
}

/* ============================================================
 * Sidebar — extra group label spacing
 * ============================================================ */

.sidebar-group + .sidebar-group-label { margin-top: 1.25rem; }
.sidebar-group { display: contents; }

/* ============================================================
 * Password strength meter + requirements (sign-up / security)
 * Injected markup lives below the password input; app.js drives
 * the data-level attribute and per-requirement data-ok state.
 * ============================================================ */

.pw-meter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pw-meter-track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: hsl(var(--muted));
  overflow: hidden;
}

.pw-meter-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: hsl(var(--destructive));
  transition: width 160ms ease, background-color 160ms ease;
}

.pw-meter[data-level='1'] .pw-meter-fill { width: 25%; background: hsl(var(--destructive)); }
.pw-meter[data-level='2'] .pw-meter-fill { width: 50%; background: hsl(var(--warning)); }
.pw-meter[data-level='3'] .pw-meter-fill { width: 75%; background: hsl(var(--success)); }
.pw-meter[data-level='4'] .pw-meter-fill { width: 100%; background: hsl(var(--success)); }

.pw-meter-label {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  min-width: 5rem;
  text-align: right;
}

.pw-meter[data-level='1'] .pw-meter-label { color: hsl(var(--destructive)); }
.pw-meter[data-level='2'] .pw-meter-label { color: hsl(var(--warning)); }
.pw-meter[data-level='3'] .pw-meter-label,
.pw-meter[data-level='4'] .pw-meter-label { color: hsl(var(--success)); }

.pw-reqs {
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
}

.pw-reqs li {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.pw-reqs li::before {
  content: '○';
  font-size: 0.7rem;
}

.pw-reqs li[data-ok='1'] {
  color: hsl(var(--success));
}

.pw-reqs li[data-ok='1']::before {
  content: '✓';
}
