/* ══════════════════════════════════════
   TOKENS
══════════════════════════════════════ */
:root {
  --bg: #080c0a;
  --bg-2: #0d1410;
  --surface: #141f17;
  --surface-2: #1a2b1e;
  --border: #1e3324;
  --border-hi: #2a4a32;
  --green: #00e676;
  --green-dim: #00b359;
  --green-glow: rgba(0, 230, 118, 0.18);
  --green-faint: rgba(0, 230, 118, 0.06);
  --red: #ff3d57;
  --amber: #ffb300;
  --text: #c8e6cc;
  --text-dim: #6a9970;
  --text-muted: #3a5e3f;
  --mono: 'Share Tech Mono', monospace;
  --ui: 'Rajdhani', sans-serif;
  --radius: 6px;
  --radius-lg: 10px;
  --transition: 0.2s ease;
  --nav-h: 64px;
}

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

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

body {
  font-family: var(--ui);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  letter-spacing: 0.02em;
}

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

input,
select {
  font-family: var(--mono);
}

::selection {
  background: var(--green-dim);
  color: #000;
}

.hidden {
  display: none !important;
}

/* ══════════════════════════════════════
   BACKGROUND
══════════════════════════════════════ */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 230, 118, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 230, 118, 0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: grid-drift 60s linear infinite;
}

@keyframes grid-drift {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 40px 40px;
  }
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0, 0, 0, 0.1) 3px,
    rgba(0, 0, 0, 0.1) 4px
  );
}

/* ══════════════════════════════════════
   SCROLLBAR
══════════════════════════════════════ */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

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

/* ══════════════════════════════════════
   UTILS
══════════════════════════════════════ */
.accent {
  color: var(--green);
}

.hex {
  color: var(--green);
  filter: drop-shadow(0 0 8px var(--green));
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

/* ══════════════════════════════════════
   FIELDS
══════════════════════════════════════ */
.field {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 13px 16px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  outline: none;
  -webkit-appearance: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

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

.field:focus {
  border-color: var(--green-dim);
  box-shadow: 0 0 0 3px var(--green-faint);
}

.field-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-bottom: 7px;
  letter-spacing: 0.1em;
}

.input-wrap {
  position: relative;
}

.input-wrap .field {
  padding-right: 48px;
}

.toggle-vis {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  opacity: 0.4;
  transition: opacity var(--transition);
  padding: 4px;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

.toggle-vis:active {
  opacity: 1;
}

/*Google styling*/
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 0.68rem;
}

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

.google-btn {
  display: flex;
  align-items: center;
  gap: 10px;
}


/* ══════════════════════════════════════
   BUTTONS
══════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn-primary {
  background: var(--green-dim);
  color: #000;
  border-color: var(--green);
}

.btn-primary:active {
  background: var(--green);
  box-shadow: 0 0 20px var(--green-glow);
}

.btn-bar {
  position: absolute;
  bottom: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: rgba(0, 0, 0, 0.2);
  animation: btn-scan 2.5s linear infinite;
}

@keyframes btn-scan {
  from {
    left: -100%;
  }
  to {
    left: 100%;
  }
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-hi);
  color: var(--text-dim);
}

.btn-ghost:active {
  border-color: var(--green-dim);
  color: var(--green);
}

.btn-full {
  width: 100%;
}

.icon-btn {
  color: var(--text-dim);
  font-size: 1.1rem;
  padding: 8px 10px;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.icon-btn:active {
  color: var(--green);
  background: var(--green-faint);
}

.icon-btn.danger:active {
  color: var(--red);
  background: rgba(255, 61, 87, 0.1);
}

/* ══════════════════════════════════════
   LOCK SCREEN
══════════════════════════════════════ */
#lock-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}

.lock-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 28px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 230, 118, 0.04);
  animation: slide-up 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.lock-logo {
  text-align: center;
  margin-bottom: 32px;
}

.lock-logo .hex {
  display: block;
  font-size: 2.6rem;
  margin-bottom: 12px;
}

.lock-logo h1 {
  font-family: var(--mono);
  font-size: 2rem;
  letter-spacing: 0.15em;
  color: var(--text);
  margin-bottom: 6px;
}

.lock-logo .tagline {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}

.lock-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lock-hint {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--text-muted);
  text-align: center;
  
}


.lock-hint a{
  color: var(--green);
}

