:root {
  --maroon: #6b1e2a;
  --maroon-deep: #3d1018;
  --maroon-bright: #9a3144;
  --reme-blue: #0a2454;
  --reme-blue-mid: #16407f;
  --gold: #d4a017;
  --gold-bright: #f0c040;
  --gold-soft: #e8c878;
  --bg-deep: #070b12;
  --bg: #0e1522;
  --bg-elevated: #162033;
  --bg-panel: #1a2740;
  --border: #2a3c58;
  --border-strong: #456084;
  --text: #f2f5fb;
  --text-muted: #9aadc6;
  --danger: #f0b8ae;
  --ok: #b9e0c0;
  --font-display: "Rajdhani", "Trebuchet MS", sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
  --radius: 0.55rem;
  --shadow: 0 22px 50px rgba(0, 0, 0, 0.42);
  --glow-gold: 0 0 28px rgba(212, 160, 23, 0.22);
  --glow-maroon: 0 0 32px rgba(154, 49, 68, 0.28);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  background-color: var(--bg-deep);
  background-image:
    radial-gradient(ellipse 90% 55% at 0% -10%, rgba(107, 30, 42, 0.55), transparent 55%),
    radial-gradient(ellipse 80% 50% at 100% -5%, rgba(10, 36, 84, 0.62), transparent 52%),
    radial-gradient(ellipse 55% 40% at 50% 110%, rgba(212, 160, 23, 0.1), transparent 55%),
    linear-gradient(165deg, #060910 0%, #101828 48%, #0a1220 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.045;
  background-image:
    repeating-linear-gradient(
      -28deg,
      transparent,
      transparent 11px,
      rgba(232, 200, 120, 0.55) 11px,
      rgba(232, 200, 120, 0.55) 12px
    );
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(212, 160, 23, 0.05), transparent 25%),
    radial-gradient(circle at 80% 70%, rgba(154, 49, 68, 0.07), transparent 28%);
  animation: ambience 18s ease-in-out infinite alternate;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  letter-spacing: 0.03em;
  font-weight: 700;
  text-transform: uppercase;
}

.wrap {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.4rem 0 4rem;
  animation: rise-in 0.45s ease both;
}

.top {
  margin-bottom: 0.4rem;
  padding: 1.15rem 1.25rem 1.2rem 1.35rem;
  border: 1px solid rgba(212, 160, 23, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(107, 30, 42, 0.22), transparent 42%),
    linear-gradient(225deg, rgba(10, 36, 84, 0.28), transparent 48%),
    rgba(14, 21, 34, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
}

.top::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--maroon-bright), var(--gold));
}

.unit {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-soft);
  text-shadow: 0 0 18px rgba(212, 160, 23, 0.25);
}

.unit::after {
  content: "";
  width: 84px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.section-label {
  margin: 0.55rem 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
}

h1 {
  margin: 0.35rem 0 0;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  line-height: 1.05;
  background: linear-gradient(180deg, #fff 20%, var(--gold-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.intro {
  max-width: 42rem;
  margin: 0.45rem 0 0;
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

.intro:empty {
  display: none;
}

main {
  display: grid;
  grid-template-columns: minmax(0, 32rem) auto;
  column-gap: 1rem;
  align-items: end;
  justify-content: start;
}

.search {
  grid-column: 1;
  margin-top: 1.35rem;
}

.search label,
.field span,
.row-fields span {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--gold-soft);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

input,
textarea,
select {
  width: 100%;
  color: var(--text);
  font: inherit;
  background: rgba(7, 11, 18, 0.72);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.8rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

select {
  color-scheme: dark;
}

select option,
select optgroup {
  background-color: #162033;
  color: #f2f5fb;
}

.search input {
  min-height: 3.15rem;
  padding-left: 2.85rem;
  border-radius: 999px;
  background-color: rgba(7, 11, 18, 0.72);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%23e8c878' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='5.2'/%3E%3Cpath d='M12 12.5 16 16.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 1rem 50%;
}

input:hover,
textarea:hover,
select:hover {
  border-color: var(--border-strong);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.18);
  background-color: rgba(10, 16, 28, 0.9);
}

textarea {
  min-height: 7rem;
  resize: vertical;
}

::placeholder {
  color: #7f93ad;
}

.count {
  grid-column: 2;
  justify-self: start;
  align-self: center;
  margin: 1.35rem 0 0;
  padding: 0.28rem 0.7rem;
  color: #f0d78a;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(212, 160, 23, 0.16);
  border: 1px solid rgba(212, 160, 23, 0.4);
  border-radius: 999px;
}

.count:empty {
  display: none;
}

.grid,
.empty,
.error {
  grid-column: 1 / -1;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.05rem;
  margin-top: 1.25rem;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 210px;
  padding: 1.15rem 1.2rem;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  background:
    linear-gradient(155deg, rgba(36, 52, 78, 0.72), rgba(16, 24, 40, 0.9) 55%),
    rgba(18, 28, 44, 0.85);
  border: 1px solid rgba(69, 96, 132, 0.55);
  border-radius: 0.7rem;
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  animation: rise-in 0.5s ease both;
}

.card:nth-child(2) { animation-delay: 0.04s; }
.card:nth-child(3) { animation-delay: 0.08s; }
.card:nth-child(4) { animation-delay: 0.12s; }
.card:nth-child(5) { animation-delay: 0.16s; }
.card:nth-child(6) { animation-delay: 0.2s; }

.card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--maroon-bright), var(--gold));
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    transparent 35%,
    rgba(255, 255, 255, 0.05) 48%,
    transparent 62%
  );
  background-size: 220% 100%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.icon-wrap {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  overflow: hidden;
  color: #1a1205;
  font-family: var(--font-display);
  background: linear-gradient(160deg, var(--gold-bright), var(--gold));
  border: 1px solid #a8883f;
  border-radius: 0.7rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.22s ease;
}

