/* Pages a business's customers see (rating, feedback, contact form), in the theme the business picked. */
:root {
    --page: #0f2a44;
    --over: #fff;
    --card: #fff;
    --heading: #0f2a44;
    --ink: #13202e;
    --muted: #5b6b7b;
    --line: #e2dccf;
    --line-hover: #c9c1b1;
    --field: #fff;
    --name: #0e8a8f;
    --tile: #ff6b4a;
    --tile-ink: #fff;
    --accent: #e8502f;
    --accent-ink: #fff;
    --focus: #0e8a8f;
    --tips: #fbf6ee;
    --star: #f5b400;
    --star-off: #e3e0da;
    --error: #b03a2e;
    --ok: #188038;
    --ok-bg: #e3f1e7;
    --shadow: 0 1px 2px rgb(0 0 0 / 20%), 0 16px 40px rgb(0 0 0 / 22%);
    --display: "Fraunces", Georgia, serif;
    --press: scale .45s cubic-bezier(.34, 1.56, .64, 1);
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    color-scheme: light;
}

.theme-sand {
    --page: #ece3d3; --over: #3b2a1c; --card: #fffdf8; --heading: #3b2a1c; --ink: #2b2118; --muted: #7a6a58;
    --line: #e3d8c6; --line-hover: #cbbba3; --name: #9a5b2e; --tile: #b4532a; --accent: #b4532a; --focus: #b4532a; --tips: #f6efe2;
    --shadow: 0 1px 2px rgb(59 42 28 / 10%), 0 12px 32px rgb(59 42 28 / 12%);
}
.theme-forest {
    --page: #1e3b2f; --card: #fbfaf6; --heading: #1e3b2f; --ink: #1f2a24; --muted: #5e6b63;
    --line: #dfe2d8; --line-hover: #c3c9bb; --name: #3f7a5a; --tile: #2f6b4f; --accent: #2f6b4f; --focus: #2f6b4f; --tips: #f1f3ec;
}
.theme-night {
    --page: #0f1114; --card: #1b1e23; --heading: #f4f1ea; --ink: #e4e0d8; --muted: #a39e94;
    --line: #30353d; --line-hover: #454b55; --field: #14171b; --name: #e8b04a; --tile: #e8b04a; --tile-ink: #1b1e23;
    --accent: #e8b04a; --accent-ink: #1b1e23; --focus: #e8b04a; --tips: #23272d; --star-off: #3a4049;
    --error: #ff8f7d; --ok: #5fd08e; --ok-bg: rgb(95 208 142 / 14%);
    --shadow: 0 0 0 1px rgb(255 255 255 / 6%), 0 16px 40px rgb(0 0 0 / 40%);
    color-scheme: dark;
}
.theme-white {
    --page: #f2f2f0; --over: #1a1a1a; --heading: #111; --ink: #1a1a1a; --muted: #666;
    --line: #e2e2df; --line-hover: #c8c8c4; --name: #555; --tile: #111; --accent: #111; --focus: #111; --tips: #f6f6f4;
    --shadow: 0 1px 2px rgb(0 0 0 / 6%), 0 12px 32px rgb(0 0 0 / 8%);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.55 var(--sans); color: var(--ink); background: var(--page); -webkit-font-smoothing: antialiased; }
svg { display: block; }
h1 { font-family: var(--display); font-size: 1.75rem; line-height: 1.15; font-weight: 600; letter-spacing: -.01em; color: var(--heading); margin: 0 0 .4em; }
h2 { font-size: .95rem; font-weight: 650; color: var(--heading); margin: 0 0 6px; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Page: one card on the theme's colour */
.page { width: min(460px, 100% - 28px); margin: 0 auto; padding: 18px 0 36px; }
.page__top { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.sheet { padding: 32px 28px 28px; text-align: center; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); }
@media (max-width: 400px) { .sheet { padding: 28px 20px 24px; } }
.sheet__head { margin-bottom: 20px; }
.sheet__head [hidden] { display: none; }
.avatar { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; background: var(--tile); color: var(--tile-ink); font-family: var(--display); font-size: 1.6rem; font-weight: 600; }
.logo { display: block; max-width: 200px; max-height: 72px; margin: 0 auto; object-fit: contain; }

/* The frame the business picked for its logo, or for the initial when there's no logo. */
.logo-plain .avatar { border-radius: 14px; }
.logo-rounded .logo { border-radius: 14px; }
.logo-rounded .avatar { border-radius: 18px; }
.logo-circle .logo { width: 76px; height: 76px; max-width: none; max-height: none; border-radius: 50%; object-fit: cover; }
.logo-circle .avatar { border-radius: 50%; }
.logo-outlined .logo { max-width: 180px; max-height: 64px; padding: 10px 14px; box-sizing: content-box; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 2px rgb(0 0 0 / 6%); }
.logo-outlined .avatar { border-radius: 16px; box-shadow: 0 0 0 4px var(--card), 0 0 0 5px var(--line); }
.business { margin: 10px 0 0; font-weight: 600; color: var(--name); }
.lead { color: var(--muted); }
.small { font-size: .85rem; color: var(--muted); margin: 10px 0 0; }
.colophon { margin-top: 18px; text-align: center; font-size: .8rem; color: var(--over); opacity: .72; }
.colophon p { margin: 0 0 2px; }
.colophon p:last-child { opacity: .7; }

/* Language switcher */
.languages { position: relative; font-size: .85rem; }
.languages summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; color: var(--over); font-weight: 600; background: color-mix(in srgb, var(--over) 8%, transparent); border: 1px solid color-mix(in srgb, var(--over) 18%, transparent); border-radius: 99px; cursor: pointer; }
.languages summary::-webkit-details-marker { display: none; }
.languages summary svg { width: 16px; height: 16px; }
.languages summary:hover { background: color-mix(in srgb, var(--over) 14%, transparent); }
.languages ul { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; min-width: 160px; margin: 0; padding: 4px; list-style: none; background: var(--card); border-radius: 10px; box-shadow: 0 10px 30px rgb(0 0 0 / 25%); }
.languages a { display: block; padding: 8px 12px; border-radius: 6px; color: var(--ink); text-decoration: none; }
.languages a:hover { background: var(--tips); }
.languages a[aria-current] { font-weight: 650; color: var(--name); }

