/* ===== RESET & ROOT ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0b0c10;
  --bg-alpha: #0b0c10cc;
  --surface: #13141a;
  --card: #1a1c24;
  --card-hover: #1f2130;
  --border: #2a2d3a;
  --border-glow: #9333ea55;
  --primary: #9333ea;
  --primary-dim: #9333ea22;
  --primary-glow: #9333eaaa;
  --primary-hover: #7e22ce;
  --accent: #c026d3;
  --text: #e8eaf0;
  --text-muted: #7c7f94;
  --text-dim: #4a4d5e;
  --green: #22c55e;
  --green-dim: #22c55e22;
  --orange: #f97316;
  --yellow: #eab308;
  --red: #ef4444;
  --red-dim: #ef444422;
  --red-faint: #ef444408;
  --white: #ffffff;
  --white-dim: #ffffff44;
  --overlay: #00000099;
  --radius: 14px;
  --radius-sm: 8px;
  --font-body: 'Cairo', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --shadow: 0 8px 32px #00000066;
  --shadow-glow: 0 0 40px #9333ea33;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.light-theme {
  --bg: #f8fafc;
  --bg-alpha: #f8fafccc;
  --surface: #ffffff;
  --card: #ffffff;
  --card-hover: #f1f5f9;
  --border: #e2e8f0;
  --border-glow: #9333ea22;
  --primary: #9333ea;
  --primary-dim: #9333ea11;
  --primary-glow: #9333ea66;
  --primary-hover: #7e22ce;
  --accent: #9333ea;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --green: #16a34a;
  --green-dim: #16a34a22;
  --orange: #ea580c;
  --yellow: #ca8a04;
  --red: #dc2626;
  --red-dim: #dc262622;
  --red-faint: #dc262608;
  --white: #ffffff;
  --white-dim: #ffffff88;
  --overlay: #00000066;
  --shadow: 0 4px 12px #0000000a, 0 1px 4px #00000005;
  --shadow-glow: 0 0 40px #9333ea1a;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ===== PAGES ===== */
.page {
  display: none;
  min-height: 100dvh;
  flex-direction: column;
}

.page.active {
  display: flex;
}

/* ===== HEADER ===== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-alpha);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.5px;
}

.logo img {
  height: 54px;
  width: auto;
  object-fit: contain;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 0 0 0 var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 0 24px var(--primary-glow);
  transform: translateY(-1px);
}

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

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-dim);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 0.4rem;
}

.btn-ghost:hover {
  color: var(--primary);
  background: var(--primary-dim);
  border-radius: 6px;
}

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid var(--red-dim);
}

.btn-danger:hover {
  background: var(--red);
  color: var(--white);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-icon {
  padding: 0.4rem;
  border-radius: 6px;
}

.theme-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.theme-toggle:hover {
  background: var(--card-hover);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

.theme-toggle .sun-icon {
  display: none;
}

.theme-toggle .moon-icon {
  display: block;
}

.light-theme .theme-toggle .sun-icon {
  display: block;
}

.light-theme .theme-toggle .moon-icon {
  display: none;
}

body {
  transition: background-color 0.4s ease, color 0.4s ease;
  background-color: var(--bg);
  color: var(--text);
}

.card,
.auth-card,
.modal,
header,
.settings-section {
  transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

/* ===== HOME PAGE ===== */
#page-home {
  position: relative;
  overflow: hidden;
}

/* ===== BACKGROUND ORBS ===== */
.orb-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
  animation: drift 20s ease-in-out infinite;
}

.orb-primary {
  width: 500px;
  height: 500px;
  background: var(--primary);
  top: -100px;
  left: -100px;
}

.orb-accent {
  width: 400px;
  height: 400px;
  background: var(--accent);
  bottom: 10%;
  right: -100px;
  animation-delay: -5s;
}

.orb-tertiary {
  width: 300px;
  height: 300px;
  background: #a855f7;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -10s;
  opacity: 0.1;
}

@keyframes drift {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(30px, 50px) scale(1.1);
  }

  66% {
    transform: translate(-20px, 20px) scale(0.9);
  }
}


