/* Google Forms look-alike — used by public forms and the admin form builder */
:root { --theme: #673ab7; --g-text: #202124; --g-muted: #5f6368; --g-line: #dadce0; --g-err: #d93025; --g-blue: #4285f4; }
* { box-sizing: border-box; }
body.gf {
  margin: 0; min-height: 100vh; color: var(--g-text);
  font-family: Roboto, 'Noto Sans Devanagari', Arial, sans-serif; font-size: 14px; line-height: 1.5;
  background: #f0ebf8;
  background: color-mix(in srgb, var(--theme) 12%, #f8f9fa);
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.gf-wrap { max-width: 770px; margin: 0 auto; padding: 12px 10px 40px; }
@media (min-width: 680px) { .gf-wrap { padding: 12px 16px 48px; } }

.g-card { background: #fff; border: 1px solid var(--g-line); border-radius: 8px; padding: 22px 20px; margin-bottom: 12px; position: relative; }
@media (min-width: 680px) { .g-card { padding: 24px; } }
.gf-head { border-top: 10px solid var(--theme); padding-top: 22px; }
.gf-head h1 { font-size: 28px; font-weight: 400; margin: 0 0 8px; line-height: 1.3; overflow-wrap: anywhere; }
@media (min-width: 680px) { .gf-head h1 { font-size: 32px; } }
.gf-desc { font-size: 14px; white-space: normal; overflow-wrap: anywhere; }
.gf-req-note { color: var(--g-err); font-size: 14px; margin: 16px -20px 0; padding: 14px 20px 0; border-top: 1px solid var(--g-line); }
@media (min-width: 680px) { .gf-req-note { margin: 16px -24px 0; padding: 14px 24px 0; } }
.gf-confirm { font-size: 14px; margin: 8px 0 16px; }
.gf-muted { color: var(--g-muted); margin: -6px 0 16px; }
.gf-link { color: #1a73e8; text-decoration: underline; font-size: 14px; }

.gf-section { padding: 0; overflow: hidden; }
.gf-section h2 { margin: 0; background: var(--theme); color: #fff; font-size: 16px; font-weight: 500; padding: 12px 24px; }
.gf-section p { margin: 0; padding: 16px 24px; font-size: 14px; }
.gf-section h2:only-child { border-radius: 0; }

.gf-title { font-size: 16px; font-weight: 400; line-height: 1.5; margin-bottom: 6px; overflow-wrap: anywhere; letter-spacing: .1px; }
.gf-title .req { color: var(--g-err); margin-left: 4px; }
.gf-qdesc { font-size: 12.5px; color: var(--g-muted); margin: -2px 0 10px; }
.gf-input {
  display: block; width: 100%; border: 0; border-bottom: 1px solid var(--g-line); padding: 10px 0 7px; margin-top: 10px;
  font-size: 14px; outline: 0; background: transparent; transition: border-color .2s; border-radius: 0;
}
@media (min-width: 680px) { .gf-input.short, .gf-date { width: 50%; } }
.gf-input:focus { border-bottom: 2px solid var(--theme); padding-bottom: 6px; }
.gf-area { resize: none; overflow: hidden; min-height: 38px; }
.gf-date { width: auto; min-width: 180px; }
.gf-choice { display: flex; align-items: center; gap: 14px; padding: 9px 0; cursor: pointer; font-size: 14px; }
.gf-choice input { width: 20px; height: 20px; margin: 0; accent-color: var(--theme); flex: none; cursor: pointer; }
.gf-select { margin-top: 10px; padding: 11px 12px; border: 1px solid var(--g-line); border-radius: 4px; font-size: 14px; min-width: 220px; max-width: 100%; background: #fff; outline: 0; }
.gf-select:focus { border-color: var(--theme); }
.gf-clear-sel { background: none; border: 0; color: var(--g-muted); font-weight: 500; padding: 8px 0 0; cursor: pointer; font-size: 14px; float: right; }
.gf-clear-sel[hidden] { display: none; }
.gf-q { overflow: hidden; }
.has-err { border-color: var(--g-err); }
.gf-err { color: var(--g-err); font-size: 12.5px; margin-top: 12px; display: flex; gap: 8px; align-items: center; clear: both; }
.gf-hp { position: absolute; left: -5000px; opacity: 0; width: 1px; height: 1px; }
.gf-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; gap: 12px; }
.gf-submit { background: var(--theme); color: #fff; border: 0; border-radius: 4px; padding: 10px 24px; font-size: 14px; font-weight: 500; cursor: pointer; letter-spacing: .25px; min-height: 40px; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.gf-submit:hover { filter: brightness(1.08); }
.gf-submit:disabled { opacity: .7; }
.gf-clear { color: var(--theme); font-weight: 500; text-decoration: none; padding: 8px; font-size: 14px; }
.gf-foot { text-align: center; color: var(--g-muted); font-size: 12px; margin-top: 26px; line-height: 1.8; }
.gf-foot a { font-weight: 500; }
:focus-visible { outline: 2px solid var(--theme); outline-offset: 2px; }

/* ================= Builder (admin) ================= */
.gb-top { position: sticky; top: 0; z-index: 50; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.gb-bar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; }
.gb-logo { width: 34px; height: 34px; border-radius: 6px; background: var(--theme); color: #fff; display: grid; place-items: center; flex: none; }
.gb-name { flex: 1; min-width: 0; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 6px; }
.gb-state { font-size: 12px; color: var(--g-muted); white-space: nowrap; display: none; }
@media (min-width: 680px) { .gb-state { display: inline; } }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--g-muted); flex: none; text-decoration: none; }
.icon-btn:hover { background: #f1f3f4; }
.icon-btn:disabled { opacity: .35; cursor: default; background: none; }
.icon-btn svg { width: 22px; height: 22px; }
.gb-send { background: var(--theme); color: #fff; border: 0; border-radius: 4px; padding: 9px 18px; font-weight: 500; cursor: pointer; min-height: 38px; }
.gb-save { background: #fff; color: var(--theme); border: 1px solid var(--g-line); border-radius: 4px; padding: 8px 14px; font-weight: 500; cursor: pointer; min-height: 38px; }
.gb-save.dirty { border-color: var(--theme); }
.gb-tabs { display: flex; justify-content: center; gap: 4px; }
.gb-tabs a, .gb-tabs button { border: 0; background: none; padding: 10px 12px 9px; font-weight: 500; color: var(--g-muted); border-bottom: 3px solid transparent; cursor: pointer; text-decoration: none; font-size: 14px; }
.gb-tabs .on { color: var(--theme); border-bottom-color: var(--theme); }
.gb-tabs .count { background: var(--theme); color: #fff; border-radius: 10px; padding: 0 6px; font-size: 11px; margin-left: 4px; }
.gb-wrap { padding-bottom: 120px; }

.gb-head input, .gb-head textarea { display: block; width: 100%; border: 0; border-bottom: 1px solid transparent; outline: 0; background: transparent; padding: 4px 0; resize: none; }
.gb-head input:hover, .gb-head textarea:hover { border-bottom-color: var(--g-line); }
.gb-head input:focus, .gb-head textarea:focus { border-bottom: 2px solid var(--theme); }
.gb-ftitle { font-size: 28px; line-height: 1.3; margin-bottom: 8px; }
@media (min-width: 680px) { .gb-ftitle { font-size: 32px; } }
.gb-fdesc { font-size: 14px; overflow: hidden; }

.q-card { cursor: default; transition: box-shadow .2s; }
.q-card.active { box-shadow: 0 1px 3px rgba(60,64,67,.3), 0 4px 8px 3px rgba(60,64,67,.15); }
.q-card.active::before { content: ''; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 6px; background: var(--g-blue); border-radius: 8px 0 0 8px; }
.q-move { position: absolute; top: 2px; left: 50%; transform: translateX(-50%); display: flex; gap: 2px; }
.q-move .icon-btn { width: 30px; height: 26px; border-radius: 6px; }
.q-move .icon-btn svg { width: 18px; height: 18px; }
.q-head { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.q-title { flex: 1 1 260px; font-size: 16px; padding: 14px 12px; background: #f8f9fa; border: 0; border-bottom: 1px solid #80868b; outline: 0; border-radius: 4px 4px 0 0; min-width: 0; }
.q-title:focus { border-bottom: 2px solid var(--theme); background: #f1f3f4; }
.q-card.sec .q-title { font-size: 20px; }
.q-type { flex: 0 0 auto; min-width: 210px; padding: 12px; border: 1px solid var(--g-line); border-radius: 4px; background: #fff; outline: 0; cursor: pointer; }
@media (max-width: 560px) { .q-type { flex: 1 1 100%; min-width: 0; } }
.q-desc { display: block; width: 100%; border: 0; border-bottom: 1px solid transparent; padding: 8px 0; margin-top: 8px; outline: 0; font-size: 13px; color: var(--g-muted); }
.q-desc:hover { border-bottom-color: var(--g-line); }
.q-desc:focus { border-bottom: 2px solid var(--theme); color: var(--g-text); }
.opts { margin-top: 12px; }
.opt { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.opt-ico { width: 20px; height: 20px; border: 2px solid #bdc1c6; flex: none; }
.opt-ico.multiple { border-radius: 50%; }
.opt-ico.checkbox { border-radius: 3px; }
.opt-ico.dropdown { border: 0; width: 20px; text-align: right; color: var(--g-muted); font-size: 14px; height: auto; }
.opt-in { flex: 1; min-width: 0; border: 0; border-bottom: 1px solid transparent; padding: 9px 0; font-size: 14px; outline: 0; background: transparent; }
.opt-in:hover { border-bottom-color: var(--g-line); }
.opt-in:focus { border-bottom: 2px solid var(--theme); }
.opt .icon-btn { width: 36px; height: 36px; }
.link-btn { border: 0; background: none; color: var(--g-muted); cursor: pointer; padding: 9px 0; font-size: 14px; border-bottom: 1px solid transparent; }
.link-btn:hover { border-bottom-color: var(--g-line); }
.q-preview { border-bottom: 1px dotted #bdc1c6; color: #70757a; font-size: 14px; padding: 10px 0 6px; width: 60%; margin-top: 16px; }
.q-preview.long { width: 85%; }
.q-foot { display: flex; justify-content: flex-end; align-items: center; gap: 4px; border-top: 1px solid var(--g-line); margin-top: 18px; padding-top: 8px; }
.q-foot .sep { width: 1px; height: 30px; background: var(--g-line); margin: 0 10px; }
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-size: 14px; user-select: none; }
.tgl { appearance: none; -webkit-appearance: none; width: 36px; height: 14px; border-radius: 7px; background: #bdc1c6; position: relative; cursor: pointer; margin: 0 4px; transition: background .2s; flex: none; }
.tgl::after { content: ''; position: absolute; top: -3px; left: -4px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4); transition: left .2s, background .2s; }
.tgl:checked { background: color-mix(in srgb, var(--theme) 45%, #fff); }
.tgl:checked::after { left: 20px; background: var(--theme); }

.gb-float {
  position: fixed; z-index: 40; background: #fff; border: 1px solid var(--g-line); border-radius: 8px; box-shadow: 0 2px 6px rgba(0,0,0,.15);
  display: flex; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); padding: 4px; gap: 4px;
}
@media (min-width: 900px) {
  .gb-float { flex-direction: column; left: calc(50% + 400px); transform: none; bottom: auto; top: 170px; }
}
.gb-float .icon-btn { width: 44px; height: 44px; }

.gb-set h3 { margin: 0 0 6px; font-weight: 400; font-size: 20px; }
.gb-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-top: 1px solid var(--g-line); cursor: pointer; }
.gb-row:first-of-type { border-top: 0; }
.gb-row div { display: flex; flex-direction: column; }
.gb-row small { color: var(--g-muted); font-size: 12.5px; }
.gb-row.col { flex-direction: column; align-items: stretch; cursor: default; }
.gb-area { width: 100%; min-height: 70px; border: 1px solid var(--g-line); border-radius: 4px; padding: 10px; outline: 0; resize: vertical; }
.gb-area:focus { border-color: var(--theme); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: inset 0 0 0 2px rgba(255,255,255,.4); position: relative; }
.swatch.on::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--g-text); }

.gb-modal { position: fixed; inset: 0; z-index: 100; background: rgba(32,33,36,.6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.gb-modal[hidden] { display: none; }
.gb-modal-box { background: #fff; border-radius: 8px; width: 100%; max-width: 520px; padding: 22px; box-shadow: 0 8px 30px rgba(0,0,0,.3); }
.gb-modal-box h3 { margin: 0 0 4px; font-weight: 400; font-size: 22px; }
.gb-modal-box p { margin: 0 0 16px; color: var(--g-muted); }
.share-row { display: flex; gap: 8px; }
.share-row input { flex: 1; min-width: 0; border: 0; border-bottom: 1px solid var(--g-line); padding: 8px 0; outline: 0; font-size: 14px; }
.share-btns { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.sb { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 4px; border: 1px solid var(--g-line); text-decoration: none; font-weight: 500; }
.sb.wa { background: #1faa59; color: #fff; border-color: #1faa59; }
.gb-modal-foot { display: flex; justify-content: flex-end; margin-top: 18px; }
.gb-text { background: none; border: 0; color: var(--theme); font-weight: 500; padding: 8px 12px; cursor: pointer; }
.gb-toast { position: fixed; left: 16px; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); z-index: 200; background: #323232; color: #fff; padding: 12px 18px; border-radius: 4px; font-size: 14px; box-shadow: 0 3px 10px rgba(0,0,0,.3); transition: opacity .3s; max-width: calc(100% - 32px); }
@media (min-width: 900px) { .gb-toast { bottom: 24px; } }
.gb-toast.hide { opacity: 0; pointer-events: none; }
.gb .i, .sb svg { width: 20px; height: 20px; flex: none; }
.gb-logo svg { width: 22px; height: 22px; }
.sb { white-space: nowrap; }
