/* File: /assets/css/help-center.css
   Module: the Help Center at /contact/ (page-contact.php). Prefix chhc-.

   The request is four steps on the left; the reply time sits beside them on
   a desktop (sticky) and between the plan and the message on a phone. The
   level card marks the active level with a class only, in boxes sized from
   the first paint, so nothing moves. Green is a free action, blue is Premium.
   Every color is a theme token from style.css. */

.chhc { max-width: var(--wrap); margin: 0 auto; padding: 56px var(--gut) 0; }

.chhc-hero { max-width: 46rem; }
.chhc-h1 { margin: 0 0 14px; font-family: var(--serif); font-size: clamp(2.5rem, 1.7rem + 2.6vw, 3.75rem); font-weight: 400; line-height: 1.04; letter-spacing: -0.02em; }
.chhc-sub { margin: 0; color: var(--fg-2); font-size: 1.125rem; line-height: 1.6; }
.chhc-sub strong { color: var(--fg); font-weight: 500; }

/* ---------------------------------------------------------------- steps and tiles */

.chhc-form { display: grid; grid-template-columns: minmax(0, 1fr); margin-top: 40px; counter-reset: chhc-step; }

@media (min-width: 1025px) {
    .chhc-form { grid-template-columns: minmax(0, 1fr) 340px; column-gap: 32px; }
    .chhc-step { grid-column: 1; }
    .chhc-level { position: sticky; top: 84px; grid-column: 2; grid-row: 1 / span 6; align-self: start; }
}

