/* ═══════════════════════════════════════════════════════════════
   GARAGE DOOR CONTROLLER — Premium Dark Admin Panel
   ═══════════════════════════════════════════════════════════════ */

/* ── Design Tokens ────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-primary:    #0a0e1a;
  --bg-secondary:  #0f1425;
  --bg-surface:    rgba(15, 20, 40, 0.65);
  --bg-surface-hover: rgba(20, 28, 55, 0.75);
  --bg-elevated:   rgba(22, 30, 58, 0.6);

  /* Text */
  --text-primary:   #f0f2f8;
  --text-secondary: #8892b0;
  --text-muted:     #4a5578;
  --text-inverse:   #0a0e1a;

  /* Accents — teal to purple gradient */
  --accent-start:  #06d6a0;
  --accent-mid:    #3b82f6;
  --accent-end:    #7c3aed;
  --gradient:      linear-gradient(135deg, var(--accent-start), var(--accent-mid), var(--accent-end));
  --gradient-soft: linear-gradient(135deg, rgba(6,214,160,0.15), rgba(124,58,237,0.15));
  --gradient-text: linear-gradient(135deg, var(--accent-start), var(--accent-end));

  /* Alert / Danger */
  --danger:        #ef4444;
  --danger-soft:   rgba(239,68,68,0.12);
  --success:       #06d6a0;
  --success-soft:  rgba(6,214,160,0.12);
  --warning:       #f59e0b;
  --warning-soft:  rgba(245,158,11,0.12);

  /* Borders */
  --border:        rgba(255,255,255,0.06);
  --border-hover:  rgba(255,255,255,0.12);
  --border-accent: rgba(6,214,160,0.3);

  /* Glass */
  --glass-bg:      rgba(15, 20, 42, 0.55);
  --glass-border:  rgba(255,255,255,0.08);
  --glass-blur:    20px;

  /* Sizing */
  --radius-sm:     8px;
  --radius-md:     12px;
  --radius-lg:     20px;
  --radius-xl:     24px;

  /* Transitions */
  --ease-out:      cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:   cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast:      150ms;
  --dur-normal:    250ms;
  --dur-slow:      400ms;

  /* Shadows */
  --shadow-sm:     0 2px 8px rgba(0,0,0,0.2);
  --shadow-md:     0 8px 32px rgba(0,0,0,0.3);
  --shadow-lg:     0 16px 48px rgba(0,0,0,0.4);
  --shadow-glow:   0 0 40px rgba(6,214,160,0.08);
}

/* ── Reset & Base ─────────────────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Subtle animated background mesh */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(6,214,160,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 90%, rgba(124,58,237,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 50% 50%, rgba(59,130,246,0.03) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.hidden { display: none !important; }

.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;
}

/* ── Scrollbar ────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ══════════════════════════════════════════════════════════════
   LOGIN VIEW
   ══════════════════════════════════════════════════════════════ */
.login-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
  position: relative;
  z-index: 1;
}

.login-backdrop {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 100% 80% at 30% 0%, rgba(6,214,160,0.08) 0%, transparent 50%),
    radial-gradient(ellipse 80% 100% at 70% 100%, rgba(124,58,237,0.08) 0%, transparent 50%);
  z-index: -1;
  animation: breathe 8s ease-in-out infinite alternate;
}

@keyframes breathe {
  0%   { opacity: 0.6; }
  100% { opacity: 1; }
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 3rem 2.5rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  position: relative;
  overflow: hidden;
  animation: cardEnter 0.7s var(--ease-out) both;
}

/* Gradient border glow along the top */
.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient);
  opacity: 0.8;
}

/* Inner glow */
.login-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 80px;
  background: var(--gradient);
  opacity: 0.04;
  filter: blur(40px);
  pointer-events: none;
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.96);
  }
}

.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.shield-icon {
  width: 64px;
  height: 64px;
  filter: drop-shadow(0 0 20px rgba(6,214,160,0.25));
  animation: shieldPulse 3s ease-in-out infinite;
}

