/* ══════════════════════
   CUSTOM WORKFLOW REQUEST  (templates/custom_workflow.html)
   A full-screen real photo of a valley (images/custom/valley.webp, Pixabay 7489685) with one
   frosted box in the middle that walks through the request one step at a time (describe,
   email code, questions, files, review). White text sits on a dark veil over the photo, so it stays readable on any screen.
══════════════════════ */

/* the site header floats over the photo on this page */
body:has(.cw) .site-header { position: fixed; top: 0; left: 0; right: 0; }
html.has-announce body:has(.cw) .site-header { top: var(--zn-announce-h, 40px); }

.cw {
    --cw-teal: #00A896;
    position: relative;
    min-height: max(100svh, 760px);
    display: flex; align-items: center; justify-content: center;
    padding: calc(120px + 4vh) 20px 72px;
    overflow: hidden;
    color: #fff;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: #1d3324;                       /* shown until the photo arrives */
}
.cw, .cw * { box-sizing: border-box; }
.cw-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%; }
/* the veil: darker in the middle band where the text and box sit, lighter at the edges */
.cw::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(70% 60% at 50% 46%, rgba(8, 20, 14, .58), rgba(8, 20, 14, .22) 70%, rgba(8, 20, 14, .12)),
        linear-gradient(to bottom, rgba(8, 20, 14, .35), rgba(8, 20, 14, 0) 30%, rgba(8, 20, 14, .30));
}
.cw-inner { position: relative; z-index: 1; width: 100%; max-width: 760px; text-align: center; }

