:root {
  --bg: #ffffff; --surface: rgba(255, 255, 255, .92); --surface-solid: #ffffff; --field: #ffffff;
  --line: #e3e9cb; --line-strong: #b4d089;
  --ink: #20261a; --muted: #6a7462; --accent-ink: #305318;
  --tone1: #96cc76; --tone2: #6f9f4a; --tone3: #416b28;
  --btn: linear-gradient(135deg, #c7dd4a, #96cc76); --btn-hover: linear-gradient(135deg, #d3e66b, #a7d68a);
  --chip: #f4f9ef; --glow: rgba(111, 159, 74, .22); --danger: #b42318; --ok: #1f7a4d;
  --shadow: 0 30px 70px -36px rgba(50, 80, 31, .3);
  --display: Outfit, Manrope, system-ui, sans-serif;
  --sans: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent !important; }
*::before, *::after { -webkit-tap-highlight-color: transparent !important; }
[hidden] { display: none !important; }
html { height: 100%; -webkit-tap-highlight-color: transparent !important; }
body {
  margin: 0; min-height: 100%; min-height: 100dvh; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--sans);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding: clamp(10px, 2vh, 24px) clamp(10px, 4vw, 16px) clamp(16px, 3vh, 32px);
  overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch;
  -webkit-tap-highlight-color: transparent !important;
}
:focus:not(:focus-visible) { outline: none; }
.th-toggle { display: none !important; }

.card {
  position: relative; z-index: 1; width: min(440px, 100%); margin: auto 0;
  padding: clamp(14px, 2.6vh, 28px) clamp(16px, 5vw, 28px) clamp(12px, 2.2vh, 22px); border-radius: 26px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  animation: rise .9s var(--ease) both;
}
.card.shake { animation: shake .5s; }
@keyframes rise { from { opacity: 0; transform: translateY(30px) scale(.96); filter: blur(8px); } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

.head { text-align: center; margin-bottom: clamp(6px, 2vh, 20px); }
/* ---------- animated logo: cycles through every category (ring, earrings, pendant, necklace, bracelet) ---------- */
.logo { width: 44px; height: 44px; overflow: visible; flex: none; }
.logo .lg-items { transform-box: view-box; transform-origin: 24px 26px; }
.logo .lg-item { opacity: 0; transform-box: view-box; transform-origin: 24px 26px; animation: lgCycle 15s infinite; }
.logo .i1 { animation-delay: 3s; } .logo .i2 { animation-delay: 6s; } .logo .i3 { animation-delay: 9s; } .logo .i4 { animation-delay: 12s; }
.logo .lg-item .d { stroke-dasharray: 100; stroke-dashoffset: 100; animation: lgTrace 15s infinite; animation-delay: inherit; }
.logo .lg-item .g { transform-box: fill-box; transform-origin: center; animation: lgGem 15s infinite; animation-delay: inherit; }
.logo .lg-spark { transform-box: fill-box; transform-origin: center; transform: scale(0); animation: lgSpark 3s ease-in-out 1.2s infinite; }
.logo .lg-spark.s2 { animation-delay: 2s; }
@keyframes lgCycle { 0% { opacity: 0; transform: scale(.7) rotate(-10deg); } 3% { opacity: 1; transform: none; } 17% { opacity: 1; transform: none; } 20% { opacity: 0; transform: scale(1.15) rotate(8deg); } 100% { opacity: 0; } }
@keyframes lgTrace { 0% { stroke-dashoffset: 100; } 9% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 0; } }
@keyframes lgGem { 0%, 5% { opacity: 0; transform: scale(.2); } 10% { opacity: 1; transform: scale(1.12); } 12%, 100% { opacity: 1; transform: none; } }
@keyframes lgSpark { 0%, 50%, 100% { transform: scale(0) rotate(0deg); opacity: 0; } 70% { transform: scale(1.15) rotate(90deg); opacity: 1; } 85% { transform: scale(.6) rotate(140deg); opacity: .6; } }
@keyframes lgFlip { 50% { transform: scaleX(.12); } }
.brand:hover .logo .lg-items, .logo-wrap:hover .logo .lg-items { animation: lgFlip 1s cubic-bezier(.4, 0, .2, 1); }
@media (prefers-reduced-motion: reduce) {
  .logo .lg-item, .logo .lg-item .d, .logo .lg-item .g { animation: none !important; }
  .logo .lg-item .d { stroke-dashoffset: 0; }
  .logo .i0 { opacity: 1; }
}
.logo-wrap { width: clamp(36px, 6vh, 64px); height: clamp(36px, 6vh, 64px); margin: 0 auto clamp(3px, 0.8vh, 8px); display: grid; place-items: center; }
.logo-wrap .logo { width: 100%; height: 100%; }
.eyebrow { font-size: 11px; letter-spacing: .34em; text-transform: uppercase; color: var(--tone2); }
h1 { font: 300 clamp(19px, 3vh, 30px)/1.1 var(--display); letter-spacing: -.02em; margin: clamp(3px, 0.6vh, 6px) 0 clamp(2px, 0.5vh, 5px); }
h1 em { font-style: normal; font-weight: 500; background: linear-gradient(100deg, var(--tone3), var(--tone1) 30%, var(--tone2) 50%, var(--tone1) 70%, var(--tone3));
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 6s linear infinite; }
@keyframes shimmer { to { background-position: -250% 0; } }
.head p { margin: 0; color: var(--muted); font-size: 14px; }

.tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 14px; background: var(--chip); border: 1px solid var(--line); margin-bottom: clamp(6px, 1.8vh, 18px); }
.tabs button { position: relative; z-index: 1; border: 0; background: none; padding: 10px; font: 600 14px var(--sans); color: var(--muted); cursor: pointer; border-radius: 10px; transition: color .3s; }
.tabs button[aria-selected="true"] { color: var(--accent-ink); }
.tabs .pill { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 10px;
  background: var(--btn); border: 1px solid var(--line-strong); box-shadow: 0 6px 16px -10px var(--glow); transition: transform .5s var(--ease); color: var(--btn-ink, #1d2f10); }
.tabs[data-mode="register"] .pill { transform: translateX(100%); }

form { display: grid; gap: clamp(4px, 1.2vh, 12px); }
form.enter > * { animation: fieldIn .5s var(--ease) both; }
form.enter > *:nth-child(2) { animation-delay: .05s; } form.enter > *:nth-child(3) { animation-delay: .1s; }
form.enter > *:nth-child(4) { animation-delay: .15s; } form.enter > *:nth-child(5) { animation-delay: .2s; }
@keyframes fieldIn { from { opacity: 0; transform: translateY(10px); } }
.field { position: relative; }
.field input {
  width: 100%; height: 52px; padding: 19px 16px 5px; border-radius: 14px; border: 1px solid var(--line); background: var(--field);
  color: var(--ink); font: 500 15px/1.35 var(--sans); outline: none; transition: border-color .3s, box-shadow .3s;
}
.field input::-ms-reveal, .field input::-ms-clear { display: none; }
.field input:focus { border-color: var(--tone2); box-shadow: 0 0 0 4px var(--chip), 0 0 30px -10px var(--glow); }
.field label {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14.5px; line-height: 1; pointer-events: none;
  transition: top .25s var(--ease), transform .25s var(--ease), color .25s, font-size .25s; transform-origin: left top;
}
.field input:focus + label, .field input:not(:placeholder-shown) + label, .field input:-webkit-autofill + label {
  top: 9px; transform: none; font-size: 11px; font-weight: 600; color: var(--tone2); letter-spacing: .04em;
}
.field .eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; background: none; color: var(--muted);
  cursor: pointer; border-radius: 10px; display: grid; place-items: center; padding: 0; margin: 0; transition: color .2s, background-color .2s;
}
.field .eye:hover { color: var(--tone2); background: var(--chip); }
.field .eye svg { width: 20px; height: 20px; display: block; }
.field.pw input { padding-right: 48px; }
.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 2px; }
.meter i { height: 4px; border-radius: 4px; background: var(--line); transition: background .4s, transform .4s var(--ease); transform-origin: 0 50%; }
.meter i.on { background: linear-gradient(90deg, var(--tone3), var(--tone1)); }
.meter-label { font-size: 12px; color: var(--muted); margin-top: 7px; min-height: 18px; }