@keyframes shieldPulse {
  0%, 100% { filter: drop-shadow(0 0 20px rgba(6,214,160,0.2)); }
  50%      { filter: drop-shadow(0 0 30px rgba(6,214,160,0.35)); }
}

.login-title {
  font-size: 1.625rem;
  font-weight: 700;
  text-align: center;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.login-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 400;
  margin-top: 0.25rem;
  margin-bottom: 2rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

/* ── Inputs ───────────────────────────────────────────────────── */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

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

.input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color var(--dur-normal) var(--ease-out);
  flex-shrink: 0;
}

.input-wrapper input {
  width: 100%;
  padding: 0.8125rem 1rem 0.8125rem 2.75rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9375rem;
  transition: all var(--dur-normal) var(--ease-out);
  outline: none;
}

.input-wrapper input::placeholder {
  color: var(--text-muted);
}

.input-wrapper input:hover {
  border-color: var(--border-hover);
  background: rgba(255,255,255,0.06);
}

.input-wrapper input:focus {
  border-color: var(--accent-start);
  background: rgba(6,214,160,0.04);
  box-shadow: 0 0 0 3px rgba(6,214,160,0.08);
}

.input-wrapper:has(input:focus) .input-icon {
  color: var(--accent-start);
}

.input-compact {
  flex: 1;
}

.input-compact input {
  padding-left: 1rem;
}

/* ── Login Error ──────────────────────────────────────────────── */
.login-error {
  min-height: 0;
  overflow: hidden;
  transition: all var(--dur-normal) var(--ease-out);
  font-size: 0.8125rem;
  color: var(--danger);
  text-align: center;
}

.login-error:empty {
  margin: 0;
  padding: 0;
}

.login-error:not(:empty) {
  padding: 0.625rem 1rem;
  background: var(--danger-soft);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(239,68,68,0.15);
  animation: shake 0.5s var(--ease-out);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-8px); }
  40%      { transform: translateX(8px); }
  60%      { transform: translateX(-5px); }
  80%      { transform: translateX(5px); }
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  user-select: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Primary (gradient) */
.btn-primary {
  background: var(--gradient);
  color: var(--text-inverse);
  box-shadow: 0 4px 16px rgba(6,214,160,0.2);
}

.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(6,214,160,0.3);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

/* Accent (smaller, add buttons) */
.btn-accent {
  background: var(--gradient);
  color: var(--text-inverse);
  padding: 0.625rem 1.25rem;
  box-shadow: 0 2px 12px rgba(6,214,160,0.15);
}

.btn-accent:hover {
  box-shadow: 0 4px 20px rgba(6,214,160,0.25);
  transform: translateY(-1px);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

/* Danger */
.btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 4px 16px rgba(239,68,68,0.25);
}

.btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 6px 24px rgba(239,68,68,0.35);
  transform: translateY(-1px);
}

/* Icon-only delete button */
.btn-icon {
  background: transparent;
  border: none;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--dur-normal) var(--ease-out);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.btn-icon svg {
  width: 16px;
  height: 16px;
}

.btn-full { width: 100%; }

/* ── Loading state ────────────────────────────────────────────── */
.btn.loading .btn-text { visibility: hidden; }
.btn.loading svg:not(.btn-loader-wrap) { visibility: hidden; }

.btn-loader {
  display: none;
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn.loading .btn-loader { display: block; }

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

/* ══════════════════════════════════════════════════════════════
   TOP BAR
   ══════════════════════════════════════════════════════════════ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 26, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-icon {
  width: 32px;
  height: 32px;
}

.topbar-title {
  font-size: 1.125rem;
  font-weight: 700;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.01em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.user-icon {
  width: 18px;
  height: 18px;
  color: var(--accent-start);
}

.user-email {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 500;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#logoutButton {
  padding: 0.5rem 1rem;
}

#logoutButton svg {
  width: 16px;
  height: 16px;
}

/* ══════════════════════════════════════════════════════════════
   DASHBOARD CONTENT
   ══════════════════════════════════════════════════════════════ */
.dashboard-view {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.dashboard-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 1.5rem;
  align-items: start;
}

/* ── Glass Card ───────────────────────────────────────────────── */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-md);
  overflow: hidden;
  position: relative;
  animation: cardSlideUp 0.6s var(--ease-out) both;
  transition: border-color var(--dur-normal) var(--ease-out),
              box-shadow var(--dur-normal) var(--ease-out);
}

