/* fred.my/qr — penjana kod QR. Header & footer: /shared/chrome.css */
:root {
    --bg: #f4f6fb; --card: #fff; --ink: #0b1220; --ink-2: #1e293b; --muted: #5b6b82; --line: #e3e8f1;
    --accent: #1d4ed8; --accent-2: #1e3a8a; --soft: #eef3ff; --ok: #047857;
    --r: 20px; --font: var(--fm-font, "Jakarta", system-ui, sans-serif); --display: var(--fm-display, "Outfit", system-ui, sans-serif);
    color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15.5px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2 { font-family: var(--display); letter-spacing: -.015em; line-height: 1.2; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }
[hidden] { display: none !important; }

.q-wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* ---- Hero ---- */
.q-hero { padding: 44px 0 28px; background: radial-gradient(700px 260px at 85% -20%, rgba(124, 58, 237, .14), transparent 70%), radial-gradient(600px 260px at 0 0, rgba(2, 132, 199, .12), transparent 70%); }
.q-hero h1 { margin: 0 0 .6rem; font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3rem); font-weight: 800; max-width: 20ch; }
.q-hero h1 span { display: block; background: linear-gradient(90deg, #0284c7, #7c3aed); -webkit-background-clip: text; background-clip: text; color: transparent; }
.q-lead { margin: 0 0 1.1rem; max-width: 64ch; color: var(--muted); font-size: 1.05rem; }
.q-badges { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.q-badges li { padding: 6px 12px 6px 30px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: .84rem; font-weight: 650; color: var(--ink-2); position: relative; }
.q-badges li::before { content: ""; position: absolute; left: 11px; top: 50%; width: 12px; height: 7px; border: solid var(--ok); border-width: 0 0 2.5px 2.5px; transform: translateY(-70%) rotate(-45deg); }

/* ---- Aplikasi ---- */
.q-app { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; padding-bottom: 40px; }
.q-form { display: grid; gap: 20px; min-width: 0; }
.q-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 18px 40px -30px rgba(15, 23, 42, .35); }
.q-h { margin: 0 0 14px; font-size: 1.15rem; }
.q-types { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.q-type { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-weight: 650; font-size: .9rem; color: var(--muted); cursor: pointer; transition: .15s; }
.q-type:hover { color: var(--ink); border-color: #c7d3ea; }
.q-type.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.q-pane { display: grid; gap: 12px; }
.q-field { display: grid; gap: 6px; min-width: 0; }
.q-field > span { font-size: .85rem; font-weight: 650; color: var(--ink-2); }
.q-field input:not([type=range]), .q-field select, .q-field textarea { width: 100%; padding: 11px 13px; border: 1px solid #d5ddeb; border-radius: 12px; background: #fff; font-size: 1rem; transition: border-color .15s, box-shadow .15s; }
.q-field textarea { resize: vertical; min-height: 84px; }
.q-field input:focus, .q-field select:focus, .q-field textarea:focus { outline: none; border-color: #93b4fb; box-shadow: 0 0 0 4px rgba(59, 130, 246, .15); }
.q-field input[type=range] { width: 100%; accent-color: var(--accent); }
.q-field output { color: var(--accent); font-weight: 750; margin-left: 4px; }
.q-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.q-hint { margin: 0; font-size: .82rem; color: var(--muted); }
.q-check { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 600; cursor: pointer; }
.q-check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.q-checks { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 10px; }

.q-set { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.q-set legend { padding: 0; margin-bottom: 8px; font-size: .85rem; font-weight: 700; color: var(--ink-2); }
.q-styles { display: flex; flex-wrap: wrap; gap: 8px; }
.q-style { cursor: pointer; }
.q-style input { position: absolute; opacity: 0; pointer-events: none; }
.q-style span { display: grid; justify-items: center; gap: 4px; width: 84px; padding: 10px 6px 8px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; transition: .15s; }
.q-style svg { width: 30px; height: 30px; fill: currentColor; color: var(--ink-2); }
.q-style small { font-size: .72rem; font-weight: 650; color: var(--muted); text-align: center; line-height: 1.2; }
.q-style:hover span { border-color: #c7d3ea; }
.q-style input:checked + span { border-color: var(--accent); background: var(--soft); box-shadow: 0 0 0 3px rgba(59, 130, 246, .15); }
.q-style input:checked + span svg { color: var(--accent); }
.q-style input:focus-visible + span { outline: 2px solid #3b82f6; outline-offset: 2px; }

.q-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.q-preset { display: inline-flex; padding: 4px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.q-preset:hover { border-color: #c7d3ea; transform: translateY(-1px); }
.q-sw { width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .15); }
.q-sw + .q-sw { margin-left: -6px; }
.q-colors { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.q-color { display: grid; gap: 6px; justify-items: start; font-size: .82rem; font-weight: 650; color: var(--muted); }
.q-color input { width: 100%; height: 44px; padding: 3px; border: 1px solid #d5ddeb; border-radius: 12px; background: #fff; cursor: pointer; }
.q-color input:disabled { opacity: .35; cursor: not-allowed; }

.q-logo { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }
.q-file input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.q-logo__img { width: 48px; height: 48px; object-fit: contain; border-radius: 10px; border: 1px solid var(--line); background: #fff; padding: 4px; }
.q-logo-opts { margin-top: 12px; }
.q-adv summary { cursor: pointer; font-weight: 700; font-size: .9rem; color: var(--ink-2); }
.q-adv[open] summary { margin-bottom: 12px; }

.q-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 0 16px; border-radius: 12px; border: 1px solid #d5ddeb; background: #fff; font-weight: 750; font-size: .95rem; cursor: pointer; transition: .15s; position: relative; }
.q-btn:hover:not(:disabled) { border-color: #9fb5e0; }
.q-btn--primary { background: linear-gradient(135deg, #1d4ed8, #7c3aed); border-color: transparent; color: #fff; box-shadow: 0 12px 24px -14px rgba(29, 78, 216, .8); }
.q-btn--primary:hover:not(:disabled) { filter: brightness(1.08); }
.q-btn:disabled { opacity: .45; cursor: not-allowed; }
.q-btn--ghost { background: var(--soft); border-color: #cfdcfb; color: var(--accent); }
.q-link { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---- Pratonton ---- */
.q-side { position: sticky; top: calc(var(--fm-bar-h, 64px) + 16px); }
.q-preview { display: grid; gap: 14px; }
.q-preview__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.q-preview__head .q-h { margin: 0; }
.q-tag { font-size: .74rem; font-weight: 700; color: #92400e; background: #fef3c7; border-radius: 999px; padding: 3px 10px; }
.q-canvas { aspect-ratio: 1; display: grid; place-items: center; border-radius: 16px; background: repeating-conic-gradient(#f1f4f9 0 25%, #fff 0 50%) 0 0 / 20px 20px; border: 1px solid var(--line); overflow: hidden; }
.q-canvas svg, .q-canvas canvas { width: 100% !important; height: auto !important; max-width: 320px; display: block; }
.q-canvas.is-sample svg, .q-canvas.is-sample canvas { opacity: .28; filter: grayscale(1); }
.q-err { margin: 0; padding: 10px 12px; border-radius: 12px; background: #fef2f2; color: #b91c1c; font-size: .88rem; font-weight: 600; }
.q-dl { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; }
.q-tip { padding: 10px 12px; border-radius: 12px; background: #f8fafc; border: 1px dashed var(--line); }
.q-reset { justify-self: start; font-size: .88rem; }
.q-privacy { margin: 0; font-size: .78rem; color: var(--muted); padding-left: 22px; position: relative; }
.q-privacy::before { content: ""; position: absolute; left: 2px; top: 3px; width: 12px; height: 14px; border-radius: 3px 3px 6px 6px; border: 2px solid var(--ok); }

/* ---- Kandungan SEO ---- */
.q-info { padding-bottom: 56px; }
.q-info h2 { font-size: 1.5rem; margin: 36px 0 14px; }
.q-steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.q-steps li { counter-increment: s; padding: 18px; border-radius: 18px; background: #fff; border: 1px solid var(--line); display: grid; gap: 4px; }
.q-steps li::before { content: counter(s); width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, #0284c7, #7c3aed); color: #fff; font: 800 1rem/1 var(--display); margin-bottom: 6px; }
.q-steps b, .q-feat b, .q-app-link b { font-family: var(--display); font-size: 1.02rem; }
.q-steps span, .q-feat p, .q-app-link span { color: var(--muted); font-size: .9rem; margin: 0; }
.q-feats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.q-feat { padding: 18px 20px; border-radius: 18px; background: #fff; border: 1px solid var(--line); }
.q-feat p { margin-top: 4px; }
.q-faq { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 6px 20px; }
.q-faq details { border-top: 1px solid var(--line); padding: 14px 0; }
.q-faq details:first-child { border-top: 0; }
.q-faq summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.q-faq summary::-webkit-details-marker { display: none; }
.q-faq summary::after { content: "+"; color: var(--accent); font-weight: 800; }
.q-faq details[open] summary::after { content: "–"; }
.q-faq p { margin: 8px 0 0; color: var(--muted); }
.q-apps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.q-app-link { display: grid; gap: 4px; padding: 18px; border-radius: 18px; background: #fff; border: 1px solid var(--line); color: inherit; text-decoration: none; transition: .15s; }
.q-app-link:hover { border-color: #b9cbf5; transform: translateY(-2px); }

@media (max-width: 980px) {
    .q-app { grid-template-columns: 1fr; }
    .q-form { display: contents; }
    .q-form > .q-card:first-child { order: 1; }
    .q-side { position: static; order: 2; }
    .q-form > .q-card:nth-child(2) { order: 3; }
    .q-preview { grid-template-columns: minmax(0, 220px) minmax(0, 1fr); align-items: start; }
    .q-preview__head, .q-err { grid-column: 1 / -1; }
    .q-canvas { grid-row: span 5; }
    .q-steps { grid-template-columns: 1fr 1fr; }
    .q-apps { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
    .q-wrap { padding: 0 14px; }
    .q-hero { padding: 28px 0 20px; }
    .q-badges li { font-size: .78rem; padding: 5px 10px 5px 27px; }
    .q-card { padding: 16px; border-radius: 18px; }
    .q-preview { grid-template-columns: 1fr; }
    .q-canvas { grid-row: auto; max-width: 240px; width: 100%; justify-self: center; }
    .q-row, .q-feats, .q-steps { grid-template-columns: 1fr; }
    .q-colors { grid-template-columns: 1fr 1fr; }
    .q-style span { width: 74px; }
    .q-dl { grid-template-columns: 1fr 1fr; }
    .q-dl .q-btn--primary { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
