/* app.css — stiler for SkjemaFri-byggeren */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root { --accent: #f06c09; --dark: #24292f; }
body { font-family: 'Segoe UI', Arial, Helvetica, sans-serif; background: #f4f5f7; color: #24292f; }

/* Header */
#hdr { background: #fff; border-bottom: 1px solid #e3e5e8; position: sticky; top: 0; z-index: 50; }
.hdr-inner { max-width: 1280px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; }
.brand { font-size: 18px; cursor: pointer; display: flex; align-items: center; gap: 7px; }
.brand-free { font-size: 10px; background: #e6f4ea; color: #1e7e34; border-radius: 10px; padding: 2px 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.hflags { display: flex; gap: 4px; }
.hflag { border: 1px solid #d5d8dc; background: #fff; border-radius: 5px; padding: 4px 6px; cursor: pointer; display: flex; align-items: center; }
.hflag svg { display: block; border-radius: 2px; }
.hflag:hover { border-color: var(--accent); }
.hflag.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(240,108,9,.25); }

/* Landing */
.hero { max-width: 900px; margin: 0 auto; padding: 60px 20px 30px; text-align: center; }
.hero h1 { font-size: 42px; letter-spacing: -1px; margin-bottom: 14px; }
.hero p { font-size: 17px; color: #555; line-height: 1.55; max-width: 700px; margin: 0 auto 30px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 34px; }
@media (max-width: 700px) { .features { grid-template-columns: 1fr; } .hero h1 { font-size: 30px; } }
.feat { background: #fff; border: 1px solid #e3e5e8; border-radius: 12px; padding: 20px; text-align: center; }
.feat-i { font-size: 30px; margin-bottom: 8px; }
.feat b { display: block; margin-bottom: 5px; font-size: 15px; }
.feat span { font-size: 13px; color: #666; line-height: 1.45; }
.cta { background: var(--accent); color: #fff; font-size: 17px; font-weight: 600; border: none; border-radius: 10px; padding: 15px 34px; cursor: pointer; box-shadow: 0 4px 14px rgba(240,108,9,.35); transition: all .2s; }
.cta:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(240,108,9,.45); }

/* Malvalg */
.tpl-section { max-width: 1100px; margin: 0 auto; padding: 30px 20px 60px; }
.tpl-section h2 { font-size: 24px; margin-bottom: 18px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.tpl-card { background: #fff; border: 1px solid #e3e5e8; border-radius: 12px; padding: 18px; cursor: pointer; transition: all .18s; }
.tpl-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 6px 18px rgba(0,0,0,.09); }
.tpl-icon { width: 46px; height: 46px; border-radius: 10px; border: 1px solid #eee; display: flex; align-items: center; justify-content: center; font-size: 24px; margin-bottom: 10px; }
.tpl-name { font-weight: 600; font-size: 15px; margin-bottom: 5px; }
.tpl-desc { font-size: 12.5px; color: #666; line-height: 1.4; }
.tpl-blank { border-style: dashed; }
.tip-box { margin-top: 26px; background: #fff8ec; border: 1px solid #f0d9ac; border-radius: 10px; padding: 14px 18px; font-size: 13.5px; line-height: 1.5; color: #5a4a24; }

/* Wizard */
.wiz { max-width: 1280px; margin: 0 auto; padding: 20px; }
.wbar { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.wstep { font-size: 13px; padding: 7px 14px; border-radius: 20px; background: #e9ebee; color: #888; display: flex; align-items: center; gap: 7px; }
.wstep[data-goto] { cursor: pointer; }
.wstep.active { background: var(--accent); color: #fff; font-weight: 600; }
.wstep.done { background: #dff3e3; color: #1e7e34; }
.wnum { width: 19px; height: 19px; border-radius: 50%; background: rgba(0,0,0,.12); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.wstep.active .wnum { background: rgba(255,255,255,.25); }
.wlayout { display: block; }
.wlayout.two-pane { display: grid; grid-template-columns: minmax(380px, 520px) 1fr; gap: 18px; align-items: start; }
@media (max-width: 980px) { .wlayout.two-pane { grid-template-columns: 1fr; } }
.wmain h2 { font-size: 21px; margin-bottom: 10px; }
.hint { font-size: 12.5px; color: #777; margin-bottom: 14px; line-height: 1.45; }
.wpreview { position: sticky; top: 66px; }
.pv-label { font-size: 12px; color: #777; margin-bottom: 6px; font-weight: 600; }
#pv { width: 100%; height: calc(100vh - 130px); min-height: 480px; border: 1px solid #d5d8dc; border-radius: 10px; background: #fff; }
.wnav { display: flex; justify-content: space-between; margin-top: 22px; }
.btn-nav { border: none; border-radius: 8px; padding: 11px 24px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-nav.back { background: #e9ebee; color: #555; }
.btn-nav.next { background: var(--accent); color: #fff; }
.btn-nav:hover { filter: brightness(.95); }

/* Editor */
.ed-section { background: #fff; border: 1px solid #e3e5e8; border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.ed-sec-head { display: flex; gap: 8px; margin-bottom: 10px; align-items: center; }
.ed-sec-title { flex: 1; border: none; border-bottom: 2px solid var(--accent); font-size: 15px; font-weight: 600; padding: 5px 2px; background: transparent; color: var(--accent); }
.ed-sec-title:focus { outline: none; }
.ed-tools { display: flex; gap: 4px; }
.ed-tools button, .ed-frow2 button { border: 1px solid #d5d8dc; background: #fff; border-radius: 6px; padding: 4px 9px; cursor: pointer; font-size: 12px; }
.ed-tools button:hover, .ed-frow2 button:hover { border-color: var(--accent); }
button.danger:hover { border-color: #e74c3c; background: #fdf2f2; }
.ed-field { border: 1px solid #eceef1; border-radius: 9px; padding: 10px; margin-bottom: 8px; background: #fafbfc; }
.ed-frow { display: flex; gap: 8px; margin-bottom: 7px; }
.ed-flabel { flex: 1; border: 1px solid #d5d8dc; border-radius: 6px; padding: 7px 10px; font-size: 13.5px; }
.ed-frow select, .ed-frow2 select { border: 1px solid #d5d8dc; border-radius: 6px; padding: 6px 8px; font-size: 12.5px; background: #fff; }
.ed-frow2 { display: flex; gap: 10px; align-items: center; font-size: 12px; color: #666; }
.ed-frow2 .mini { display: flex; align-items: center; gap: 5px; }
.ed-frow2 .spacer { flex: 1; }
.ed-opts { width: 100%; margin-top: 8px; border: 1px solid #d5d8dc; border-radius: 6px; padding: 8px 10px; font-size: 12.5px; min-height: 62px; font-family: inherit; resize: vertical; }
.ed-add { border: 1px dashed #b8bdc4; background: #fff; border-radius: 8px; padding: 8px 16px; font-size: 13px; color: #555; cursor: pointer; width: 100%; }
.ed-add:hover { border-color: var(--accent); color: var(--accent); }
.ed-add-sec { margin-top: 4px; padding: 12px; font-weight: 600; }
.ed-trans { margin-top: 8px; border-top: 1px dashed #d5d8dc; padding-top: 8px; }
.trans-title { font-size: 11.5px; font-weight: 700; color: #666; margin-bottom: 6px; }
.trans-row { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.trans-row svg { flex-shrink: 0; border-radius: 2px; }
.trans-row input { flex: 1; border: 1px solid #d5d8dc; border-radius: 5px; padding: 5px 9px; font-size: 12.5px; }

/* Utseende */
.ap-group { background: #fff; border: 1px solid #e3e5e8; border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.ap-group > label { display: block; font-size: 12.5px; font-weight: 600; color: #555; margin-bottom: 7px; }
.ap-group input[type=text], .ap-group input:not([type]), .ap-group select { width: 100%; border: 1px solid #d5d8dc; border-radius: 7px; padding: 9px 12px; font-size: 14px; }
.logo-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.logo-row .ed-add { width: auto; }
.logo-thumb { max-height: 52px; max-width: 160px; border: 1px solid #eee; border-radius: 6px; padding: 3px; background: #fff; }
.swatches { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.swatch { width: 34px; height: 34px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; }
.swatch.active { border-color: #24292f; box-shadow: 0 0 0 2px #fff inset; }
#ap-custcolor { width: 34px; height: 34px; border: 1px solid #d5d8dc; border-radius: 8px; padding: 2px; cursor: pointer; background: #fff; }

/* Nedlasting */
.dl-box { max-width: 640px; margin: 30px auto; background: #fff; border: 1px solid #e3e5e8; border-radius: 14px; padding: 40px; text-align: center; }
.dl-box h2 { font-size: 26px; margin-bottom: 12px; }
.dl-box p { color: #666; font-size: 14.5px; line-height: 1.55; margin-bottom: 24px; }
.share-box { margin-top: 16px; padding-top: 16px; border-top: 1px dashed #e3e5e8; }
.share-btn { background: #fff; color: var(--accent); border: 2px solid var(--accent); border-radius: 10px; padding: 12px 26px; font-size: 15px; font-weight: 600; cursor: pointer; transition: all .2s; }
.share-btn:hover { background: var(--accent); color: #fff; }
#share-url { width: 100%; margin-top: 10px; border: 1px solid #d5d8dc; border-radius: 7px; padding: 8px 10px; font-size: 11.5px; color: #666; background: #fafbfc; }
.share-hint { font-size: 12px; color: #888; line-height: 1.5; margin-top: 10px; }
.dl-links { margin-top: 18px; font-size: 13px; }
.dl-links a { color: #777; }
.dl-links a:hover { color: var(--accent); }
.dl-box .tip-box { text-align: left; }

/* Toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #24292f; color: #fff; padding: 10px 22px; border-radius: 24px; font-size: 13.5px; z-index: 100; box-shadow: 0 4px 16px rgba(0,0,0,.3); }
