:root {
  /* Premium Dark Mode (Midnight) */
  --bg: #0b0f19;
  --panel: rgba(17, 21, 28, 0.6);
  --surface: rgba(26, 31, 41, 0.8);
  --card: rgba(255, 255, 255, 0.03);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --line: rgba(255, 255, 255, 0.08);
  
  /* Deep Electric Blue */
  --primary: #4f46e5;
  --primary-deep: #4338ca;
  --warm: #10b981;
  
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.6);
  
  --font-sans: "Inter", "Space Grotesk", sans-serif;
  --font-serif: "Playfair Display", "Instrument Serif", serif;
  --font-display: "Playfair Display", serif;
  
  --radius-md: 14px;
  --radius-lg: 20px;
  
  transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dim-mode {
  /* Security Dim Mode: Deep Navy & Space Blue */
  --bg: #0f172a;
  --panel: rgba(30, 41, 59, 0.7);
  --surface: #1e293b;
  --card: rgba(255, 255, 255, 0.02);
  --text: #cbd5e1; /* Slate 300 */
  --muted: #64748b;
  --line: rgba(59, 130, 246, 0.1);
  --shadow: 0 0 15px rgba(59, 130, 246, 0.3);
  --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.4);
  --primary: #3b82f6;
  --primary-deep: #2563eb;
}

body.dim-mode h1, 
body.dim-mode h2, 
body.dim-mode h3, 
body.dim-mode .section-title {
  color: #ffffff !important;
}


* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  position: relative;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

main.landing-shell {
  background: radial-gradient(circle at top left, rgba(56, 139, 253, 0.08), transparent 18%),
    radial-gradient(circle at bottom right, rgba(88, 166, 255, 0.06), transparent 18%),
    #0d1117 !important;
  animation: none !important;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(29, 29, 26, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 29, 26, 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at center, black 45%, transparent 100%);
  display: none;
}

a {
  color: inherit;
}

.auth-shell,
.app-shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3rem 0 4rem;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Custom Modal System */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 11000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  width: min(90%, 420px);
  padding: 2rem;
  transform: scale(0.9) translateY(20px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-lg);
}


.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.modal-body {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.modal-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.modal-btn-confirm {
  background: var(--primary);
  color: white;
}

.modal-btn-confirm:hover {
  background: #ff7b72;
  transform: translateY(-2px);
}

.modal-btn-cancel {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.modal-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

/* Mobile top bar for auth pages */
.auth-topbar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  padding: 0.85rem 1.25rem;
  background: rgba(13, 17, 23, 0.95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.auth-home-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.auth-home-link:hover {
  color: var(--primary);
}

.landing-hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.25rem;
  align-items: stretch;
  min-height: calc(100vh - 7rem);
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgba(22, 27, 34, 0.96);
  border: 1px solid rgba(110, 118, 129, 0.25);
  border-radius: 32px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 2.5rem;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow);
}

.landing-copy h1,
.section-title {
  margin: 0;
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  letter-spacing: -0.04em;
}

.landing-copy h1 {
  max-width: 8ch;
  font-size: clamp(3.4rem, 8vw, 6rem);
  line-height: 0.9;
}

.landing-copy h1 span {
  display: block;
}

.eyebrow {
  margin: 0 0 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  color: var(--muted);
}

.lead,
.section-copy,
.feature-list p,
.page-message,
.empty-state p,
.meta-row,
.note-text,
.auth-link-row {
  color: var(--muted);
}

.lead,
.section-copy {
  max-width: 42rem;
  margin: 1.35rem 0 0;
  line-height: 1.75;
  font-size: 1rem;
}

.landing-actions,
.topbar-actions,
.form-actions,
.card-actions,
.admin-stats {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  flex-wrap: wrap;
}

.landing-actions {
  margin-top: 1.75rem;
}

.landing-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.landing-links a {
  color: var(--primary);
  text-decoration: none;
}

.landing-links a:hover {
  text-decoration: underline;
}

.panel,
.metric-card,
.entry-card,
.admin-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}


