/* ChordStamp shared styles
 * Copyright (c) 2026 ChordStamp. All rights reserved.
 * Not licensed for redistribution or reuse.
 */
/* ChordStamp shared styles + guitar-finish themes.
   Themes are named after guitar finishes and picked via the little guitar
   icons in the nav. data-theme lives on <html>, persisted in localStorage. */

:root, :root[data-theme="noir"] {          /* black-on-black, gold hardware */
  --bg: #0d0d10; --surface: #16161b; --surface2: #1d1d24;
  --ink: #e8e6df; --dim: #98959f; --line: #2a2a33;
  --accent: #d4a24e; --accent-ink: #1c1503; --accent2: #7bdcb5;
  --danger: #ff6b81; --hero: linear-gradient(160deg, #0d0d10 40%, #16130b);
}
:root[data-theme="strat"] {                 /* olympic white + tortoise */
  --bg: #f2efe7; --surface: #fbfaf6; --surface2: #eae6da;
  --ink: #26242c; --dim: #6d6a75; --line: #d8d3c4;
  --accent: #c14f3a; --accent-ink: #fff6f0; --accent2: #1f7a5e;
  --danger: #b3273d; --hero: linear-gradient(160deg, #f2efe7 40%, #ece4d2);
}
:root[data-theme="burst"] {                 /* sunburst: amber over deep wood */
  --bg: #180f0a; --surface: #241610; --surface2: #2e1c13;
  --ink: #f2e6d0; --dim: #b09a7e; --line: #3d2818;
  --accent: #e8973a; --accent-ink: #211200; --accent2: #d9b06c;
  --danger: #ff7561; --hero: linear-gradient(160deg, #180f0a 30%, #3a2210);
}
:root[data-theme="crimson"] {               /* red/black metal machine */
  --bg: #120a0d; --surface: #1c1015; --surface2: #24141b;
  --ink: #ece6e8; --dim: #9b8f96; --line: #35202a;
  --accent: #e0324b; --accent-ink: #fff3f4; --accent2: #f0a25e;
  --danger: #ff5c5c; --hero: linear-gradient(160deg, #120a0d 40%, #2a0d16);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--ink); line-height: 1.55;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}
a { color: var(--accent2); }

/* ---- nav ---- */
nav.cs {
  position: sticky; top: 0; z-index: 60; display: flex; align-items: center;
  gap: 4px; padding: 10px 18px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
nav.cs .brand {
  font-weight: 700; font-size: 1.1rem; color: var(--ink);
  text-decoration: none; margin-right: 14px; letter-spacing: .4px;
}
nav.cs .brand b { color: var(--accent); }
nav.cs a.item {
  color: var(--dim); text-decoration: none; font-size: .92rem;
  padding: 5px 12px; border-radius: 8px;
}
nav.cs a.item:hover { color: var(--ink); background: var(--surface2); }
nav.cs a.item.active { color: var(--accent); background: var(--surface2); }
nav.cs .spacer { flex: 1; }
#acct-chip {
  font-size: .8rem; color: var(--dim); background: var(--surface2);
  border: 1px solid var(--line); border-radius: 20px; padding: 3px 12px;
  cursor: pointer; white-space: nowrap;
}
#help-btn {
  font-size: .9rem; font-weight: 700; line-height: 1.4;
  background: var(--surface2); color: var(--dim);
  border: 1px solid var(--line); border-radius: 20px;
  padding: 2px 11px; margin-left: 8px; text-decoration: none;
}
#help-btn:hover, #help-btn.on { color: var(--accent); border-color: var(--accent); }

#fb-btn {
  font-size: .95rem; background: var(--surface2); color: var(--dim);
  border: 1px solid var(--line); border-radius: 20px; padding: 2px 10px;
  cursor: pointer; margin-left: 8px; line-height: 1.4;
}
#fb-btn:hover { color: var(--accent2); border-color: var(--accent2); }
#acct-chip.licensed { color: var(--accent2); border-color: var(--accent2); }

/* theme picker: little guitar bodies */
.themes { display: flex; gap: 6px; align-items: center; margin-left: 8px; }
.themes button {
  background: none; border: 2px solid transparent; border-radius: 8px;
  padding: 2px; cursor: pointer; line-height: 0;
}
.themes button.on { border-color: var(--accent); }
.themes svg { width: 26px; height: 26px; }

