:root {
  --bg: #090909;
  --panel: #141414;
  --panel-2: #1b1b1b;
  --text: #f7f0df;
  --muted: #b8aa8c;
  --line: rgba(212, 175, 55, .22);
  --gold: #d4af37;
  --gold-2: #f2d675;
  --danger: #ff6b6b;
  --ok: #6ee7a8;
  --shadow: 0 24px 80px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgba(212,175,55,.16), transparent 30%),
    radial-gradient(circle at 100% 20%, rgba(242,214,117,.08), transparent 26%),
    var(--bg);
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.app-shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; gap: 12px; align-items: center; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 14px;
  display: grid; place-items: center;
  color: #0a0a0a; font-weight: 900; font-size: 25px;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  box-shadow: 0 0 30px rgba(212,175,55,.22);
}
.brand strong { display: block; font-size: 18px; letter-spacing: .2px; }
.brand span { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }

.view { padding: 34px 0 60px; }
.hidden { display: none !important; }

.hero-view { min-height: calc(100vh - 76px); display: grid; place-items: center; padding-top: 0; }
.hero-card {
  width: min(740px, 100%);
  background: linear-gradient(145deg, rgba(20,20,20,.94), rgba(24,24,24,.88));
  border: 1px solid var(--line);
  border-radius: 34px;
  padding: clamp(34px, 6vw, 70px);
  text-align: center;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.hero-card:before {
  content: "";
  position: absolute;
  inset: -2px;
  background: radial-gradient(circle at 50% -10%, rgba(212,175,55,.18), transparent 38%);
  pointer-events: none;
}
.hero-card > * { position: relative; }
.vault-icon { font-size: 58px; margin-bottom: 18px; }
h1 { font-size: clamp(38px, 6vw, 64px); line-height: 1; margin: 0 0 18px; letter-spacing: -2.5px; }
h2 { font-size: clamp(28px, 4vw, 42px); margin: 0 0 10px; letter-spacing: -1.2px; }
h3 { margin: 0; }
p { line-height: 1.6; }
.hero-card p { color: var(--muted); font-size: 18px; margin: 0 auto 30px; max-width: 560px; }
.hero-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.security-note { font-size: 13px !important; margin-top: 26px !important; margin-bottom: 0 !important; }

.panel {
  width: min(780px, 100%);
  margin: 0 auto;
  background: rgba(20,20,20,.93);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: clamp(24px, 4vw, 42px);
  box-shadow: var(--shadow);
}
.narrow { width: min(560px, 100%); }
.muted { color: var(--muted); margin-top: 0; }
.tiny { color: var(--muted); font-size: 13px; margin: 4px 0 10px; }

label { display: block; font-weight: 700; margin: 18px 0 8px; color: #eadba9; }
input, textarea, select {
  width: 100%;
  color: var(--text);
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(212,175,55,.2);
  border-radius: 14px;
  padding: 14px 15px;
  outline: none;
  transition: border .15s ease, box-shadow .15s ease, background .15s ease;
}
input:focus, textarea:focus, select:focus {
  border-color: rgba(242,214,117,.7);
  box-shadow: 0 0 0 4px rgba(212,175,55,.11);
  background: rgba(255,255,255,.075);
}
textarea { resize: vertical; }

.primary, .secondary, .ghost, .small, .icon-btn, .backLink {
  border: 0;
  border-radius: 14px;
  min-height: 46px;
  padding: 0 18px;
  font-weight: 800;
}
.primary {
  color: #080808;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  box-shadow: 0 14px 30px rgba(212,175,55,.17);
}
.secondary {
  color: var(--text);
  background: rgba(255,255,255,.075);
  border: 1px solid rgba(212,175,55,.18);
}
.ghost { color: var(--text); background: transparent; border: 1px solid rgba(212,175,55,.25); }
.full { width: 100%; margin-top: 24px; }
.backLink { color: var(--muted); background: transparent; padding-left: 0; margin-bottom: 20px; }
.small { min-height: 42px; color: var(--text); background: rgba(255,255,255,.085); border: 1px solid rgba(212,175,55,.2); }
.icon-btn { width: 42px; height: 42px; min-height: 42px; padding: 0; border-radius: 50%; color: var(--text); background: rgba(255,255,255,.08); font-size: 24px; }
.danger { color: var(--danger) !important; border-color: rgba(255,107,107,.35); }

.symbols { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.symbol-btn {
  height: 58px;
  border-radius: 16px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(212,175,55,.2);
  color: var(--text);
  font-size: 25px;
  transition: transform .12s ease, border .12s ease, background .12s ease;
}
.symbol-btn:hover { transform: translateY(-1px); border-color: rgba(242,214,117,.55); }
.symbol-btn:active { transform: scale(.98); }
.pattern-preview { min-height: 32px; margin-top: 10px; color: var(--gold-2); letter-spacing: 5px; font-size: 20px; }
.strength { font-size: 13px; margin-top: 8px; color: var(--muted); }
.strength.good { color: var(--ok); }
.strength.warn { color: var(--gold-2); }
.strength.bad { color: var(--danger); }
.message { margin-top: 14px; color: var(--muted); font-size: 14px; }
.message.error { color: var(--danger); }
.message.ok { color: var(--ok); }

.vault-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.vault-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.search-wrap { margin-bottom: 22px; }
.item-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.item-card {
  background: rgba(20,20,20,.86);
  border: 1px solid rgba(212,175,55,.18);
  border-radius: 22px;
  padding: 18px;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.item-card h3 { font-size: 19px; line-height: 1.15; overflow-wrap: anywhere; }
.item-url { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-meta { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.badge { color: #0b0b0b; background: rgba(242,214,117,.85); border-radius: 999px; padding: 4px 9px; font-weight: 800; font-size: 12px; }
.card-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.card-buttons button:last-child { grid-column: 1 / -1; }
.empty-state { text-align: center; color: var(--muted); padding: 70px 0; }
.empty-state div { font-size: 46px; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.74);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 50;
}
.modal-card {
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: #141414;
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 26px;
  box-shadow: var(--shadow);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.password-row, .generated-box { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.modal-actions { margin-top: 22px; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 600; color: var(--text); }
.check input { width: auto; }
.generated-box { margin-top: 18px; }
.toast {
  position: fixed;
  left: 50%; bottom: 22px;
  transform: translateX(-50%);
  background: #222;
  border: 1px solid rgba(212,175,55,.28);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  z-index: 80;
}

@media (max-width: 860px) {
  .item-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .app-shell { width: min(100% - 22px, 1120px); }
  .topbar { height: 68px; }
  .hero-view { min-height: calc(100vh - 68px); }
  .hero-card, .panel, .modal-card { border-radius: 22px; }
  .hero-actions, .vault-header { align-items: stretch; flex-direction: column; }
  .vault-actions { justify-content: stretch; }
  .vault-actions button, .hero-actions button { width: 100%; }
  .symbols { grid-template-columns: repeat(5, 1fr); gap: 7px; }
  .symbol-btn { height: 50px; font-size: 22px; border-radius: 14px; }
  .item-grid { grid-template-columns: 1fr; }
  h1 { letter-spacing: -1.6px; }
}