.chhc-step {
    min-width: 0;
    margin: 0 0 16px;
    padding: 22px 24px 24px;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    counter-increment: chhc-step;
}
/* A floated legend sits inside the fieldset; the element after it clears the float. */
.chhc-legend { float: left; display: flex; align-items: center; gap: 10px; width: 100%; margin: 0 0 16px; padding: 0; color: var(--fg); font-size: 1.0625rem; font-weight: 600; }
.chhc-legend + * { clear: both; }
.chhc-step-n { display: inline-grid; flex: none; place-items: center; width: 26px; height: 26px; background: var(--bg-3); color: var(--fg-2); border-radius: 50%; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chhc-step-n::before { content: counter(chhc-step); }
.chhc-hint { margin: 0 0 14px; color: var(--fg-2); font-size: 14px; line-height: 1.55; }
.chhc-hint a, .chhc-who a { color: var(--blue); font-weight: 500; }

/* With the script, the platform step and the address field show only where they apply. */
.chhc.is-js .chhc-step[data-step="platform"]:not(.is-on),
.chhc.is-js [data-chhc-site]:not(.is-on) { display: none; }

.chhc-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.chhc-tiles.is-plans { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.chhc-tile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    margin: 0;
    padding: 8px 36px 8px 10px;
    background: var(--bg);
    border: 1px solid var(--line-2);
    border-radius: var(--r);
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
}
.chhc-tile.is-plan { justify-content: center; padding: 8px 36px; text-align: center; }
.chhc-tile input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.chhc-tile:hover { border-color: var(--fg-3); }
/* The check in the corner, drawn in CSS. */
.chhc-tile::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 12px;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    border: 1.5px solid var(--line-2);
    border-radius: 50%;
}
.chhc-tile:has(input:checked) { background: var(--green-soft); border-color: var(--green); }
.chhc-tile:has(input:checked)::after {
    background: var(--green-fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 10px no-repeat;
    border-color: var(--green-fill);
}
.chhc-tile.is-pro:has(input:checked) { background: rgba(37, 99, 235, 0.1); border-color: var(--blue); }
.chhc-tile.is-pro:has(input:checked)::after { background-color: #2563eb; border-color: #2563eb; }
.chhc-tile:has(input:focus-visible) { outline: 2px solid var(--green); outline-offset: 2px; }
/* A signed-in account answers for its plan: the other plans step back. */
.chhc-tile:has(input:disabled) { cursor: default; }
.chhc-tile:has(input:disabled:not(:checked)) { opacity: 0.5; }
.chhc-tile-ico { display: inline-grid; flex: none; place-items: center; width: 32px; height: 32px; background: var(--bg-3); color: var(--green); border-radius: 9px; }
/* Logos keep their own colors on a white chip in both themes. */
.chhc-tile-ico.is-logo { background: #ffffff; }
.chhc-tile-name { color: var(--fg); font-size: 15px; font-weight: 500; line-height: 1.3; }

.chhc-error { margin: 8px 0 0; color: var(--red); font-size: 14px; font-weight: 500; }
.chhc-error:empty { display: none; }
.chhc-step.has-error, .chhc-field.has-error input, .chhc-field.has-error textarea { border-color: var(--red); }

/* ---------------------------------------------------------------- fields and send */

.chhc-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; }
@media (min-width: 641px) { .chhc-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.chhc-field { margin: 0 0 16px; }
.chhc-field label { display: block; margin: 0 0 6px; color: var(--fg); font-size: 14px; font-weight: 500; }
.chhc-opt { margin-left: 4px; color: var(--fg-3); font-weight: 400; }
.chhc-field input, .chhc-field textarea { display: block; width: 100%; padding: 11px 14px; background: var(--bg); font-size: 16px; line-height: 1.5; }
.chhc-field textarea { min-height: 170px; resize: vertical; }
.chhc-field input::placeholder, .chhc-field textarea::placeholder { color: var(--fg-3); }
.chhc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.chhc-send { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 4px; }
.chhc .chhc-btn,
.chhc .chhc-btn:focus,
.chhc .chhc-btn:active {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 22px;
    background: var(--green-fill);
    color: var(--on-green);
    border: 0;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
}
.chhc .chhc-btn:hover, .chhc .chhc-btn:focus-visible { background: var(--green-hi); color: var(--on-green); }
.chhc .chhc-btn[disabled] { cursor: progress; opacity: 0.85; }
.chhc-btn-ico { display: inline-flex; }
.chhc-spinner { display: none; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: chhc-spin 0.7s linear infinite; }
.chhc-btn.is-loading .chhc-spinner { display: inline-block; }
.chhc-btn.is-loading .chhc-btn-ico { display: none; }
@keyframes chhc-spin { to { transform: rotate(360deg); } }
.chhc-send-note { flex: 1 1 220px; margin: 0; color: var(--fg-2); font-size: 14px; line-height: 1.5; }
.chhc-alert { margin: 16px 0 0; padding: 12px 16px; background: rgba(239, 68, 68, 0.08); color: var(--red); border: 1px solid var(--red); border-radius: var(--r); font-size: 15px; font-weight: 500; }
.chhc-alert[hidden] { display: none; }
.chhc-noscript { margin: 16px 0 0; color: var(--fg); font-size: 15px; font-weight: 500; }
.chhc-recaptcha { margin: 16px 0 0; color: var(--fg-3); font-size: 12.5px; line-height: 1.5; }
.chhc-recaptcha a, .chhc-recaptcha a:visited { color: var(--fg-3); text-decoration: underline; text-underline-offset: 2px; }

/* ---------------------------------------------------------------- reply time */

.chhc-level { min-width: 0; margin: 0 0 16px; padding: 22px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg); }
.chhc-level-k { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--fg); font-size: 15px; font-weight: 600; }
.chhc-level-k svg { color: var(--green); }
/* Three lines are kept for the account line, so filling it moves nothing. */
.chhc-who { min-height: 4.4em; margin: 10px 0 0; color: var(--fg-2); font-size: 14px; line-height: 1.47; }
.chhc-levels { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.chhc-lv {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "name time" "who time";
    align-items: center;
    gap: 2px 14px;
    margin: 0;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--r);
    transition: border-color 0.2s, background-color 0.2s;
}
.chhc-lv-name { grid-area: name; color: var(--fg); font-size: 15px; font-weight: 600; }
.chhc-lv-who { grid-area: who; color: var(--fg-3); font-size: 13px; line-height: 1.4; }
.chhc-lv-time { grid-area: time; color: var(--fg); font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.chhc-lv.is-premium .chhc-lv-time { color: var(--blue); }
.chhc-lv.is-app .chhc-lv-time { color: var(--green); }
.chhc-lv.is-standard .chhc-lv-time { color: var(--fg-2); font-size: 1rem; }
/* "Your request": always in the box, shown on the active level only. */
.chhc-lv-tag {
    position: absolute;
    top: -9px;
    right: 12px;
    padding: 1px 8px;
    background: var(--green-fill);
    color: var(--on-green);
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s;
}
.chhc-lv.is-on .chhc-lv-tag { visibility: visible; opacity: 1; }
.chhc-lv.is-premium.is-on { background: rgba(37, 99, 235, 0.08); border-color: var(--blue); }
.chhc-lv.is-premium .chhc-lv-tag { background: #2563eb; color: #ffffff; }
.chhc-lv.is-app.is-on { background: var(--green-soft); border-color: var(--green); }
.chhc-lv.is-standard.is-on { border-color: var(--fg-3); }
.chhc-lv.is-standard .chhc-lv-tag { background: var(--fg-2); color: var(--bg); }
.chhc-level-note { margin: 12px 0 0; color: var(--fg-3); font-size: 13px; line-height: 1.5; }
.chhc .chhc-pro-link, .chhc .chhc-pro-link:visited { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; margin-top: 10px; color: var(--blue); font-size: 14px; font-weight: 500; }
.chhc .chhc-pro-link:hover, .chhc .chhc-pro-link:focus { color: var(--fg); }
.chhc-pro-link[hidden] { display: none; }

/* ---------------------------------------------------------------- sent */

.chhc-done { margin-top: 40px; padding: clamp(24px, 3vw, 36px); background: var(--bg-2); border: 1px solid var(--green); border-radius: var(--r-lg); outline: none; }
.chhc-done[data-level="premium"] { border-color: var(--blue); }
.chhc-done-ico { display: inline-flex; color: var(--green); }
.chhc-done-h2 { margin: 14px 0 6px; font-family: var(--serif); font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem); font-weight: 400; }
.chhc-done-ref { margin: 0; color: var(--fg-2); font-family: var(--mono); font-size: 14px; }
.chhc-done-ref b { color: var(--fg); }
.chhc-done-level, .chhc-done-mail { margin: 10px 0 0; color: var(--fg-2); font-size: 16px; line-height: 1.6; }
.chhc-done-level span:first-child, .chhc-done-mail b { color: var(--fg); font-weight: 600; }

/* ---------------------------------------------------------------- FAQ */

.chhc-faq { max-width: 52rem; margin-top: 88px; }
.chhc-label { margin: 0; color: var(--fg-3); font-size: 14px; font-weight: 500; }
.chhc-h2 { margin: 6px 0 20px; font-family: var(--serif); font-size: clamp(2rem, 1.5rem + 1.6vw, 2.75rem); font-weight: 400; letter-spacing: -0.02em; }
.chhc-faq-list { border-top: 1px solid var(--line); }
.chhc-q { border-bottom: 1px solid var(--line); }
.chhc-q summary { position: relative; display: block; padding: 18px 40px 18px 0; color: var(--fg); font-size: 17px; font-weight: 500; line-height: 1.4; list-style: none; cursor: pointer; }
.chhc-q summary::-webkit-details-marker { display: none; }
.chhc-q summary::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 6px;
    width: 9px;
    height: 9px;
    margin-top: -6px;
    border-right: 1.5px solid var(--fg-3);
    border-bottom: 1.5px solid var(--fg-3);
    transform: rotate(45deg);
    transition: transform 0.2s;
}
.chhc-q[open] summary::after { margin-top: -2px; transform: rotate(225deg); }
.chhc-q p { margin: 0 0 18px; color: var(--fg-2); font-size: 16px; line-height: 1.6; }
.chhc-q p a, .chhc-q p a:visited { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }

/* ---------------------------------------------------------------- phones */

@media (max-width: 640px) {
    .chhc { padding-top: 36px; }
    .chhc-step { padding: 18px 16px 20px; }
    .chhc-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
    .chhc-tiles.is-plans { grid-template-columns: minmax(0, 1fr); }
    .chhc-tile { padding: 8px 32px 8px 8px; }
    .chhc-tile-name { font-size: 14px; }
    .chhc-tile::after { right: 10px; }
    .chhc .chhc-btn { justify-content: center; width: 100%; }
    .chhc-level { padding: 18px 16px; }
}
/* Two topic tiles in a row leave little room for a long name beside the icon. */
@media (max-width: 440px) {
    .chhc-tile:not(.is-platform) .chhc-tile-ico { display: none; }
    .chhc-tiles.is-platforms { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    .chhc *, .chhc *::before, .chhc *::after { transition: none !important; animation-duration: 0.01ms !important; }
}