.glass-card:hover {
  border-color: rgba(255,255,255,0.1);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

/* Gradient top accent line */
.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient);
  opacity: 0.6;
  transition: opacity var(--dur-normal) var(--ease-out);
}

.glass-card:hover::before {
  opacity: 1;
}

/* Staggered entrance */
.card-authorized { animation-delay: 0.05s; }
.card-alert      { animation-delay: 0.15s; }
.card-settings   { animation-delay: 0.25s; }

@keyframes cardSlideUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
}

/* ── Card Header ──────────────────────────────────────────────── */
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.5rem 1.5rem 0;
  gap: 1rem;
}

.card-header-text {
  flex: 1;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.card-icon {
  width: 22px;
  height: 22px;
  color: var(--accent-start);
  flex-shrink: 0;
}

.card-subtitle {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  line-height: 1.4;
}

/* ── Badge ────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 0.5rem;
  background: var(--success-soft);
  color: var(--success);
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid rgba(6,214,160,0.2);
  flex-shrink: 0;
}

.badge-alert {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: rgba(245,158,11,0.2);
}

/* ── Card Body ────────────────────────────────────────────────── */
.card-body {
  padding: 1rem 1.5rem;
}

/* ── Number List ──────────────────────────────────────────────── */
.number-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.number-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.875rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--dur-normal) var(--ease-out);
  animation: itemEnter 0.35s var(--ease-spring) both;
}

.number-item:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--border-hover);
}

@keyframes itemEnter {
  from {
    opacity: 0;
    transform: translateX(-12px) scale(0.97);
  }
}

.number-item .number-text {
  font-size: 0.9375rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  letter-spacing: 0.03em;
}

/* Item exit animation */
.number-item.removing {
  animation: itemExit 0.3s var(--ease-out) forwards;
}

@keyframes itemExit {
  to {
    opacity: 0;
    transform: translateX(12px) scale(0.95);
    height: 0;
    padding: 0 0.875rem;
    margin: 0;
    border-color: transparent;
  }
}

/* ── Empty State ──────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
  text-align: center;
}

.empty-icon {
  width: 40px;
  height: 40px;
  color: var(--text-muted);
  opacity: 0.5;
  margin-bottom: 0.75rem;
}

.empty-state p {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.empty-state span {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ── Card Footer / Add Form ───────────────────────────────────── */
.add-form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

/* ── Settings Form ────────────────────────────────────────────── */
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.settings-form .btn-primary {
  margin-top: 0.5rem;
}

/* ── Password Strength ────────────────────────────────────────── */
.password-strength {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.strength-bars {
  display: flex;
  gap: 4px;
  flex: 1;
}

.strength-bar {
  height: 3px;
  flex: 1;
  border-radius: 2px;
  background: var(--border);
  transition: background var(--dur-normal) var(--ease-out);
}

.strength-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Strength levels */
.strength-weak .strength-bar[data-index="0"] { background: var(--danger); }
.strength-weak .strength-label { color: var(--danger); }

.strength-fair .strength-bar[data-index="0"],
.strength-fair .strength-bar[data-index="1"] { background: var(--warning); }
.strength-fair .strength-label { color: var(--warning); }

.strength-good .strength-bar[data-index="0"],
.strength-good .strength-bar[data-index="1"],
.strength-good .strength-bar[data-index="2"] { background: var(--accent-mid); }
.strength-good .strength-label { color: var(--accent-mid); }

.strength-strong .strength-bar { background: var(--success); }
.strength-strong .strength-label { color: var(--success); }

/* ── Password Requirements ────────────────────────────────────── */
.password-requirements {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem 1rem;
}

.req {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding-left: 1.25rem;
  position: relative;
  transition: color var(--dur-normal) var(--ease-out);
}

.req::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--text-muted);
  transition: all var(--dur-normal) var(--ease-out);
}

