/* TrueVAULT minimal, clean design */
:root {
  --brand: #6b8cff;
  --brand-600: #5576f0;
  --brand-700: #3f5fdc;
  /* Slightly darker base background */
  --bg: #0b0e1a;
  --card: #181c2f;
  --text: #e8ecff;
  --muted: #b8c0e0;
  --ok: #38d39f;
  --warn: #ffbf69;
  --err: #ff6b6b;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  /* Purple-only animated gradient with a darker base */
  background:
    radial-gradient(1200px 800px at 20% 0%, rgba(103, 67, 227, 0.45) 0%, transparent 60%),
    radial-gradient(900px 700px at 100% 10%, rgba(103, 67, 227, 0.30) 0%, transparent 65%),
    radial-gradient(800px 600px at 0% 100%, rgba(103, 67, 227, 0.22) 0%, transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
  background-position: 20% 0%, 100% 10%, 0% 100%, 0 0;
  animation: gradientFloat 24s ease-in-out infinite;
  line-height: 1.6;
}

@keyframes gradientFloat {
  0%   { background-position: 20% 0%,   100% 10%, 0% 100%, 0 0; }
  50%  { background-position: 35% 12%,   70% 22%, 10% 85%, 0 0; }
  100% { background-position: 20% 0%,   100% 10%, 0% 100%, 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  body { animation: none; }
}

.wrap {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

header.site {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 16px 8px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo-badge {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-700) 100%);
  display: grid; place-items: center;
  box-shadow: var(--shadow);
}
.logo-img { height: 48px; width: auto; border-radius: 0; box-shadow: none; background: transparent; }
.logo-badge span { font-weight: 800; color: white; letter-spacing: .5px; }
.logo-text { font-weight: 800; font-size: 18px; letter-spacing: .6px; color: var(--text); }
.logo-sub { color: var(--muted); font-size: 12px; letter-spacing: .4px; }

main { display: grid; place-items: center; padding: 10px 16px 40px; }
.card {
  width: 100%;
  max-width: 520px;
  /* Dark frosted glass */
  background:
    linear-gradient(135deg, rgba(255,255,255,.05), rgba(255,255,255,.02)),
    rgba(12, 14, 26, .48);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.04);
  padding: 28px;
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  backdrop-filter: blur(14px) saturate(120%);
}

/* Fallback when backdrop-filter isn't supported: make card more opaque */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .card { background: rgba(12, 14, 26, .82); }
}
.card h1 { margin: 0 0 6px; font-size: 22px; letter-spacing: .4px; }
.card p.lead { margin: 0 0 18px; color: var(--muted); }

.field { margin: 14px 0; }
.field label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 14px; }
.control { position: relative; }
.control input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: var(--text);
  outline: none;
  transition: border-color .2s ease, background .2s ease;
}
.control input:focus { border-color: color-mix(in srgb, var(--brand) 70%, white 30%); background: rgba(255,255,255,.06); }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.error { color: var(--err); font-size: 12px; margin-top: 6px; display: none; }
.error.show { display: block; }

/* Inline help tooltip */
.help-wrap { position: relative; display: inline-flex; align-items: center; margin-left: 8px; }
.help-badge {
  display: inline-grid; place-items: center;
  width: 18px; height: 18px; border-radius: 50%;
  font-size: 12px; font-weight: 700; line-height: 1; color: var(--text);
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  cursor: help;
}
.help-badge:focus { outline: 2px solid color-mix(in srgb, var(--brand) 70%, white 30%); outline-offset: 2px; }
.tooltip {
  position: absolute; left: 100%; top: 50%; transform: translate(8px, -50%);
  white-space: nowrap; z-index: 10;
  background: rgba(12, 14, 26, .95);
  border: 1px solid rgba(255,255,255,.18);
  color: var(--text);
  padding: 8px 10px; border-radius: 8px; font-size: 12px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .15s ease;
}
.help-wrap:hover .tooltip, .help-wrap:focus-within .tooltip { opacity: 1; pointer-events: auto; }