.forget{
  text-decoration: underline;
}

.auth-toast {
  position: fixed;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--red);
  border-top: 3px solid var(--red);
  border-radius: var(--radius);
  padding: 12px 24px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--red);
  z-index: 400;
  transition: top 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  white-space: nowrap;
}

.auth-toast.show {
  top: 20px;
}

/* ══════════════════════════════════════
   APP SHELL — MOBILE FIRST
══════════════════════════════════════ */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  z-index: 2;
}

.main-content {
  flex: 1;
  padding: 20px 16px;
  padding-bottom: calc(var(--nav-h) + 16px);
  overflow-y: auto;
}

/* ══════════════════════════════════════
   BOTTOM NAV — mobile only
══════════════════════════════════════ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  z-index: 50;
}

.brand-mobile {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
}

.brand-mobile .hex {
  font-size: 1.1rem;
}

.brand-mobile .brand-text {
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--text);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 13px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.nav-item:active {
  color: var(--green);
  background: var(--green-faint);
  border-color: var(--border-hi);
}

.nav-item.active {
  color: var(--green);
  background: var(--green-faint);
  border-color: var(--green-dim);
}

.lock-out-btn {
  padding: 9px 12px;
  font-size: 0.7rem;
}

.sidebar {
  display: none;
}

/* ══════════════════════════════════════
   VIEWS
══════════════════════════════════════ */
.view {
  animation: fade-in 0.25s ease;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 10px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.view-title {
  font-family: var(--mono);
  font-size: 0.95rem;
  letter-spacing: 0.12em;
}

.record-badge {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 20px;
}

/* ══════════════════════════════════════
   SEARCH BAR
══════════════════════════════════════ */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 14px;
  margin-bottom: 16px;
}

.search-icon {
  color: var(--text-muted);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.search-field {
  border: none;
  background: transparent;
  padding: 10px 0;
  flex: 1;
  font-size: 0.88rem;
  color: var(--text);
  min-width: 0;
}

.search-field:focus {
  outline: none;
}

.search-field::placeholder {
  color: var(--text-muted);
}

.filter-select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 6px 8px;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  border-radius: var(--radius);
  outline: none;
  cursor: pointer;
  font-family: var(--mono);
  flex-shrink: 0;
  -webkit-appearance: none;
}

/* ══════════════════════════════════════
   PASSWORD LIST
══════════════════════════════════════ */
.password-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 0.82rem;
  gap: 10px;
  text-align: center;
}

.empty-icon {
  font-size: 2.6rem;
  color: var(--border-hi);
  animation: pulse 3s ease-in-out infinite;
}

.empty-sub {
  font-size: 0.68rem;
}

/* ══════════════════════════════════════
   PASSWORD CARD
══════════════════════════════════════ */
.pw-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  transition: border-color var(--transition);
}

.card-site-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border-hi);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--green);
  font-weight: 700;
  flex-shrink: 0;
  text-transform: uppercase;
}

.card-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.card-site {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-username {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.card-strength-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.card-strength-dot.strong {
  background: var(--green);
  box-shadow: 0 0 5px var(--green);
}

.card-strength-dot.medium {
  background: var(--amber);
  box-shadow: 0 0 5px var(--amber);
}

.card-strength-dot.weak {
  background: var(--red);
  box-shadow: 0 0 5px var(--red);
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.pw-card-details {
  display: none;
  width: 100%;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  gap: 8px;
  flex-direction: column;
}

.pw-card.expanded .pw-card-details {
  display: flex;
  
}

.pw-card {
  flex-wrap: wrap;
  cursor: pointer;
  
}

.detail-password {
  color: var(--green);
  word-break: break-all;
}

.detail-label {
  color: var(--text-muted);
  font-size: 0.62rem;
  margin-bottom: 2px;
}

.pw-card-details .input-wrap input{
  background: var(--surface);
  color: var(--green);
  border: none;
  outline: none;
}

/* ══════════════════════════════════════
   GENERATOR
══════════════════════════════════════ */
.generator-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 18px;
}

.gen-output-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-2);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 22px;
  min-height: 56px;
}

.gen-output {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--green);
  flex: 1;
  word-break: break-all;
  line-height: 1.5;
}