.req.met {
  color: var(--success);
}

.req.met::before {
  border-color: var(--success);
  background: var(--success);
  box-shadow: 0 0 8px rgba(6,214,160,0.3);
}

/* Checkmark for met requirements */
.req.met::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 50%;
  transform: translateY(-60%) rotate(45deg);
  width: 4px;
  height: 7px;
  border-right: 1.5px solid var(--bg-primary);
  border-bottom: 1.5px solid var(--bg-primary);
}

/* ── Match Feedback ───────────────────────────────────────────── */
.match-feedback {
  font-size: 0.75rem;
  min-height: 1.125rem;
  transition: color var(--dur-normal) var(--ease-out);
}

.match-feedback.match    { color: var(--success); }
.match-feedback.mismatch { color: var(--danger); }

/* ══════════════════════════════════════════════════════════════
   PASSKEY — Login Flow
   ══════════════════════════════════════════════════════════════ */

/* Email-first login step */
.login-step {
  transition: opacity var(--dur-normal) var(--ease-out);
}

/* Password section — hidden by default in email-first flow */
.password-section {
  display: none;
  flex-direction: column;
  gap: 1rem;
  animation: passkeySectionIn 0.35s var(--ease-out) both;
}

.password-section.visible {
  display: flex;
}

/* Discoverable passkey — one-click login */
.discoverable-passkey-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.25rem;
  animation: passkeySectionIn 0.35s var(--ease-out) both;
}

.login-divider {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-subtle), transparent);
}

/* Passkey login section — hidden until passkey detected */
.passkey-login-section {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  animation: passkeySectionIn 0.35s var(--ease-out) both;
}

.passkey-login-section.visible {
  display: flex;
}

@keyframes passkeySectionIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* "Use password instead" link */
.use-password-link {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
  cursor: pointer;
}

.use-password-link:hover {
  color: var(--accent-start);
  text-decoration: underline;
}

/* ── Passkey Button ──────────────────────────────────────────── */
.passkey-btn {
  background: linear-gradient(135deg, #06d6a0, #0891b2, #06b6d4);
  color: #fff;
  box-shadow: 0 4px 16px rgba(6, 214, 160, 0.2), 0 0 0 0 rgba(6, 214, 160, 0);
  position: relative;
  overflow: hidden;
}

.passkey-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent 60%);
  opacity: 0;
  transition: opacity var(--dur-normal) var(--ease-out);
}

.passkey-btn:hover {
  box-shadow: 0 6px 28px rgba(6, 214, 160, 0.35), 0 0 20px rgba(8, 145, 178, 0.15);
  transform: translateY(-1px);
}

.passkey-btn:hover::after {
  opacity: 1;
}

.passkey-btn:active {
  transform: translateY(0) scale(0.98);
}

.passkey-btn-icon {
  font-size: 1.125rem;
  line-height: 1;
  filter: brightness(1.2);
}

/* ══════════════════════════════════════════════════════════════
   PASSKEY — Settings Section
   ══════════════════════════════════════════════════════════════ */
.passkey-section {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  position: relative;
}

/* Subtle gradient accent on top border */
.passkey-section::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 1.5rem;
  right: 1.5rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(6, 214, 160, 0.3), rgba(8, 145, 178, 0.3), transparent);
}

.passkey-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.625rem;
  gap: 0.75rem;
}

.passkey-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.passkey-section-title h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
}

.passkey-section-icon {
  font-size: 1.125rem;
  line-height: 1;
}

