/* ============================================================
   THEME BAR — refined, job-application styling
   Drop-in replacement for the .theme-bar / .theme-quick / .swatch
   blocks in modern-form.css. Paste this AFTER the existing
   theme-bar rules (or replace them) — these override cleanly.
   ============================================================ */

.theme-bar {
  position: sticky;
  top: 12px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px 14px 16px;
  margin: 16px 0 30px;
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--bg-elev) 92%, var(--accent) 8%),
      color-mix(in srgb, var(--bg-elev) 96%, transparent)) ;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md), var(--shadow-inset);
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}
/* hairline accent strip on the leading edge */
.theme-bar::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2, var(--accent)));
  box-shadow: 0 0 16px var(--accent);
}

/* ---- Brand block (icon + titles) ---- */
.theme-bar__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.theme-bar__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 14px;
  color: var(--accent-contrast);
  background: linear-gradient(140deg, var(--accent), var(--accent-strong));
  box-shadow: 0 6px 18px -6px var(--accent), inset 0 1px 0 rgba(255,255,255,.25);
  position: relative;
}
.theme-bar__mark::after {
  /* soft glossy sheen */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(160deg, rgba(255,255,255,.35), transparent 55%);
  pointer-events: none;
}
.theme-bar__mark svg { width: 23px; height: 23px; }

.theme-bar__titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.theme-bar__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  line-height: 1.1;
  color: var(--text);
  letter-spacing: -0.02em;
}
.theme-bar__subtitle {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---- Controls / quick swatch row ---- */
.theme-bar__controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.theme-quick {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px 7px 16px;
  background: color-mix(in srgb, var(--bg-soft) 80%, transparent);
  border-radius: 99px;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-inset);
}
.theme-quick__label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 800;
  margin-right: 2px;
}

/* ---- Swatches ---- */
.swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--bg-elev) 70%, transparent);
  cursor: pointer;
  transition: transform .25s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow .2s ease, border-color .2s ease;
  position: relative;
  outline: none;
  padding: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.swatch:hover {
  transform: scale(1.16) translateY(-1px);
  box-shadow: 0 6px 14px rgba(0,0,0,.22);
}
.swatch:focus-visible {
  border-color: var(--text);
  box-shadow: 0 0 0 3px var(--ring);
}

/* active state: rotating dashed ring + tick badge */
.swatch[aria-pressed="true"] {
  border-color: var(--text);
  transform: scale(1.18);
}
.swatch[aria-pressed="true"]::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1.5px dashed var(--accent);
  animation: ringRotate 9s linear infinite;
}
@keyframes ringRotate { to { transform: rotate(360deg); } }

/* tick badge */
.swatch__tick {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-contrast);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px var(--bg-elev);
  transform: scale(0);
  transition: transform .22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.swatch__tick svg { width: 9px; height: 9px; }
.swatch[aria-pressed="true"] .swatch__tick { transform: scale(1); }

/* ---- Active theme label ---- */
.theme-bar__active {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 99px;
  background: var(--accent-soft);
  border: 1.5px solid color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--accent-strong);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.02em;
}
.theme-bar__active-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

/* swatch gradients keyed by theme (quick row) */
.swatch[data-theme="ocean"]    { background: linear-gradient(135deg, #eef4fb 48%, #0a6fb8 48%); }
.swatch[data-theme="sand"]     { background: linear-gradient(135deg, #f4ecdb 48%, #a35a2a 48%); }
.swatch[data-theme="forest"]   { background: linear-gradient(135deg, #ebf3ec 48%, #2c7a4b 48%); }
.swatch[data-theme="rose"]     { background: linear-gradient(135deg, #fbeef0 48%, #b83a55 48%); }
.swatch[data-theme="paper"]    { background: linear-gradient(135deg, #f6f6f4 48%, #0a0a0a 48%); }
.swatch[data-theme="lavender"] { background: linear-gradient(135deg, #f3eef9 48%, #6e3fc4 48%); }
.swatch[data-theme="midnight"] { background: linear-gradient(135deg, #2a3f63 48%, #7eb5ff 48%); }
.swatch[data-theme="sunset"]   { background: linear-gradient(135deg, #fff4e6 48%, #e85d2c 48%); }
.swatch[data-theme="mint"]     { background: linear-gradient(135deg, #e6f9f1 48%, #14a87a 48%); }

/* ---- Responsive ---- */
@media (max-width: 880px) {
  .theme-bar__subtitle { display: none; }
  .theme-bar__active   { display: none; }
}
@media (max-width: 600px) {
  .theme-bar { padding: 12px 14px; gap: 10px; }
  .theme-bar__title { font-size: 16px; }
  .theme-bar__mark { width: 38px; height: 38px; }
  .theme-bar__mark svg { width: 20px; height: 20px; }
}

@media print {
  .theme-bar { display: none !important; }
}