/* ---- shared components ---- */
.wrap { max-width: 980px; margin: 0 auto; padding: 24px 18px; }
section.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 20px 22px; margin: 16px 0;
}
h2.t { font-size: 1.06rem; color: var(--accent); margin-bottom: 10px; }
.btn {
  display: inline-block; background: var(--accent); color: var(--accent-ink);
  border: none; border-radius: 10px; padding: 12px 24px; font-size: 1rem;
  font-weight: 600; cursor: pointer; text-decoration: none; text-align: center;
}
.btn:disabled { opacity: .45; cursor: default; }
.btn:not(:disabled):hover { filter: brightness(1.08); }
.btn.ghost {
  background: transparent; color: var(--ink); border: 1px solid var(--line);
}
/* the native search "clear" X is a fixed grey glyph the theme can't
   touch, so swap it for a masked SVG whose colour is ours */
input[type=search]::-webkit-search-cancel-button {
  -webkit-appearance: none; appearance: none;
  width: 15px; height: 15px; cursor: pointer;
  background-color: var(--dim);
  -webkit-mask: var(--x-icon) center / contain no-repeat;
  mask: var(--x-icon) center / contain no-repeat;
}
input[type=search]::-webkit-search-cancel-button:hover {
  background-color: var(--accent);
}
:root {
  --x-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 6.6 12.3 2.3l1.4 1.4L9.4 8l4.3 4.3-1.4 1.4L8 9.4l-4.3 4.3-1.4-1.4L6.6 8 2.3 3.7l1.4-1.4z'/%3E%3C/svg%3E");
}

/* checkboxes and radios wear the theme accent */
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }

input[type=text], input[type=search], input[type=email],
input[type=password], textarea {
  width: 100%; background: var(--surface2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  font-size: .92rem; font-family: inherit;
}
textarea { min-height: 84px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--dim); opacity: .7; }
/* A password manager attaches a saved secret to a username. There is no
   account here (the key IS the credential), so the license forms carry a
   readonly stand-in. Kept off-screen rather than display:none, which most
   managers skip over entirely. */
.pm-user {
  position: absolute; left: -9999px; width: 1px; height: 1px;
  border: 0; padding: 0;
}
.dim { color: var(--dim); }
.small { font-size: .84rem; }
.spin {
  display: inline-block; width: 14px; height: 14px; border: 2px solid var(--dim);
  border-top-color: var(--accent); border-radius: 50%;
  animation: csr .8s linear infinite; vertical-align: -2px; margin-right: 8px;
}
@keyframes csr { to { transform: rotate(360deg); } }
footer.cs {
  color: var(--dim); font-size: .8rem; text-align: center;
  padding: 30px 16px 40px; border-top: 1px solid var(--line); margin-top: 40px;
}
dialog {
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 14px; padding: 22px; max-width: 420px; width: 92%;
  margin: auto;   /* the * reset kills the UA's auto-centering, so restore it */
}
dialog::backdrop { background: rgba(0,0,0,.55); }

/* ---- tab preview (alphaTab) ---- */
dialog#cs-preview {
  width: min(1150px, 96vw); max-width: none; height: 90vh; padding: 14px;
}
dialog#cs-preview[open] { display: flex; flex-direction: column; }
.pv-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.pv-head .btn { padding: 8px 16px; font-size: .9rem; }
#pv-at {
  flex: 1; overflow: auto; background: #fff; border-radius: 10px;
  position: relative;   /* cursors are absolutely positioned inside */
}
/* alphaTab playhead: highlighted bar + moving beat line.
   alphaTab hard-codes z-index:1000 on the cursor layer, which paints the
   beat line OVER the notes it is pointing at, and parked on a beat it hides
   that beat's tab digits and chord name. The staves sit at z-index 1, so
   dropping the cursors to 0 puts the line behind the notation (what GP
   does) without moving anything. */
#pv-at .at-cursors { z-index: 0 !important; }
#pv-at .at-cursor-bar { background: #d4a24e; opacity: .16; }
#pv-at .at-cursor-beat { background: #c1121f; width: 3px; opacity: .9; }
#pv-at .at-highlight * { fill: #c1121f; stroke: #c1121f; }
#pv-at .at-selection div { background: rgba(212,162,78,.22); }