.cw-pill {
    display: inline-flex; align-items: center; gap: 10px;
    margin: 0; padding: 6px 14px 6px 6px; border-radius: 999px;
    background: rgba(10, 18, 14, .62); border: 1px solid rgba(255, 255, 255, .16);
    font-size: .8rem; font-weight: 500; color: rgba(255, 255, 255, .92);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.cw-pill b { padding: 3px 9px; border-radius: 999px; background: #fff; color: #0f172a; font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }

.cw-title {
    margin: 22px 0 0;
    font-family: 'Inter Tight', 'Inter', system-ui, sans-serif;
    font-size: clamp(2.2rem, 5.6vw, 4rem); font-weight: 300; letter-spacing: -.03em; line-height: 1.05;
    text-shadow: 0 2px 24px rgba(0, 0, 0, .35);
    text-wrap: balance;
}
.cw-title strong { font-weight: 700; }
.cw-title em { font-style: italic; font-weight: 300; }
.cw-sub { margin: 16px auto 0; max-width: 34rem; font-size: 1.06rem; line-height: 1.6; color: rgba(255, 255, 255, .9); text-shadow: 0 1px 12px rgba(0, 0, 0, .4); }

/* the prompt box */
.cw-box {
    margin: 30px auto 0; padding: 14px; text-align: left;
    border-radius: 22px;
    background: rgba(14, 22, 18, .62);
    border: 1px solid rgba(255, 255, 255, .18);
    box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .7);
    -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
}
.cw-box:focus-within { border-color: rgba(255, 255, 255, .38); }
.cw-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.cw-files { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.cw-files:not(:empty) { margin-bottom: 10px; }
.cw-files li {
    display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
    padding: 6px 6px 6px 10px; border-radius: 10px;
    background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .14);
    font-size: .82rem; font-weight: 500;
}
.cw-files li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.cw-files li small { color: rgba(255, 255, 255, .6); font-size: .74rem; }
.cw-files li button {
    width: 22px; height: 22px; border: 0; border-radius: 6px; cursor: pointer;
    background: rgba(255, 255, 255, .12); color: #fff; font-size: 14px; line-height: 1;
}
.cw-files li button:hover { background: rgba(255, 255, 255, .26); }

.cw-text {
    display: block; width: 100%; min-height: 96px; resize: vertical;
    padding: 8px 8px 4px; border: 0; outline: 0; background: transparent;
    color: #fff; font: inherit; font-size: 1.04rem; line-height: 1.55;
}
.cw-text::placeholder { color: rgba(255, 255, 255, .55); }

.cw-attach {
    position: relative; flex: none;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 12px; border-radius: 10px; cursor: pointer;
    background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16);
    font-size: .86rem; font-weight: 600;
    transition: background .15s;
}
.cw-attach:hover { background: rgba(255, 255, 255, .2); }
.cw-attach svg { width: 16px; height: 16px; }
.cw-attach input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.cw-attach:focus-within { outline: 2px solid #fff; outline-offset: 2px; }
.cw-go:focus-visible, .cw-next:focus-visible, .cw-chips button:focus-visible, .cw-opt:focus-visible, .cw-back:focus-visible, .cw-skip:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* ── the steps ── */
.cw-step[hidden] { display: none; }
.cw-step { padding: 4px 8px 0; }
.cw-step[data-step="describe"] { padding: 0; }
.cw-progress { display: flex; align-items: center; gap: 12px; padding: 2px 8px 12px; font-size: .74rem; font-weight: 600; color: rgba(255, 255, 255, .7); }
.cw-progress[hidden] { display: none; }
.cw-progress i { flex: 1 1 auto; height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .16); overflow: hidden; }
.cw-progress b { display: block; height: 100%; width: 0; border-radius: 99px; background: #fff; transition: width .3s ease; }
.cw-q { margin: 0; font-family: 'Inter Tight', 'Inter', sans-serif; font-size: 1.3rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.25; }
.cw-help { margin: 6px 0 0; font-size: .88rem; line-height: 1.5; color: rgba(255, 255, 255, .74); }
.cw-help b { color: #fff; font-weight: 600; }

.cw-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.cw-fields--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cw-fields label, .cw-inline { display: block; }
.cw-inline { margin-top: 14px; }
.cw-fields span, .cw-inline span { display: block; margin-bottom: 5px; font-size: .76rem; font-weight: 600; color: rgba(255, 255, 255, .78); }
.cw-fields input, .cw-inline input, .cw-code, .cw-text--boxed {
    width: 100%; padding: 10px 12px; border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .1);
    color: #fff; font: inherit; font-size: .95rem; outline: 0;
}
.cw-fields input:focus, .cw-inline input:focus, .cw-code:focus, .cw-text--boxed:focus { border-color: #fff; background: rgba(255, 255, 255, .16); }
.cw-fields input::placeholder, .cw-inline input::placeholder { color: rgba(255, 255, 255, .45); }
.cw-text--boxed { margin-top: 14px; min-height: 110px; }
.cw-code { margin-top: 14px; max-width: 220px; font-family: 'Courier New', monospace; font-size: 1.6rem; font-weight: 700; letter-spacing: .4em; text-align: center; }
.cw-code-links { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; }
.cw-link { padding: 0; border: 0; background: none; cursor: pointer; color: #fff; font: inherit; font-size: .86rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.cw-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.cw-opt {
    padding: 10px 16px; border-radius: 999px; cursor: pointer;
    background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .22);
    color: #fff; font: inherit; font-size: .92rem; font-weight: 600;
    transition: background .15s, border-color .15s, color .15s;
}
.cw-opt:hover { background: rgba(255, 255, 255, .18); }
.cw-opt[aria-pressed="true"] { background: #fff; border-color: #fff; color: #0f172a; }

.cw-optin { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; font-size: .84rem; color: rgba(255, 255, 255, .86); cursor: pointer; }
.cw-optin input { margin-top: 3px; accent-color: var(--cw-teal); }
.cw .cw-notice { margin: 10px 0 0; font-size: .76rem; line-height: 1.5; color: rgba(255, 255, 255, .7); }
.cw .cw-notice a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.cw-step[data-step="files"] .cw-files { margin-top: 14px; }
.cw-step[data-step="files"] .cw-attach { margin-top: 12px; }

.cw-review { margin: 14px 0 0; display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; font-size: .9rem; max-height: 240px; overflow: auto; }
.cw-review dt { color: rgba(255, 255, 255, .64); font-weight: 600; }
.cw-review dd { margin: 0; color: #fff; white-space: pre-wrap; overflow-wrap: anywhere; }

/* back, skip and the main button */
.cw-nav { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 0 2px; }
.cw-nav-gap { flex: 1 1 auto; }
.cw-back, .cw-skip { padding: 10px 14px; border: 0; border-radius: 999px; background: none; cursor: pointer; color: rgba(255, 255, 255, .84); font: inherit; font-size: .9rem; font-weight: 600; }
.cw-back:hover, .cw-skip:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.cw-back[hidden], .cw-skip[hidden] { display: none; }
.cw-next {
    padding: 12px 24px; border: 0; border-radius: 999px; cursor: pointer;
    background: #fff; color: #0f172a; font: inherit; font-size: .95rem; font-weight: 700;
    transition: transform .15s, background .15s;
}
.cw-next:hover { transform: translateY(-1px); background: #e6fffa; }
.cw-next[disabled] { opacity: .6; cursor: default; transform: none; }

.cw-msg { margin: 10px 8px 0; min-height: 0; font-size: .88rem; font-weight: 600; color: #fecaca; }
.cw-msg:empty { display: none; }

.cw-done { margin: 30px auto 0; padding: 28px 24px; border-radius: 22px; background: rgba(14, 22, 18, .66); border: 1px solid rgba(255, 255, 255, .18); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.cw-done[hidden] { display: none; }
.cw-done h2 { margin: 0; font-family: 'Inter Tight', 'Inter', sans-serif; font-size: 1.5rem; font-weight: 600; letter-spacing: -.02em; }
.cw-done p { margin: 10px 0 0; color: rgba(255, 255, 255, .88); line-height: 1.6; }
.cw-done a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

/* quick starts */
.cw-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.cw-chips[hidden] { display: none; }
.cw-chips button {
    padding: 8px 14px; border-radius: 999px; cursor: pointer;
    background: rgba(10, 18, 14, .5); border: 1px solid rgba(255, 255, 255, .2);
    color: #fff; font: inherit; font-size: .84rem; font-weight: 600;
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    transition: background .15s, border-color .15s;
}
.cw-chips button:hover { background: rgba(10, 18, 14, .78); border-color: rgba(255, 255, 255, .5); }

@media (max-width: 640px) {
    .cw { padding: 130px 14px 48px; min-height: max(100svh, 700px); align-items: flex-start; }
    .cw-fields, .cw-fields--2 { grid-template-columns: 1fr; }
    .cw-review { grid-template-columns: 1fr; gap: 2px 0; }
    .cw-review dd { margin-bottom: 8px; }
    .cw-q { font-size: 1.15rem; }
}
@media (prefers-reduced-motion: reduce) {
    .cw-next, .cw-opt, .cw-attach, .cw-chips button, .cw-progress b { transition: none; }
}