.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

.actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 16px; border-radius: 12px; border: 0;
  cursor: pointer; text-decoration: none; font-weight: 600; letter-spacing: .3px;
}
.btn.primary { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-700) 100%); color: white; }
.btn.secondary { background: transparent; color: var(--muted); border: 1px solid rgba(255,255,255,.12); }
.btn.full { width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

.note { padding: 12px 14px; border: 1px dashed rgba(255,255,255,.15); border-radius: 10px; color: var(--muted); font-size: 13px; }
.note strong { color: var(--text); font-weight: 700; }
.note-steps {
  margin: 8px 0 0 18px;
  padding-left: 8px;
}
.note-steps li { margin: 4px 0; }

/* Accessible accordion styling */
details.note-accordion { border-style: dashed; }
details.note-accordion { margin-bottom: 12px; }
details.note-accordion > summary {
  list-style: none;
  cursor: pointer;
  color: var(--text);
  font-weight: 700; /* match REQUIRED heading weight */
  font-size: 13px;  /* match REQUIRED heading size */
  display: flex;
  align-items: center;
  gap: 8px;
}
details.note-accordion > summary::-webkit-details-marker { display: none; }
details.note-accordion > summary::before {
  content: '\25BC'; /* down triangle */
  display: inline-block;
  transform: rotate(-90deg);
  transition: transform .2s ease;
  font-size: 0.9em;
  opacity: .8;
}
details.note-accordion[open] > summary::before { transform: rotate(0deg); }
details.note-accordion[open] { padding-bottom: 10px; }
details.note-accordion > .note-steps { margin-top: 10px; }

.status {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 12px; margin: 10px 0;
}
.status.ok { background: rgba(56, 211, 159, .12); color: #baf3dd; border: 1px solid rgba(56,211,159,.35); }
.status.warn { background: rgba(255, 191, 105, .12); color: #ffe7c3; border: 1px solid rgba(255,191,105,.35); }
.status.err { background: rgba(255, 107, 107, .12); color: #ffd4d4; border: 1px solid rgba(255,107,107,.35); }

.center { text-align: center; }
.muted { color: var(--muted); }

footer.site { color: var(--muted); text-align: center; padding: 24px 16px 40px; font-size: 12px; }

/* Password strength meter */
.strength { display: grid; grid-auto-flow: column; gap: 6px; margin-top: 8px; }
.strength span { height: 6px; border-radius: 4px; background: rgba(255,255,255,.12); }
.strength[data-level="1"] span:nth-child(-n+1) { background: var(--err); }
.strength[data-level="2"] span:nth-child(-n+2) { background: #ff9966; }
.strength[data-level="3"] span:nth-child(-n+3) { background: #ffd166; }
.strength[data-level="4"] span:nth-child(-n+4) { background: #a8e6cf; }
.strength[data-level="5"] span:nth-child(-n+5) { background: var(--ok); }

@media (max-width: 520px) { .actions { flex-direction: column; align-items: stretch; } }

/* Code display + copy */
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; letter-spacing: .8px; }
.codebox { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.12); }

/* Responsive video embed */
.video { position: relative; width: 100%; max-width: 800px; margin: 12px auto 0; aspect-ratio: 16/9; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.12); border-radius: 12px; overflow: hidden; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Drag-and-drop install button states */
.truevault-drag-button.dragging { opacity: .8; transform: scale(0.98); }
.truevault-install-action { margin-top: 10px; }
/* Make the install button full-width with 10px rounding */
.truevault-install-action .truevault-drag-button {
  width: 100%;
  border-radius: 10px;
}

/* Action row above video */
.video-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.video-actions .btn { padding: 8px 12px; border-radius: 10px; }

/* When expanded, the card grows to accommodate a larger video, within layout flow */
.card.is-video-expanded { max-width: clamp(720px, 90vw, 1200px); }
@media (max-width: 760px) { .card.is-video-expanded { max-width: calc(100vw - 24px); } }