.panel,
.entry-card,
.admin-card {
  padding: 2rem;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.panel-heading > div {
  flex: 1;
}

.panel-heading h2 {
  margin-bottom: 0.35rem;
  font-size: 1.2rem;
}

.feature-list article {
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(29, 29, 26, 0.08);
}

.feature-list article:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.feature-list h2,
.panel-heading h2,
.empty-state h3,
.username-text {
  margin: 0;
  font-size: 1.18rem;
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.feature-list p,
.panel-heading p,
.empty-state p,
.auth-link-row {
  margin: 0.4rem 0 0;
  line-height: 1.6;
}

.auth-panel {
  max-width: 540px;
  margin: 6vh auto 0;
}

.stack-form,
.vault-form {
  display: grid;
  gap: 1.25rem;
  margin-top: 1rem;
}

.vault-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wide,
.form-actions {
  grid-column: 1 / -1;
}

/* ── Vault label style ── */
.vault-label {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.vault-label-text {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.55rem;
  font-family: var(--font-sans);
}

/* ── Vault input style ── */
.vault-input {
  background: rgba(10, 10, 20, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.vault-input:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
  background: rgba(79, 70, 229, 0.05);
}

.vault-input::placeholder {
  color: rgba(148, 163, 184, 0.5);
}

/* ── Password field with eye toggle ── */
.password-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field-wrap input {
  padding-right: 3rem;
}

.eye-toggle {
  position: absolute;
  right: 0.85rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  padding: 0;
  transition: color 0.2s;
  z-index: 2;
}

.eye-toggle:hover {
  color: var(--text);
}

/* ── Password strength meter ── */
.pwd-strength-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.6rem;
}

.pwd-strength-track {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.pwd-strength-bar {
  height: 100%;
  border-radius: 999px;
  width: 0%;
  transition: width 0.3s ease, background 0.3s ease;
  background: #ef4444;
}

.pwd-strength-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  min-width: 44px;
  text-align: right;
  transition: color 0.3s;
}

/* ── Vault save button ── */
.vault-save-btn {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.8rem 1.75rem;
  border-radius: 12px;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.35);
}

.vault-save-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.5);
}

.vault-save-btn:active {
  transform: translateY(0);
}

.button.small {
  padding: 0.7rem 1.25rem;
  font-size: 0.88rem;
  border-radius: 10px;
}

label span,
.limit-field span {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.92rem;
}

input,
.button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.95rem 1rem;
  background: var(--surface);
  color: var(--text);
  transition: all 0.3s ease;
  font-family: inherit;
  font-size: inherit;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

input:focus,
textarea:focus {
  outline: none;
  background: var(--panel);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

textarea::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

textarea:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: none;
  border-radius: 999px;
  padding: 0.9rem 1.25rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  font-weight: 550;
  letter-spacing: 0.02em;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.button:active {
  transform: translateY(0);
}

.button.loading {
  pointer-events: none;
  opacity: 0.8;
}

.button.loading::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 50%;
  top: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.button.loading.primary::before {
  border: 2px solid rgba(231, 60, 126, 0.3);
  border-top-color: rgba(231, 60, 126, 0.8);
}

.primary {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.primary:hover {
  background: var(--primary-deep);
  color: #fff;
  box-shadow: 0 12px 32px rgba(20, 33, 61, 0.35);
}

.ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
}

.ghost:hover {
  background: var(--line);
  border-color: var(--primary);
  color: var(--text);
}


.full-width {
  width: 100%;
}

.page-message {
  min-height: 1.4rem;
  margin: 1rem 0 0;
}

.auth-link-row a {
  color: var(--primary);
}

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

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
}

.checkbox-label input {
  width: auto;
  margin-top: 0.2rem;
  cursor: pointer;
}