.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem 2rem;
}

.badge-pill {
  display: inline-block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.35rem 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  cursor: pointer;
  transition: border-color 0.2s;
}

.badge-pill:hover {
  border-color: var(--primary);
}

.badge-pill span {
  color: var(--primary);
  font-weight: 700;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1.2;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  max-width: 520px;
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  line-height: 1.8;
  z-index: 1;
}

/* ===== HERO VISUAL (MOCKUP) ===== */
.hero-visual {
  margin-top: 5rem;
  width: 100%;
  max-width: 900px;
  padding: 0 1.5rem;
  perspective: 1000px;
  z-index: 1;
}

.mockup-container {
  position: relative;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.5);
  transform: rotateX(5deg);
  transition: transform 0.5s ease;
}

.mockup-container:hover {
  transform: rotateX(0deg) translateY(-5px);
}

.mockup-window {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

@media (max-width: 640px) {
  .mockup-window {
    max-width: 280px;
    margin: 0 auto;
    border-radius: 24px;
    border-width: 4px;
  }
}

.mockup-header {
  height: 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
}

.mockup-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary-dim);
}

.mockup-user-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-inline-end: 8px;
  text-align: end;
}

@media (max-width: 768px) {
  .mockup-user-info {
    display: none;
  }
}

.mockup-line-sm {
  width: 30px;
  height: 4px;
  background: var(--text-dim);
  border-radius: 2px;
}

.mockup-line-xs {
  width: 20px;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
}