/* Star rating */
.stars { display: flex; flex-direction: row-reverse; justify-content: center; gap: 4px; margin: 22px 0 4px; padding: 0; border: 0; }
.stars input { position: absolute; opacity: 0; pointer-events: none; }
.stars label { padding: 4px; border-radius: 10px; cursor: pointer; transition: var(--press); -webkit-tap-highlight-color: transparent; }
.stars svg { width: 50px; height: 50px; fill: var(--star-off); transition: fill .12s, transform .15s ease-out; }
.stars label:hover svg, .stars label:hover ~ label svg, .stars input:checked ~ label svg { fill: var(--star); }
.stars input:checked + label svg { transform: scale(1.1); }
.stars label:active { scale: .86; }
.stars input:focus-visible + label { outline: 2px solid var(--focus); }
@media (max-width: 380px) { .stars svg { width: 42px; height: 42px; } }
.stars--small { margin: 0; }
.stars--small svg { width: 36px; height: 36px; }
.rerate { margin-bottom: 22px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.rerate .rating-label { margin: 2px 0 0; font-size: .95rem; }
.rerate .small { margin-top: 2px; }
.rerate .button { margin-top: 12px; }
.rating-label { min-height: 1.6em; margin: 6px 0 18px; font-weight: 650; font-size: 1.05rem; color: var(--heading); }
.is-sending { opacity: .55; pointer-events: none; }
.js [data-rating-submit] { display: none; }

.given { display: flex; justify-content: center; gap: 2px; margin: 0 0 14px; font-size: 1.5rem; line-height: 1; color: var(--star); }
.given .off { color: var(--star-off); }

/* Buttons */
.button { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; padding: 12px 18px; border: 1.5px solid var(--accent); border-radius: 10px; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; transition: filter .15s, var(--press); -webkit-tap-highlight-color: transparent; }
.button:hover { filter: brightness(.94); }
/* iOS-style press: a control shrinks quickly while held, then springs back on release. */
.button:active { scale: .97; }
:is(.button, .stars label):active { transition-duration: .1s; transition-timing-function: ease-out; }
.button--quiet { background: transparent; color: var(--ink); border-color: var(--line); }
.button--quiet:hover { filter: none; border-color: var(--ink); }
.button--google { margin-top: 18px; background: #fff; color: #1f1f1f; border-color: #dadce0; }
.button--google:hover { filter: none; border-color: #4285f4; }
.g-logo { width: 22px; height: 22px; }

/* Forms */
.form { margin-top: 22px; text-align: left; container-type: inline-size; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; margin-bottom: 6px; font-size: .9rem; font-weight: 600; color: var(--heading); }
.field input, .field textarea { display: block; width: 100%; padding: 11px 13px; font: inherit; font-size: 16px; color: var(--ink); background: var(--field); border: 1.5px solid var(--line); border-radius: 10px; transition: border-color .15s, box-shadow .15s; }
.field input:hover, .field textarea:hover { border-color: var(--line-hover); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent); }
.field textarea { min-height: 112px; resize: vertical; }
.field-error { display: block; margin-top: 6px; color: var(--error); font-size: .85rem; font-weight: 600; }
.pair { display: grid; column-gap: 14px; }
@container (min-width: 420px) { .pair { grid-template-columns: 1fr 1fr; } }
.hint { margin: -4px 0 18px; font-size: .85rem; color: var(--muted); }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* After sending */
.done__mark { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); }
.done__mark svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.done .lead { margin: 0; }
.tips { margin: 22px 0 0; padding: 14px 18px; text-align: left; background: var(--tips); border-radius: 12px; }
.tips ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: .95rem; }
.private { margin-top: 18px; }
.private summary { cursor: pointer; color: var(--muted); font-size: .9rem; text-decoration: underline; text-underline-offset: 3px; }

/* Embedded in the business's own website: the same form without the page and card, over the host's own background */
.embedded { --accent: #0f2a44; }
.embedded, .embedded body { background: transparent; }
.embedded h1 { font-size: 1.35rem; }
.embedded .page { width: auto; padding: 4px; }
.embedded .sheet { padding: 0; text-align: left; background: none; border-radius: 0; box-shadow: none; }
.embedded .form { margin-top: 0; }
.embedded .done { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; }
.embedded .done__mark { flex: none; width: 40px; height: 40px; margin: 2px 0 0; }
.embedded .done__mark svg { width: 20px; height: 20px; }
/* Embedded on a dark website: light text on see-through fields, so the host's own colour shows through */
.embedded.tone-dark {
    --heading: #fff; --ink: rgb(255 255 255 / 88%); --muted: rgb(255 255 255 / 64%); --line: rgb(255 255 255 / 18%);
    --line-hover: rgb(255 255 255 / 34%); --field: rgb(255 255 255 / 6%); --focus: rgb(255 255 255 / 72%);
    --accent: #fff; --accent-ink: #13202e; --error: #ff9c8a; --ok: #5fd08e; --ok-bg: rgb(95 208 142 / 16%);
    color-scheme: dark;
}
.embedded .colophon { margin-top: 14px; text-align: left; font-size: .75rem; color: var(--muted); opacity: 1; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