.primary {
  position: relative; overflow: hidden; height: clamp(36px, 4.4vh, 50px); border-radius: 14px; cursor: pointer; margin-top: 4px;
  font: 700 15px var(--sans); letter-spacing: .06em; color: var(--btn-ink, #1d2f10);
  background: var(--btn); border: 1px solid var(--line-strong);
  box-shadow: 0 12px 26px -16px var(--glow), inset 0 1px 0 rgba(255, 255, 255, .8);
  transition: transform .35s var(--ease), background-position .6s, box-shadow .35s;
}
.primary::after { content: ""; position: absolute; top: 0; bottom: 0; width: 45%; left: -60%; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(var(--th-sheen-rgb, 255, 255, 255), .6), transparent); animation: sheen 4.5s ease-in-out infinite; }
@keyframes sheen { 0%, 60% { left: -60%; } 100% { left: 140%; } }
.primary:hover { transform: translateY(-2px); background: var(--btn-hover); color: var(--btn-ink, #1d2f10); }
.primary:active { transform: scale(.98); }
.primary:disabled { cursor: progress; opacity: .85; }
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: turn .7s linear infinite; vertical-align: -3px; margin-right: 8px; }
@keyframes turn { to { transform: rotate(360deg); } }
button:focus-visible, input:focus-visible { outline: 2px solid var(--tone2); outline-offset: 2px; }

.msg { font-size: 13.5px; min-height: 2px; text-align: center; margin: 2px 0 0; }
.msg.error { color: var(--danger); }
.msg.ok { color: var(--ok); }
.done { text-align: center; padding: 8px 0 4px; animation: rise .7s var(--ease); }
.done svg { width: 76px; height: 76px; color: var(--tone2); }
.done svg circle, .done svg path { stroke-dasharray: 240; stroke-dashoffset: 240; animation: draw 1.2s var(--ease) forwards; }
.done svg path { animation-delay: .5s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done h2 { font: 400 24px var(--display); margin: 12px 0 6px; }
.done p { color: var(--muted); margin: 0 0 18px; font-size: 14px; }
.hint { color: var(--muted); font-size: 12px; margin: -6px 2px 4px; }
#verifyForm .google { margin-bottom: 0; width: 100%; cursor: pointer; }
#vCodeBox { display: grid; gap: 14px; }
#vCodeBox .primary { width: 100%; margin-top: 0; }
.ghost { border: 1px solid var(--line-strong); background: transparent; color: var(--ink); border-radius: 999px; padding: 9px 18px; font: 600 13px var(--sans); cursor: pointer; transition: background .3s, color .3s; }
.ghost:hover { background: var(--btn-hover); color: var(--btn-ink, #1d2f10); }
.google {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 12px; height: clamp(34px, 4.2vh, 48px); margin-bottom: clamp(5px, 1.4vh, 14px);
  border-radius: 14px; border: 1px solid var(--line-strong); background: var(--th-paper, #fff); color: var(--ink); text-decoration: none;
  font: 600 14.5px var(--sans); transition: transform .35s var(--ease), box-shadow .35s, border-color .3s;
}
.google svg { width: 20px; height: 20px; transition: transform .6s var(--ease); }
.google:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -18px var(--glow); border-color: var(--tone2); }
.google:hover svg { transform: rotate(360deg); }
.google.busy { pointer-events: none; opacity: .8; }
.google.busy svg { animation: turn 1s linear infinite; }
.or { display: flex; align-items: center; gap: 12px; margin: 0 0 clamp(8px, 1.3vh, 13px); color: var(--muted); font-size: 12px; letter-spacing: .08em; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.code-head { text-align: center; color: var(--muted); font-size: 14px; margin: 0 0 4px; }
.code-head b { color: var(--ink); word-break: break-all; }
.field input.code { text-align: center; font: 600 24px/1 var(--display); letter-spacing: .5em; padding: 14px 0 14px .5em; }
.code-links { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.linkish { border: 0; background: none; padding: 4px 2px; color: var(--accent-ink); font: 600 13px var(--sans); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.linkish:disabled { color: var(--muted); text-decoration: none; cursor: default; }
.forgot { display: flex; justify-content: flex-end; margin: -6px 0 2px; }
.wide { width: 100%; margin-top: 10px; padding: 12px 18px; font-size: 14px; }
.foot { text-align: center; margin-top: clamp(8px, 1.4vh, 14px); font-size: 12px; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 6px; }
.foot svg { width: 13px; height: 13px; color: var(--tone2); }
@media (max-width: 480px) {
  body { padding: 10px 10px 24px; }
  .card { border-radius: 22px; padding: 16px 16px 14px; }
  .logo-wrap { width: 38px; height: 38px; margin: 0 auto 3px; }
  .eyebrow { font-size: 10px; letter-spacing: .28em; }
  h1 { font-size: 22px; margin: 2px 0 3px; }
  .head { margin-bottom: 10px; }
  .head p { font-size: 12.5px; line-height: 1.35; }
  .tabs { padding: 3px; margin-bottom: 8px; border-radius: 12px; }
  .tabs button { padding: 7px 10px; font-size: 13.5px; border-radius: 9px; }
  .tabs .pill { top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 9px; }
  .google { height: 42px; margin-bottom: 7px; font-size: 13.5px; border-radius: 12px; gap: 9px; }
  .google svg { width: 18px; height: 18px; }
  .or { margin: 0 0 7px; font-size: 11px; gap: 8px; }
  form { gap: 8px; }
  .field input { height: 48px; padding: 17px 14px 4px; border-radius: 12px; font-size: 14.5px; }
  .field label { left: 14px; font-size: 13.5px; }
  .field input:focus + label, .field input:not(:placeholder-shown) + label, .field input:-webkit-autofill + label { top: 7px; font-size: 10.5px; }
  .field .eye { width: 36px; height: 36px; right: 5px; }
  .field .eye svg { width: 18px; height: 18px; }
  .field.pw input { padding-right: 44px; }
  .meter { gap: 4px; margin-top: 1px; }
  .meter i { height: 3px; }
  .meter-label { font-size: 11.5px; margin-top: 3px; min-height: 16px; }
  .primary { height: 46px; border-radius: 12px; font-size: 14.5px; margin-top: 2px; }
  .foot { margin-top: 8px; font-size: 11.5px; }
}
@media (max-height: 720px) {
  body { padding-top: 8px; padding-bottom: 18px; }
  .card { padding: 14px 18px 12px; }
  .logo-wrap { width: 36px; height: 36px; margin: 0 auto 2px; }
  .head { margin-bottom: 8px; }
  h1 { font-size: 21px; margin: 2px 0; }
  .head p { font-size: 12px; }
  .tabs { margin-bottom: 8px; }
  .google { height: 40px; margin-bottom: 6px; }
  .or { margin: 0 0 6px; }
  form { gap: 7px; }
  .field input { height: 46px; padding: 16px 14px 3px; }
  .primary { height: 44px; }
  .foot { margin-top: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
/* phones: headings scale with the screen (320px → 720px) instead of staying at one size;
   form fields at 16px so iPhones don't zoom the page when one is tapped */
@media (max-width: 720px) {
  .done h2 { font-size: clamp(20px, 16.8px + 1vw, 24px); }
  input, select, textarea { font-size: 16px; }
  .field input { font-size: 16px; }
}
/* phones: form fields in the page's own font (not the browser's default), placeholders and the chosen value in drop-downs
   at 14px, closer to the small field names above them (they were 16px and looked oversized), 2026-11-19. Typed text
   stays 16px so iPhones don't zoom. Fields with their own font or size rule keep it. Phones only. */
@media (max-width: 720px) {
  html body :is(input, select, textarea) { font-family: inherit; }
  html body :is(input, textarea):not(.code)::placeholder { font-size: min(14px, 1em); }
  html body select:not([multiple]) { font-size: 14px; }
}

/* the CaratIQ logo (2026-11-23, the client's final logo): the wordmark in place of the animated logo and the "Design Finder" line.
   components/icons.jsx CaratIQ: the light-theme picture has dark text, the dark-theme one white text. */
.logo-wrap.ciq-wrap { width: auto; height: clamp(32px, 5.5vh, 46px); margin: 0 auto clamp(6px, 1.4vh, 14px); display: flex; justify-content: center; }
.ciq-wrap .ciq { display: flex; height: 100%; }
.ciq-wrap .ciq img { display: none; height: 100%; width: auto; }
.ciq-wrap .ciq .ciq-full.ciq-l { display: block; }
html[data-theme="dark"] .ciq-wrap .ciq .ciq-full.ciq-l { display: none; }
html[data-theme="dark"] .ciq-wrap .ciq .ciq-full.ciq-d { display: block; }
html[data-theme="dark"] .ciq-wrap .ciq img { box-shadow: none; background: none; }   /* ui/theme.css outlines every .card img in dark mode */
@media (max-width: 480px) { .logo-wrap.ciq-wrap { height: 32px; margin: 0 auto 6px; } }