.icon-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mono {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.desc {
  color: var(--text-muted);
  line-height: 1.5;
}

.path {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  margin-top: auto;
  padding: 0.2rem 0.65rem;
  color: var(--gold-soft);
  font-size: 0.8rem;
  background: rgba(212, 160, 23, 0.08);
  border: 1px solid rgba(212, 160, 23, 0.2);
  border-radius: 999px;
}

.path::after {
  content: "→";
  transition: transform 0.22s ease;
}

.empty,
.error,
.notice {
  margin: 1rem 0 0;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius);
  line-height: 1.5;
  animation: rise-in 0.35s ease both;
}

.empty:not([hidden]) {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  background: rgba(7, 11, 18, 0.35);
  border: 1px dashed rgba(212, 160, 23, 0.28);
}

.error {
  color: var(--danger);
  background: rgba(212, 100, 82, 0.15);
  border: 1px solid rgba(212, 100, 82, 0.4);
}

.notice {
  color: var(--ok);
  background: rgba(82, 168, 108, 0.15);
  border: 1px solid rgba(82, 168, 108, 0.4);
}

.panel {
  position: relative;
  width: min(760px, 100%);
  margin-top: 1.4rem;
  padding: 1.15rem 1.2rem;
  overflow: hidden;
  background:
    linear-gradient(155deg, rgba(36, 52, 78, 0.72), rgba(16, 24, 40, 0.9) 55%),
    rgba(18, 28, 44, 0.85);
  border: 1px solid rgba(69, 96, 132, 0.55);
  border-radius: 0.7rem;
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: rise-in 0.5s ease both;
}

.login-panel {
  max-width: 440px;
  border-color: rgba(212, 160, 23, 0.28);
  box-shadow: var(--shadow), var(--glow-gold);
}

.login-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--maroon-bright), var(--gold), var(--reme-blue-mid));
}

.stack {
  display: grid;
  gap: 0.9rem;
}

.actions,
.row-actions,
.password-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.actions {
  margin-top: 0.4rem;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  color: #1a1205;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  border: 1px solid #a8883f;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(212, 160, 23, 0.28);
  transition: filter 0.15s ease, transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

button.secondary,
.button.secondary {
  color: var(--text);
  font-weight: 600;
  background: linear-gradient(180deg, rgba(36, 52, 78, 0.95), rgba(22, 34, 54, 0.95));
  border-color: var(--border-strong);
  box-shadow: none;
}

.site-list {
  display: grid;
  gap: 0.75rem;
  margin: 0.85rem 0 0;
  padding: 0;
  list-style: none;
}

.site-row {
  display: grid;
  gap: 0.85rem;
  padding: 0.9rem;
  background: linear-gradient(90deg, rgba(12, 16, 24, 0.55), rgba(22, 32, 51, 0.45));
  border: 1px solid rgba(42, 60, 88, 0.9);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.row-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.row-fields .wide {
  grid-column: 1 / -1;
}

.hint {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.password-block {
  margin-top: 1.4rem;
}

h2 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  color: var(--gold-soft);
  letter-spacing: 0.08em;
}

.card:focus-visible,
button:focus-visible,
.button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .card:hover {
    transform: translateY(-4px);
    border-color: rgba(212, 160, 23, 0.35);
    box-shadow:
      0 16px 36px rgba(0, 0, 0, 0.32),
      var(--glow-gold);
  }

  .card:hover::after {
    opacity: 1;
    animation: sheen 1.4s ease;
  }

  .card:hover .icon-wrap {
    transform: scale(1.05);
  }

  .card:hover .path::after {
    transform: translateX(4px);
  }

  button:hover,
  .button:hover {
    filter: brightness(1.07);
    transform: translateY(-1px);
    box-shadow: var(--glow-gold);
  }

  button.secondary:hover,
  .button.secondary:hover {
    filter: none;
    background: linear-gradient(180deg, var(--reme-blue-mid), var(--reme-blue));
    box-shadow: 0 8px 18px rgba(10, 36, 84, 0.35);
  }

  .site-row:hover {
    border-color: rgba(212, 160, 23, 0.45);
    background: linear-gradient(90deg, rgba(107, 30, 42, 0.18), rgba(20, 58, 117, 0.28));
    transform: translateX(3px);
    box-shadow: -3px 0 0 var(--gold);
  }
}

button:active,
.button:active {
  transform: translateY(0);
}

@media (max-width: 760px) {
  body {
    background-attachment: scroll;
  }

  .wrap {
    width: min(1120px, calc(100% - 1.25rem));
    padding: 1.4rem 0 3rem;
  }

  .top {
    padding: 1rem 1rem 1.05rem 1.15rem;
  }

  main {
    grid-template-columns: 1fr;
  }

  .search,
  .count {
    grid-column: 1;
  }

  .count {
    justify-self: start;
    margin-top: 0.75rem;
  }

  .search input {
    min-height: 3rem;
  }

  .card {
    min-height: 0;
  }

  .row-fields {
    grid-template-columns: 1fr;
  }

  .row-fields .wide {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@keyframes ambience {
  from {
    opacity: 0.55;
    transform: scale(1);
  }
  to {
    opacity: 1;
    transform: scale(1.04);
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sheen {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -20% 0;
  }
}