.mockup-btn-sq {
  width: 18px;
  height: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.m-spacer {
  margin-inline-start: auto;
}



.mockup-logo-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mockup-logo-wrap img {
  height: 22px;
  width: auto;
  filter: brightness(1.2);
}

.mockup-search {
  height: 12px;
  width: 100px;
  background: var(--border);
  border-radius: 100px;
}

.mockup-body {
  display: flex;
  height: 320px;
  padding: 15px;
  overflow: hidden;
}

.mockup-sidebar {
  width: 60px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mockup-item {
  height: 10px;
  width: 100%;
  background: var(--border);
  border-radius: 2px;
}

.mockup-item.active {
  background: var(--primary-dim);
  border: 1px solid var(--primary);
}

.mockup-content {
  flex: 1;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overflow-y: hidden;
}

.m-mobile-view {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.m-int-header {
  text-align: start;
  flex: 1;
}

.m-title {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1.2;
}

.m-subtitle {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.m-search-full {
  width: 120px;
  height: 26px;
  background: var(--card-hover);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.m-btn-add-full {
  width: auto;
  min-width: 90px;
  padding: 0 10px;
  height: 26px;
  background: var(--primary);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .mockup-body {
    flex-direction: column !important;
    height: auto !important;
    padding: 10px !important;
    padding-top: 0 !important;
    min-height: 580px !important;
    gap: 0.25rem !important;
  }

  .mockup-content {
    padding: 10px !important;
    padding-top: 0 !important;
    align-items: stretch !important;
  }

  .m-mobile-view {
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
    margin-top: -5px !important;
  }

  .m-title {
    font-size: 1.5rem;
  }

  .m-subtitle {
    font-size: 0.7rem;
  }

  .m-search-full {
    width: 100%;
    height: 38px;
    border-radius: 8px;
  }

  .m-btn-add-full {
    width: 100%;
    height: 42px;
    border-radius: 8px;
    font-size: 0.85rem;
  }

  .m-badge-row {
    display: none;
  }

  .m-int-grid {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 15px;
  }

  .m-int-card {
    width: 100% !important;
    min-height: 60px;
  }
}

.m-search-box {
  width: 100px;
  height: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.m-badge-count {
  width: 60px;
  height: 18px;
  background: var(--card-hover);
  border: 1px solid var(--border);
  border-radius: 100px;
}

.m-int-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.m-int-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.m-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.m-card-logo {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  flex-shrink: 0;
}

.m-card-logo.steam {
  background: #1b2838;
}

.m-card-logo.ps5 {
  background: #000;
}

.m-card-logo.x-box {
  background: #107c10;
}

.m-card-logo.ubisoft {
  background: #000;
}

.m-card-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-inline-end: 8px;
  align-items: flex-end;
}

.m-card-text div:first-child {
  height: 6px;
  width: 40px;
  background: var(--text-dim);
  border-radius: 2px;
}

.m-card-text div:last-child {
  height: 4px;
  width: 25px;
  background: var(--border);
  border-radius: 2px;
}

.m-card-row {
  height: 20px;
  width: 100%;
  background: var(--surface);
  border-radius: 6px;
}


/* Floating Elements */
.floating-card {
  position: absolute;
  background: rgba(42, 45, 58, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  animation: float-ui 6s ease-in-out infinite;
  z-index: 2;
}

@keyframes float-ui {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-15px);
  }
}

.f-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.f-icon.youtube-icon-wrap {
  background: #fff;
}

.f-icon.ps-icon-wrap {
  background: #000;
}

.f-icon.google-icon-wrap {
  background: #fff;
}


.f-info {
  flex: 1;
}

.f-top {
  height: 8px;
  width: 60px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  margin-bottom: 4px;
}

.f-bot {
  height: 6px;
  width: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.card-1 {
  top: -20px;
  left: -30px;
  animation-delay: 0s;
}

.card-2 {
  bottom: 10px;
  right: -40px;
  width: 160px;
  animation-delay: -2s;
}

.card-3 {
  top: 110px;
  right: -20px;
  animation-delay: -4s;
}

@media (max-width: 768px) {
  .hero-visual {
    margin-top: 3rem;
  }

  .floating-card {
    display: flex !important;
    transform: scale(0.6);
  }

  .card-1 {
    left: -20px !important;
    top: -40px !important;
  }

  .card-2 {
    right: -20px !important;
    bottom: 30px !important;
  }

  .card-3 {
    right: -20px !important;
    top: 180px !important;
  }

  .mockup-body {
    height: 240px;
  }

  .mockup-content {
    grid-template-columns: 1fr;
  }
}


.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  max-width: 900px;
  width: 100%;
  margin: 3rem auto 2rem;
  padding: 0 1.5rem;
}

.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  text-align: center;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.feature-icon {
  width: 56px;
  height: 56px;
  background: var(--primary-dim);
  color: var(--primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.7;
}

footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ===== AUTH PAGES ===== */
.auth-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background: radial-gradient(ellipse 50% 50% at 50% 50%, #9333ea0e, transparent);
}

.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
}

.auth-card h2 {
  font-size: 1.5rem;
  font-weight: 900;
  text-align: center;
  margin-bottom: 0.4rem;
}

.auth-card .subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 0.75rem;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
}

input,
textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.8rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  outline: none;
  transition: all 0.2s ease;
}

input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-dim);
}

textarea {
  resize: none;
  min-height: 60px;
}

.input-wrap {
  position: relative;
}

.input-wrap input {
  padding-left: 2.5rem;
}