.checkbox-label span {
  margin-bottom: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.checkbox-label a {
  color: var(--primary);
  text-decoration: underline;
}

/* ============================
   Responsive — Mobile-First
=============================== */

@media (max-width: 860px) {
  .landing-hero,
  .vault-form {
    grid-template-columns: 1fr;
  }

  .landing-shell,
  .auth-shell,
  .app-shell {
    width: min(100% - 1rem, 1120px);
  }
}

/* Dashboard — tablet layout */
@media (max-width: 860px) {
  .metrics-grid,
  .card-list {
    grid-template-columns: 1fr;
  }

  .admin-shell {
    grid-template-columns: 1fr;
    width: min(100% - 1rem, 1320px);
    padding-top: 1rem;
  }

  .admin-sidebar {
    position: static;
    min-height: auto;
  }

  .app-topbar,
  .search-row,
  .card-top,
  .meta-row,
  .admin-card {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Mobile — small phones */
@media (max-width: 480px) {
  /* Show mobile nav bar on auth pages */
  .auth-topbar {
    display: block;
  }

  /* Base spacing — push content below the fixed auth-topbar */
  .auth-shell {
    padding: 5rem 0 2rem;
    align-items: flex-start;
    min-height: 100vh;
  }

  .auth-panel.panel {
    border-radius: 16px;
    padding: 1.5rem 1.25rem;
    max-width: 100%;
    margin-top: 0;
  }

  /* Forms */
  .stack-form {
    gap: 0.85rem;
  }

  input,
  textarea {
    padding: 0.85rem 0.9rem;
    font-size: 0.95rem;
    border-radius: 12px;
  }

  .button {
    padding: 0.85rem 1.1rem;
    font-size: 0.95rem;
  }

  .button.full-width {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  /* Dashboard navigation sidebar becomes a horizontal scrolling strip */
  .admin-nav {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    gap: 0.35rem;
    padding: 0.6rem;
    border-radius: 12px;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .admin-nav::-webkit-scrollbar {
    display: none;
  }

  .admin-nav-link {
    flex-shrink: 0;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    border-radius: 8px;
  }

  .admin-brand {
    padding-bottom: 0.75rem;
  }

  .admin-brand h1 {
    font-size: 1.35rem;
  }

  /* Cards */
  .entry-card,
  .admin-card {
    padding: 1rem;
    border-radius: 12px;
  }

  .card-actions {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .card-actions .button {
    flex: 1 1 auto;
    font-size: 0.8rem;
    padding: 0.6rem 0.75rem;
  }

  .panel {
    padding: 1rem;
    border-radius: 12px;
  }

  .panel-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
  }

  .panel-heading h2 {
    font-size: 1.05rem;
  }

  .metrics-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    margin: 0.75rem 0;
  }

  .metric-card {
    padding: 0.85rem 0.6rem;
    border-radius: 10px;
    text-align: center;
  }

  .metric-card span {
    font-size: 1.5rem;
  }

  .metric-card p {
    font-size: 0.75rem;
  }

  /* Trash confirm popup */
  #emptyTrashConfirm {
    width: calc(100vw - 2rem) !important;
    right: -4rem !important;
    left: auto !important;
    position: fixed !important;
    top: auto !important;
    bottom: 1rem !important;
    border-radius: 16px;
    padding: 1.25rem !important;
  }

  /* Search bar */
  .search-wrap {
    width: 100%;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  /* FAQ accordion */
  .faq-list {
    gap: 0.75rem !important;
  }

  .faq-item summary {
    font-size: 0.95rem !important;
    padding: 0.85rem 1rem !important;
  }

  /* Settings danger zone */
  #settings > div {
    padding: 1rem !important;
  }

  /* Empty state */
  .empty-state {
    padding: 1.5rem;
    border-radius: 14px;
  }

  /* Page message */
  .page-message {
    font-size: 0.875rem;
  }

  /* Auth links */
  .auth-link-row {
    font-size: 0.875rem;
    text-align: center;
  }

  /* Section title */
  .section-title {
    font-size: 1.6rem;
  }
}

/* Custom Notification (Toast) */
#toastContainer {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 12000;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  pointer-events: none;
}

.toast {
  background: #161b22;
  border: 1px solid var(--line);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  color: var(--text);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transform: translateY(100%);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: auto;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.error { border-left: 4px solid #ff5f56; }
.toast.success { border-left: 4px solid #3fb950; }
.toast.info { border-left: 4px solid var(--primary); }

/* Custom Modal System */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 11000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: #161b22;
  border: 1px solid var(--line);
  border-radius: 16px;
  width: min(90%, 420px);
  padding: 2rem;
  transform: scale(0.9) translateY(20px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.modal-body {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.modal-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.modal-btn-confirm {
  background: var(--primary);
  color: white;
}

.modal-btn-confirm:hover {
  background: #ff7b72;
  transform: translateY(-2px);
}

.modal-btn-cancel {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.modal-btn-cancel:hover {
  background: var(--surface);
  color: var(--text);
}


/* Theme Toggle Styling */
.theme-switch-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.theme-switch-wrapper {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.theme-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #1a1a2e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: .4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 3px;
  background-color: white;
  transition: .4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .slider {
  background-color: #1e293b;
  border-color: rgba(59, 130, 246, 0.5);
}

input:checked + .slider:before {
  transform: translateX(24px);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.8);
}

/* Pulsing Shield Animation */
@keyframes shieldPulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

.icon-pulse {
  animation: shieldPulse 2s infinite ease-in-out;
}

/* Badge Styling */
.active-badge {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: 0.5rem;
  display: none;
  vertical-align: middle;
}

body.dim-mode .active-badge {
  display: inline-block;
}

/* Expiry Lock Styling */
.lock-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lock-content {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 3.5rem 2.5rem;
  border-radius: 32px;
  max-width: 480px;
  text-align: center;
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.5);
  animation: lockScale 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.lock-icon {
  width: 64px;
  height: 64px;
  background: rgba(255, 95, 86, 0.1);
  color: #ff5f56;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.lock-icon svg {
  width: 32px;
  height: 32px;
}

.lock-content h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.lock-content p {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 2.5rem;
}

.lock-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* Blur main content when locked */
body.vault-locked .admin-shell {
  filter: blur(10px);
  pointer-events: none;
}

/* Partial lockdown for expired plans */
body.plan-expired-locked #add-secret,
body.plan-expired-locked #your-secrets,
body.plan-expired-locked #trash {
  position: relative;
}

body.plan-expired-locked #add-secret > *:not(.section-lock-overlay),
body.plan-expired-locked #your-secrets > *:not(.section-lock-overlay),
body.plan-expired-locked #trash > *:not(.section-lock-overlay) {
  filter: blur(6px);
  pointer-events: none;
  user-select: none;
  opacity: 0.4;
  transition: all 0.3s ease;
}

.section-lock-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--panel);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 1.5rem 2.5rem;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6), inset 0 0 20px rgba(239, 68, 68, 0.05);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease;
  width: 80%;
  max-width: 320px;
}

body.plan-expired-locked .section-lock-overlay {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.section-lock-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #f87171;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.section-lock-copy {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

/* ============================
   Auth Responsive Rebuild
   Login, signup, forgot password, reset password
=============================== */
.auth-shell {
  width: min(100% - clamp(1rem, 5vw, 2rem), 1120px);
  min-height: 100dvh;
  padding: clamp(1.25rem, 5vh, 3rem) 0 clamp(1.5rem, 6vh, 4rem);
}

.auth-panel {
  width: min(100%, 440px);
  max-width: 440px;
  min-width: 0;
  padding: clamp(1.35rem, 4vw, 2.5rem);
  border-radius: clamp(18px, 4vw, 32px);
}

.auth-panel .panel-heading {
  gap: 0.35rem;
  margin-bottom: clamp(1rem, 3vw, 1.35rem);
}

.auth-panel .section-title {
  font-size: clamp(1.8rem, 8vw, 2.55rem);
  line-height: 0.98;
  overflow-wrap: anywhere;
}

.auth-panel .section-copy {
  max-width: 100%;
  margin-top: 0.75rem;
  font-size: clamp(0.88rem, 2.5vw, 1rem);
  line-height: 1.6;
}

.auth-panel .stack-form,
.auth-panel #loginCredentials {
  width: 100%;
  min-width: 0;
}

.stack-form label,
.password-field-wrap,
.checkbox-label,
.auth-link-row,
.page-message {
  min-width: 0;
  max-width: 100%;
}

.stack-form label span,
.checkbox-label span,
.auth-link-row,
.page-message {
  overflow-wrap: anywhere;
}

.password-field-wrap input {
  min-width: 0;
  padding-right: 3rem;
}

.eye-toggle {
  flex: 0 0 auto;
}

.checkbox-label {
  align-items: flex-start;
  line-height: 1.45;
}

.checkbox-label input {
  flex: 0 0 auto;
  margin-top: 0.2rem;
}

.auth-link-row {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  text-align: center;
}

.auth-panel > div[style*="border-top"] {
  margin-top: clamp(1.25rem, 4vw, 2rem) !important;
  padding-top: clamp(1rem, 3vw, 1.5rem) !important;
}

@media (max-width: 720px) {
  .auth-topbar {
    display: block;
  }

  .auth-shell {
    align-items: flex-start;
    width: min(100% - 1rem, 1120px);
    padding-top: calc(4.5rem + env(safe-area-inset-top, 0px));
  }

  .auth-panel.panel {
    margin-inline: auto;
  }
}

@media (max-width: 420px) {
  .auth-topbar {
    padding: 0.75rem 0.85rem;
  }

  .auth-home-link {
    font-size: 0.9rem;
  }

  .auth-panel.panel {
    padding: 1.15rem;
    border-radius: 16px;
  }

  .auth-panel .panel-heading {
    margin-bottom: 0.9rem;
  }

  .auth-panel .section-title {
    font-size: clamp(1.65rem, 10vw, 2rem);
  }

  .stack-form {
    gap: 0.75rem;
  }

  .stack-form label > span {
    font-size: 0.82rem;
  }

  input,
  textarea,
  .password-field-wrap input {
    min-height: 46px;
    padding: 0.78rem 0.85rem;
    font-size: 0.94rem;
  }

  .password-field-wrap input {
    padding-right: 2.75rem;
  }

  .eye-toggle {
    width: 42px;
    height: 42px;
  }

  .button.full-width {
    min-height: 48px;
  }

  .pwd-strength-wrap {
    margin-top: 0.55rem;
  }
}

@media (max-height: 680px) and (min-width: 721px) {
  .auth-shell {
    align-items: flex-start;
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  .auth-panel {
    padding-block: 1.35rem;
  }
}