.gen-options {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.gen-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.range-slider {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  cursor: pointer;
}

.gen-checkboxes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  cursor: pointer;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.check-label input {
  accent-color: var(--green);
  width: 16px;
  height: 16px;
}

.check-label:has(input:checked) {
  border-color: var(--green-dim);
  background: var(--green-faint);
  color: var(--green);
}

/* ══════════════════════════════════════
   STRENGTH BAR
══════════════════════════════════════ */
.strength-bar-wrap {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 14px;
  overflow: hidden;
}

.strength-bar {
  height: 100%;
  width: 0%;
  transition: width 0.4s ease, background 0.4s ease;
  border-radius: 2px;
}

.strength-bar.weak {
  background: var(--red);
}

.strength-bar.medium {
  background: var(--amber);
}

.strength-bar.strong {
  background: var(--green);
}

.strength-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--text-muted);
  display: block;
  margin-top: 6px;
  letter-spacing: 0.08em;
}

/* ══════════════════════════════════════
   MODAL — slides up from bottom on mobile
══════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 -4px 40px rgba(0, 0, 0, 0.6);
  animation: modal-up 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes modal-up {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

.modal-header h3 {
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  color: var(--green);
}

.modal-close {
  color: var(--text-muted);
  font-size: 1.1rem;
  padding: 6px 10px;
  transition: color var(--transition);
}

.modal-close:active {
  color: var(--red);
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  background: var(--surface);
}

/* ══════════════════════════════════════
   TOAST
══════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 12px);
  left: 16px;
  right: 16px;
  z-index: 300;
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-left: 3px solid var(--green);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--text);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
  animation: slide-up 0.28s ease;
  text-align: center;
}

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

/* ══════════════════════════════════════
   DESKTOP — 768px and above
══════════════════════════════════════ */
@media (min-width: 768px) {

  #app {
    flex-direction: row;
    height: 100vh;
    height: 100dvh;
  }

  .sidebar {
    display: flex;
    flex-direction: column;
    width: 220px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 24px 0;
    height: 100vh;
    height: 100dvh;
    position: sticky;
    top: 0;
  }

  .bottom-nav {
    display: none;
  }

  .sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 22px;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-brand .hex {
    font-size: 1.3rem;
  }

  .brand-text {
    font-family: var(--mono);
    font-size: 0.95rem;
    letter-spacing: 0.12em;
    font-weight: 700;
    color: var(--text);
  }

  .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px 12px;
    flex: 1;
  }

  .nav-item {
    font-size: 0.76rem;
    padding: 10px 13px;
    width: 100%;
  }

  .nav-item:hover {
    color: var(--green);
    background: var(--green-faint);
    border-color: var(--border-hi);
  }

  .sidebar-stats {
    display: flex;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 14px;
  }

  .stat {
    flex: 1;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .stat + .stat {
    border-left: 1px solid var(--border);
  }

  .stat-val {
    font-family: var(--mono);
    font-size: 1.5rem;
    color: var(--green);
    line-height: 1;
  }

  .stat-label {
    font-family: var(--mono);
    font-size: 0.56rem;
    color: var(--text-muted);
    margin-top: 3px;
    letter-spacing: 0.1em;
  }

  .lock-out-btn {
    margin: 0 12px;
    font-size: 0.72rem;
  }

  .main-content {
    flex: 1;
    padding: 30px 32px;
    overflow-y: auto;
  }

  .modal-overlay {
    align-items: center;
    padding: 20px;
  }

  .modal {
    border-radius: var(--radius-lg);
    animation: slide-up 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .toast {
    bottom: 24px;
    left: auto;
    right: 24px;
    width: auto;
    max-width: 320px;
    text-align: left;
  }

  .card-actions {
    opacity: 1;
    transition: opacity var(--transition);
  }

  .pw-card:hover {
    border-color: var(--border-hi);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
  }

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

  .icon-btn:hover {
    color: var(--green);
    background: var(--green-faint);
  }

  .icon-btn.danger:hover {
    color: var(--red);
    background: rgba(255, 61, 87, 0.1);
  }

  .btn-primary:hover {
    background: var(--green);
    box-shadow: 0 0 20px var(--green-glow);
  }

  .btn-ghost:hover {
    border-color: var(--green-dim);
    color: var(--green);
  }

  .toggle-vis:hover {
    opacity: 1;
  }

  .generator-card {
    max-width: 560px;
    padding: 28px;
  }

}