.input-wrap .eye-btn {
  position: absolute;
  left: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.25rem;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.input-wrap .eye-btn:hover {
  color: var(--primary);
}

.error-msg {
  font-size: 0.78rem;
  color: var(--red);
  margin-top: 0.25rem;
  display: none;
}

.error-msg.show {
  display: block;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem 0;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-switch {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.auth-switch a {
  color: var(--primary);
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* ===== VAULT PAGE ===== */
.vault-main {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.vault-top {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.vault-top h1 {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.vault-top p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.2rem;
}

.vault-controls {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.search-wrap {
  position: relative;
}

.search-wrap input {
  padding-right: 2.5rem;
  min-width: 240px;
}

.search-wrap .search-icon {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

/* ===== GRID ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1rem;
}

/* ===== PASSWORD CARD ===== */
.pass-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
  animation: fadeUp 0.35s ease both;
  position: relative;
  overflow: hidden;
}

.pass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: radial-gradient(circle at 80% 20%, #9333ea08, transparent 60%);
  pointer-events: none;
}

.pass-card:hover {
  border-color: var(--border-glow);
  box-shadow: 0 4px 24px #9333ea18;
  transform: translateY(-2px);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.card-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--primary-dim);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 900;
  flex-shrink: 0;
  text-transform: uppercase;
  overflow: hidden;
}

.card-icon-wrap img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 4px;
}

.card-info {
  flex: 1;
  margin-right: 0.75rem;
  min-width: 0;
}

.card-name {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-email {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.card-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.2s;
}

.pass-card:hover .card-actions {
  opacity: 1;
}

.pass-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
}

.pass-text {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 1px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.pass-btns {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.card-link {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-dim);
  text-decoration: none;
  width: fit-content;
  transition: color 0.2s;
  overflow: hidden;
  max-width: 100%;
}

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

.card-link span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 2px dashed var(--border);
  border-radius: 20px;
  padding: 5rem 2rem;
  gap: 1rem;
  animation: fadeUp 0.4s ease;
}

.empty-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--primary-dim);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.empty-state h3 {
  font-size: 1.2rem;
  font-weight: 800;
}

.empty-state p {
  color: var(--text-muted);
  max-width: 320px;
  font-size: 0.9rem;
}

/* ===== AVATAR / USER MENU ===== */
.user-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  background: var(--primary-dim);
  color: var(--primary);
  font-weight: 900;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s;
  position: relative;
}

.user-btn:hover {
  border-color: var(--primary);
}

.dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  min-width: 200px;
  box-shadow: var(--shadow);
  display: none;
  z-index: 200;
  animation: fadeDown 0.15s ease;
}

[dir="rtl"] .dropdown {
  right: auto;
  left: 0;
}

.dropdown.open {
  display: block;
}

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-header {
  padding: 0.5rem 0.75rem 0.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.dropdown-header .d-name {
  font-size: 0.9rem;
  font-weight: 700;
  text-align: start;
}

.dropdown-header .d-email {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: start;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.15s;
  color: var(--text);
  justify-content: flex-start;
}

.dropdown-item:hover {
  background: var(--surface);
  color: var(--primary);
}

.dropdown-item svg {
  flex-shrink: 0;
}

.user-wrap {
  position: relative;
}

.user-meta {
  text-align: end;
  display: none;
  margin-inline-end: 0.75rem;
}

@media (min-width: 640px) {
  .user-meta {
    display: block;
  }
}

.user-meta .u-name {
  font-size: 0.85rem;
  font-weight: 700;
  text-align: end;
}

.user-meta .u-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: end;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--overlay);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--shadow);
  animation: modalIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card-footer-link {
  margin-top: 0.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.card-footer-link a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  transition: color 0.2s;
  max-width: 100%;
}

.url-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.card-footer-link a:hover {
  color: var(--primary);
}

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

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
}

.modal-footer {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

/* ===== CONFIRM DIALOG ===== */
.confirm-modal {
  max-width: 380px;
}

.confirm-modal p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.5rem;
  line-height: 1.7;
}

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  pointer-events: none;
}

.toast {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.6rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  box-shadow: var(--shadow);
  animation: toastIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.toast.success {
  border-color: var(--green-dim);
}

.toast.error {
  border-color: var(--red-dim);
  color: var(--red);
}

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

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(-8px) scale(0.95);
  }
}

/* ===== PASSWORD STRENGTH ===== */
.strength-bar {
  height: 4px;
  border-radius: 2px;
  margin-top: 6px;
  background: var(--border);
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s, background 0.3s;
}

.strength-label {
  font-size: 0.75rem;
  margin-top: 4px;
}

/* ===== SPINNER ===== */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--white-dim);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: none;
}

.spinner.show {
  display: inline-block;
}

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

/* ===== SETTINGS PAGE ===== */
.settings-main {
  flex: 1;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.settings-main h1 {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 0.3rem;
}

.settings-main>p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.settings-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 1.25rem;
  animation: fadeUp 0.4s ease both;
}

.settings-section.danger-zone {
  border-color: var(--red-dim);
  background: var(--red-faint);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1.5rem;
}

.section-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.section-icon.purple {
  background: var(--primary-dim);
  color: var(--primary);
}