.passkey-description {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.passkey-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.passkey-actions .btn {
  flex: 1;
  min-width: 140px;
}

/* ── Passkey Status Badge ────────────────────────────────────── */
.passkey-status {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 999px;
  white-space: nowrap;
  transition: all var(--dur-normal) var(--ease-out);
}

.passkey-status.not-registered {
  background: rgba(74, 85, 120, 0.2);
  color: var(--text-muted);
  border: 1px solid rgba(74, 85, 120, 0.25);
}

.passkey-status.registered {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid rgba(6, 214, 160, 0.25);
  box-shadow: 0 0 12px rgba(6, 214, 160, 0.1);
}

/* ══════════════════════════════════════════════════════════════
   CONFIRM DIALOG
   ══════════════════════════════════════════════════════════════ */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: overlayIn 0.2s var(--ease-out);
  padding: 1.5rem;
}

.confirm-overlay.hidden {
  display: none !important;
}

@keyframes overlayIn {
  from { opacity: 0; }
}

.confirm-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: confirmEnter 0.3s var(--ease-spring);
}

@keyframes confirmEnter {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(10px);
  }
}

.confirm-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--danger-soft);
  margin-bottom: 1rem;
}

.confirm-icon {
  width: 24px;
  height: 24px;
  color: var(--danger);
}

.confirm-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.confirm-message {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.confirm-actions .btn {
  flex: 1;
}

/* ══════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ══════════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
  pointer-events: none;
  max-width: 380px;
  width: 100%;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  animation: toastIn 0.4s var(--ease-spring);
  position: relative;
  overflow: hidden;
}

.toast::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
}

.toast-success::before { background: var(--success); }
.toast-error::before   { background: var(--danger); }

.toast.dismissing {
  animation: toastOut 0.3s var(--ease-out) forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(24px) scale(0.95);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateX(24px) scale(0.95);
  }
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon   { color: var(--danger); }

.toast-body {
  flex: 1;
}

.toast-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.125rem;
}

.toast-message {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Toast timer bar */
.toast-timer {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  border-radius: 0 1px 0 0;
  animation: timerShrink 3s linear forwards;
}

.toast-success .toast-timer { background: var(--success); }
.toast-error .toast-timer   { background: var(--danger); }

@keyframes timerShrink {
  from { width: 100%; }
  to   { width: 0%; }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .login-card {
    padding: 2rem 1.5rem;
  }

  .topbar-inner {
    padding: 0 1rem;
    height: 56px;
  }

  .topbar-user {
    display: none;
  }

  .topbar-title {
    font-size: 1rem;
  }

  .dashboard-content {
    padding: 1rem;
  }

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

  .card-header {
    padding: 1.25rem 1.25rem 0;
  }

  .card-body {
    padding: 0.875rem 1.25rem;
  }

  .add-form {
    padding: 0.875rem 1.25rem;
    flex-wrap: wrap;
  }

  .add-form .input-compact {
    flex: 1 1 100%;
  }

  .add-form .btn-accent {
    flex: 1;
  }

  .password-requirements {
    grid-template-columns: 1fr;
  }

  .passkey-section {
    padding: 1.25rem;
  }

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

  .passkey-actions .btn {
    min-width: auto;
  }

  .toast-container {
    right: 0.75rem;
    left: 0.75rem;
    bottom: 0.75rem;
    max-width: 100%;
  }

  .confirm-card {
    padding: 1.5rem;
  }
}

@media (max-width: 420px) {
  .shield-icon {
    width: 48px;
    height: 48px;
  }

  .login-title {
    font-size: 1.375rem;
  }
}

/* ══════════════════════════════════════════════════════════════
   FOCUS VISIBLE (keyboard navigation)
   ══════════════════════════════════════════════════════════════ */
:focus-visible {
  outline: 2px solid var(--accent-start);
  outline-offset: 2px;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent-start);
  outline-offset: 2px;
}

/* Remove outline for mouse clicks */
:focus:not(:focus-visible) {
  outline: none;
}
