:root {
  --bg-0: #0f1324;
  --bg-1: #222740;
  --accent: #f2b705;
  --accent-2: #16f2b3;
  --panel: rgba(11, 15, 33, 0.78);
  --line: rgba(255, 255, 255, 0.14);
  --text: #f4f7ff;
  --muted: #bac2dd;
  --danger: #ff6b6b;
  --ok: #7dffb2;
  --font: "Trebuchet MS", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: radial-gradient(circle at 15% 20%, #3d1e5f 0%, transparent 35%),
    radial-gradient(circle at 85% 10%, #134964 0%, transparent 35%),
    linear-gradient(130deg, var(--bg-0) 5%, var(--bg-1) 95%);
  min-height: 100vh;
}

.backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 28px 28px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: rgba(6, 8, 20, 0.68);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.topbar h1 { margin: 2px 0 0; font-size: 1.45rem; }
.brand-sub { color: var(--accent-2); letter-spacing: 0.12em; }

.layout {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 24px auto;
  padding: 0 16px 28px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 12px 42px rgba(0, 0, 0, 0.3);
}

.grid-form { display: grid; gap: 14px; }
label { display: grid; gap: 6px; }
input, textarea {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.07);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
}
select {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.07);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent-2);
  outline: 2px solid rgba(22, 242, 179, 0.18);
}

.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.notes-box {
  margin: 0;
  border: 1px dashed rgba(255,255,255,0.3);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.notes-box legend { padding: 0 8px; }

.label-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  display: inline-block;
  font-size: 0.72rem;
  color: #08211b;
  background: var(--accent-2);
  border-radius: 999px;
  padding: 2px 8px;
}

.info {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  font-family: inherit;
  font-size: 1rem;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.1);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.primary-btn, button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
}

.primary-btn {
  color: #1f1503;
  background: linear-gradient(90deg, #ffd36b, #f2b705);
  font-weight: 800;
}

.ghost-btn {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.08);
  color: var(--text);
}

.muted { color: var(--muted); }
.cards {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}
.section-title {
  margin: 10px 0 10px;
  font-size: 1rem;
  color: #e9f0ff;
}
.variation-section {
  margin-top: 16px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0,0,0,0.32);
}
.card-selected {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 2px rgba(22, 242, 179, 0.3) inset;
}

.card img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
}

.card-body { padding: 10px; }
.card h3 { margin: 0 0 8px; font-size: 0.95rem; }
.select-btn {
  width: 100%;
  color: #072f20;
  background: linear-gradient(90deg, #78ffd6, #a8ffea);
  font-weight: 700;
}

.success-text { color: var(--ok); min-height: 18px; }
.error-text { color: var(--danger); min-height: 18px; }
.final-result {
  margin-top: 12px;
}
.final-card {
  max-width: 380px;
}

.tooltip {
  position: absolute;
  z-index: 999;
  max-width: 280px;
  padding: 10px 12px;
  font-size: 0.86rem;
  background: #0a1533;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.4);
}

.auth-body {
  display: grid;
  place-items: center;
}

.auth-shell {
  width: min(94vw, 460px);
}

.auth-card {
  margin-top: 10vh;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
}

.form-stack { display: grid; gap: 12px; }
.hidden { display: none; }

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .topbar { padding: 14px; }
  .panel { padding: 14px; }
  .two-cols { grid-template-columns: 1fr; }
}