.section-icon.red {
  background: var(--red-dim);
  color: var(--red);
}

.section-header h2 {
  font-size: 1rem;
  font-weight: 800;
}

.section-header p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Avatar preview */
.avatar-area {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--primary-dim);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 900;
  flex-shrink: 0;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s;
}

.avatar-preview:hover {
  border-color: var(--primary);
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Icon upload in modal */
.icon-upload-area {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  border: 2px dashed var(--border);
  background: var(--surface);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.icon-upload-area:hover {
  border-color: var(--primary);
  background: var(--primary-dim);
}

.icon-upload-area img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.icon-remove-btn {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
  border: none;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.delete-confirm-input {
  margin-top: 0.75rem;
  border-color: var(--red-dim) !important;
}

.delete-confirm-input:focus {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 3px var(--red-dim) !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.5rem;
  }

  .features {
    grid-template-columns: 1fr;
  }

  .vault-top {
    flex-direction: column;
    align-items: stretch;
    gap: 1.5rem;
  }

  .vault-controls {
    display: grid;
    grid-template-columns: 1fr auto;
    width: 100%;
    gap: 0.5rem;
  }

  .search-wrap {
    flex: 1;
  }

  .search-wrap input {
    min-width: unset;
    width: 100%;
  }

  .card-actions {
    opacity: 1;
  }
}

@media (max-width: 640px) {
  header {
    padding: 0 1rem;
  }

  .user-meta {
    display: none !important;
  }

  .hero {
    padding: 3rem 1rem;
  }

  .vault-main {
    padding: 1.5rem 1rem;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .modal {
    padding: 1.25rem;
  }
}

@media (max-width: 480px) {
  header {
    padding: 0 1rem;
    flex-wrap: nowrap;
    justify-content: space-between !important;
  }

  header .logo img {
    height: 28px;
    width: auto;
  }

  header .btn-ghost,
  header .btn-primary {
    width: auto !important;
    font-size: 0.8rem !important;
    padding: 0.4rem 0.75rem !important;
    white-space: nowrap;
  }

  .auth-card {
    padding: 1.5rem 1.25rem;
    border: none;
    background: transparent;
    box-shadow: none;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .modal-footer .btn {
    width: 100%;
  }

  .auth-card .btn {
    width: 100%;
  }

  .vault-controls {
    grid-template-columns: 1fr;
  }

  .vault-controls .btn {
    width: 100%;
  }

  .modal-footer {
    flex-direction: column-reverse;
    gap: 0.75rem;
  }

  .modal {
    width: 90%;
    margin: 0 auto;
  }
}

/* ===== STATS BAR ===== */
.stats-bar {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.stat-pill {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-pill strong {
  color: var(--text);
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2rem;
  }

  .modal-footer .btn {
    width: 100%;
  }

  .auth-card .btn {
    width: 100%;
  }

  .vault-controls {
    grid-template-columns: 1fr;
  }

  .vault-controls .btn {
    width: 100%;
  }

  .modal-footer {
    flex-direction: column-reverse;
    gap: 0.75rem;
  }

  .modal {
    width: 90%;
    margin: 0 auto;
  }
}

/* ===== NEW MANUAL CIRCULAR CROPPER ===== */
.crop-viewport {
  width: 250px;
  height: 250px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  position: relative;
  overflow: hidden;
  margin: 1.5rem auto;
  background: var(--bg-dark);
  cursor: move;
  box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.6);
}

#crop-preview-img {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: center;
  user-select: none;
  pointer-events: none;
}

.crop-overlay-wrap {
  position: relative;
  width: 100%;
  height: 300px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #000;
}

.zoom-control {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.zoom-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
}

.zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
}

/* ===== TOASTS ===== */
#toasts {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 9999;
}

.toast {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 0.8rem 1.25rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  animation: toastIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.toast.success { border-inline-start: 4px solid var(--primary); }
.toast.error { border-inline-start: 4px solid #ff4b4b; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(-20px); }
}

@media (max-width: 640px) {
  #toasts {
    left: 1rem;
    right: 1rem;
    bottom: 1.5rem;
  }
}