/* ==========================================================================
   KO&KO — Upitnik za uređenje interijera + kooperanti
   Koristi isključivo tokene iz main.css. Bez vanjskih knjižnica.
   ========================================================================== */

/* ---------- Ikone (CSS maske, 24px stroke) ---------- */
.up-icon {
	display: inline-block; width: 28px; height: 28px; flex: none;
	background: currentColor;
	-webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat;
}
.up-icon-stan       { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.4'%3E%3Crect x='5' y='3' width='14' height='18'/%3E%3Cpath d='M8 7h2M14 7h2M8 11h2M14 11h2M8 15h2M14 15h2M11 21v-3h2v3'/%3E%3C/svg%3E"); }
.up-icon-kuca       { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.4'%3E%3Cpath d='M3 11 12 4l9 7M5 9.5V20h14V9.5M10 20v-5h4v5'/%3E%3C/svg%3E"); }
.up-icon-poslovni   { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.4'%3E%3Crect x='3' y='8' width='18' height='12'/%3E%3Cpath d='M9 8V5h6v3M3 13h18'/%3E%3C/svg%3E"); }
.up-icon-stolarija  { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.4'%3E%3Crect x='4' y='3' width='16' height='18'/%3E%3Cpath d='M12 3v18M10 11v2M14 11v2'/%3E%3C/svg%3E"); }
.up-icon-tekstil    { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.4'%3E%3Cpath d='M3 4h18M6 4c0 6 1 11 3 16M18 4c0 6-1 11-3 16M9 4c0 5 .5 10 1.5 16M15 4c0 5-.5 10-1.5 16'/%3E%3C/svg%3E"); }
.up-icon-rasvjeta   { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.4'%3E%3Cpath d='M12 2v6M7 14a5 5 0 0 1 10 0zM10 17a2 2 0 0 0 4 0M5 19l-1.5 1.5M19 19l1.5 1.5'/%3E%3C/svg%3E"); }
.up-icon-podovi     { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.4'%3E%3Cpath d='M3 15 12 10l9 5-9 5zM7.5 12.5l9 5M16.5 12.5l-9 5'/%3E%3C/svg%3E"); }
.up-icon-zidovi     { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.4'%3E%3Crect x='4' y='3' width='14' height='6'/%3E%3Cpath d='M18 6h2v5h-8v3M11 14h2v7h-2z'/%3E%3C/svg%3E"); }
.up-icon-kuhinja    { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.4'%3E%3Crect x='3' y='10' width='18' height='10'/%3E%3Cpath d='M3 14h18M9 10v10M7 5h4M15 3v4M13 5h4'/%3E%3C/svg%3E"); }
.up-icon-kupaonica, .up-icon-sanitarije { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.4'%3E%3Cpath d='M3 12h18v2a6 6 0 0 1-6 6H9a6 6 0 0 1-6-6zM6 12V5a2 2 0 0 1 4 0M7 20l-1 2M17 20l1 2'/%3E%3C/svg%3E"); }
.up-icon-dekor      { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.4'%3E%3Cpath d='M9 3h6M10 3v4c-3 2-4 5-4 8a6 6 0 0 0 12 0c0-3-1-6-4-8V3'/%3E%3C/svg%3E"); }
.up-icon-aparati    { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.4'%3E%3Crect x='4' y='3' width='16' height='18'/%3E%3Ccircle cx='12' cy='13' r='4.5'/%3E%3Cpath d='M7 6h3'/%3E%3C/svg%3E"); }
.up-icon-vrt        { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.4'%3E%3Cpath d='M6 20v-8h12v8M6 12 8 4h8l2 8M4 16h16'/%3E%3C/svg%3E"); }
.up-icon-dizajn     { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.4'%3E%3Cpath d='M12 3v3M12 6 6 21M12 6l6 15M8 15h8'/%3E%3Ccircle cx='12' cy='6' r='1.5'/%3E%3C/svg%3E"); }

/* ---------- Stranica /upitnik ---------- */
.up-intro { padding-top: clamp(40px, 6vw, 96px); }
.up-container { max-width: 880px; }
.up-head { margin-bottom: clamp(28px, 4vw, 48px); }
.up-head .lead { max-width: 38em; margin-top: 16px; }

/* ---------- Napredak ---------- */
.up-progress { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; padding: 10px 0; }
.up-progress-bar { flex: 1; height: 3px; background: var(--line); overflow: hidden; }
.up-progress-fill { display: block; height: 100%; width: 0; background: var(--copper); transform-origin: left; transition: width .5s var(--ease); }
.up-progress-label { margin: 0; font: 500 var(--fs-sm)/1 var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; min-width: 3.5em; text-align: right; }

/* ---------- Koraci ---------- */
.upitnik { position: relative; }
.up-step { border: 0; margin: 0 0 56px; padding: 0; min-width: 0; }
.js .up-step { margin-bottom: 0; }
.js .up-step:not(.is-active) { display: none; }
.up-legend { padding: 0; margin-bottom: 8px; display: block; width: 100%; }
.up-step-no { display: block; font: 600 var(--fs-xs)/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--copper); margin-bottom: 10px; }
.up-q { display: block; font-family: var(--serif); font-size: var(--fs-display-md); line-height: 1.1; letter-spacing: -.01em; color: var(--ink); }
.up-hint { color: var(--muted); margin: 10px 0 0; }
.up-sub { margin: 32px 0 12px; font-weight: 600; font-size: var(--fs-sm); }
.up-optional { font-weight: 400; color: var(--muted); margin-left: 6px; }
.up-step > .up-cards, .up-step > .up-styles { margin-top: 24px; }

/* Animirani ulaz koraka */
@media (prefers-reduced-motion: no-preference) {
	.up-step.is-entering { animation: up-in .45s var(--ease) both; }
	.up-step.is-entering.is-back { animation-name: up-in-back; }
	@keyframes up-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
	@keyframes up-in-back { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
	.up-step.is-entering .up-card, .up-step.is-entering .up-style, .up-step.is-entering .up-chip { animation: up-rise .5s var(--ease) both; }
	.up-step.is-entering :is(.up-card, .up-style, .up-chip):nth-child(2) { animation-delay: .04s; }
	.up-step.is-entering :is(.up-card, .up-style, .up-chip):nth-child(3) { animation-delay: .08s; }
	.up-step.is-entering :is(.up-card, .up-style, .up-chip):nth-child(4) { animation-delay: .12s; }
	.up-step.is-entering :is(.up-card, .up-style, .up-chip):nth-child(n+5) { animation-delay: .16s; }
	@keyframes up-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
	.up-shake { animation: up-shake .35s var(--ease); }
	@keyframes up-shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
}

/* ---------- Kartice odabira ---------- */
.up-cards { display: grid; gap: 12px; }
.up-cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.up-cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.up-card, .up-style, .up-chip { position: relative; display: block; cursor: pointer; }
.up-card input, .up-style input, .up-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.up-card-face {
	display: flex; flex-direction: column; align-items: flex-start; gap: 18px;
	min-height: 120px; padding: 20px; height: 100%;
	background: var(--white); border: 1px solid var(--line); color: var(--ink-2);
	transition: border-color .25s var(--ease), background .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}
.up-card-title { font-weight: 600; color: var(--ink); line-height: 1.3; }
.up-card-row .up-card-face { flex-direction: row; align-items: center; min-height: 64px; padding: 14px 16px; gap: 14px; }
.up-card-row .up-icon { width: 24px; height: 24px; }
.up-card-text .up-card-face { min-height: 84px; justify-content: center; }
.up-card:hover .up-card-face, .up-style:hover .up-style-face { border-color: var(--sand); }
.up-card input:focus-visible + .up-card-face, .up-style input:focus-visible + .up-style-face, .up-chip input:focus-visible + span { outline: 2px solid var(--copper); outline-offset: 3px; }
.up-card input:checked + .up-card-face { border-color: var(--ink); background: var(--paper-2); color: var(--copper-deep); box-shadow: inset 0 0 0 1px var(--ink); }
@media (prefers-reduced-motion: no-preference) {
	.up-card input:checked + .up-card-face, .up-style input:checked + .up-style-face { animation: up-pop .32s var(--ease); }
	@keyframes up-pop { 40% { transform: scale(.975); } 100% { transform: none; } }
}

/* kvačica */
.up-check { margin-left: auto; width: 22px; height: 22px; border: 1px solid var(--line); border-radius: 50%; flex: none; position: relative; background: var(--white); transition: background .2s var(--ease), border-color .2s var(--ease); }
.up-check::after { content: ""; position: absolute; left: 7px; top: 3.5px; width: 6px; height: 11px; border: solid var(--paper); border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); transition: transform .25s var(--ease); }
input:checked + .up-card-face .up-check, input:checked + .up-style-face .up-check { background: var(--ink); border-color: var(--ink); }
input:checked + .up-card-face .up-check::after, input:checked + .up-style-face .up-check::after { transform: rotate(45deg) scale(1); }

/* Stil — velike slike */
.up-styles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.up-style-face { display: block; height: 100%; background: var(--white); border: 1px solid var(--line); transition: border-color .25s var(--ease), box-shadow .25s var(--ease); }
.up-style-media { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--paper-3); }
.up-style-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.up-style:hover .up-style-media img { transform: scale(1.04); }
.up-style-body { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px 16px; }
.up-style-note { font-size: var(--fs-sm); color: var(--muted); }
.up-style .up-check { position: absolute; top: 12px; right: 12px; }
.up-style input:checked + .up-style-face { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.up-concept { margin: 14px 0 0; font-size: var(--fs-xs); color: var(--muted); }

/* Chipovi */
.up-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.up-chip span {
	display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
	border: 1px solid var(--line); background: var(--white); border-radius: 999px;
	font-size: var(--fs-sm); color: var(--ink-2);
	transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.up-chip:hover span { border-color: var(--sand); }
.up-chip input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* m² */
.up-m2 { margin-top: 24px; max-width: 280px; }
.up-m2-input { position: relative; }
.up-m2-input input { width: 100%; min-height: 52px; padding: 0 52px 0 16px; border: 1px solid var(--line); background: var(--white); font-size: 1.125rem; border-radius: 0; -moz-appearance: textfield; }
.up-m2-input input::-webkit-outer-spin-button, .up-m2-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.up-m2-input input:focus { outline: none; border-color: var(--copper); box-shadow: 0 0 0 3px rgba(154, 97, 72, .22); }
.up-m2-input span { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); }

/* Navigacija */
.up-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); }
.up-nav .btn { margin-left: auto; }
.up-back { background: none; border: 0; padding: 12px 4px; min-height: 44px; color: var(--muted); font-weight: 500; }
.up-back:hover { color: var(--ink); }
.no-js .up-nav [data-up-next], .no-js .up-back { display: none; }
.up-error { margin: 18px 0 0; padding: 12px 16px; background: #F8E9E5; color: #5E1B12; border-left: 3px solid #A4372B; font-size: var(--fs-sm); }
.up-step .consent { display: flex; gap: 12px; align-items: flex-start; }
.up-step .consent input { margin-top: 0; width: 24px; height: 24px; flex: none; accent-color: var(--ink); }
.up-step .consent label { font-weight: 400; font-size: var(--fs-sm); color: var(--ink-2); }
.up-submit[aria-busy="true"] { opacity: .6; pointer-events: none; }

/* Završni ekran */
.up-done { padding: clamp(28px, 4vw, 48px); background: var(--white); border: 1px solid var(--line); }
.up-done:focus:not(:focus-visible) { outline: none; }
.up-done:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }
.up-done-mark { display: block; width: 56px; height: 56px; border-radius: 50%; background: var(--ink); position: relative; margin-bottom: 24px; }
.up-done-mark::after { content: ""; position: absolute; left: 21px; top: 14px; width: 12px; height: 22px; border: solid var(--paper); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
@media (prefers-reduced-motion: no-preference) {
	.up-done.is-in { animation: up-rise .6s var(--ease) both; }
	.up-done.is-in .up-done-mark { animation: up-pop .5s .15s var(--ease) both; }
}
.up-done .lead { margin-top: 16px; }
.up-summary { display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; margin: 20px 0 28px; padding: 20px 0; border-block: 1px solid var(--line); }
.up-summary dt { color: var(--muted); font-size: var(--fs-sm); }
.up-summary dd { margin: 0; color: var(--ink); }
.up-done-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.up-wa { background: #1F6F4A; }
.up-wa:hover { background: #17573A; }
.wa-icon-inline { width: 18px; height: 18px; background: currentColor; display: inline-block; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 0 0-8.6 15.1L2 22l5-1.3A10 10 0 1 0 12 2zm0 18a8 8 0 0 1-4.1-1.1l-.3-.2-3 .8.8-2.9-.2-.3A8 8 0 1 1 12 20zm4.4-6c-.2-.1-1.4-.7-1.7-.8s-.4-.1-.5.1l-.8.9c-.1.2-.3.2-.5.1a6.5 6.5 0 0 1-3.2-2.8c-.2-.4.2-.4.7-1.2.1-.1 0-.3 0-.4l-.8-1.8c-.2-.5-.4-.4-.5-.4h-.5a.9.9 0 0 0-.6.3 2.7 2.7 0 0 0-.8 2c0 1.2.9 2.3 1 2.5s1.7 2.6 4.1 3.6c1.5.7 2.1.7 2.9.6.5-.1 1.4-.6 1.6-1.1s.2-1 .1-1.1z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 0 0-8.6 15.1L2 22l5-1.3A10 10 0 1 0 12 2zm0 18a8 8 0 0 1-4.1-1.1l-.3-.2-3 .8.8-2.9-.2-.3A8 8 0 1 1 12 20zm4.4-6c-.2-.1-1.4-.7-1.7-.8s-.4-.1-.5.1l-.8.9c-.1.2-.3.2-.5.1a6.5 6.5 0 0 1-3.2-2.8c-.2-.4.2-.4.7-1.2.1-.1 0-.3 0-.4l-.8-1.8c-.2-.5-.4-.4-.5-.4h-.5a.9.9 0 0 0-.6.3 2.7 2.7 0 0 0-.8 2c0 1.2.9 2.3 1 2.5s1.7 2.6 4.1 3.6c1.5.7 2.1.7 2.9.6.5-.1 1.4-.6 1.6-1.1s.2-1 .1-1.1z'/%3E%3C/svg%3E") center / contain no-repeat; }

/* ---------- Kooperanti ---------- */
.koop-grid { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.koop-card { position: relative; background: var(--paper); padding: clamp(22px, 2.6vw, 34px); display: flex; flex-direction: column; min-height: 240px; transition: background .3s var(--ease); }
.koop-card:hover { background: var(--white); }
.koop-logo { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border: 1px solid var(--line); border-radius: 50%; color: var(--copper); margin-bottom: 22px; background: var(--white); overflow: hidden; }
.koop-logo-img { width: 100%; height: 100%; object-fit: contain; }
.koop-badge { position: absolute; top: clamp(22px, 2.6vw, 34px); right: clamp(22px, 2.6vw, 34px); font: 700 .6875rem/1 var(--sans); letter-spacing: .12em; padding: 6px 9px; color: #7A4A00; background: #FBEFD6; border: 1px dashed #C48A2C; }
.koop-cat { margin: 0 0 6px; font: 600 var(--fs-xs)/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--copper); }
.koop-name { font-family: var(--serif); font-size: var(--fs-h3); line-height: 1.15; color: var(--ink); margin-bottom: 10px; }
.koop-card.is-placeholder .koop-name { color: var(--muted); font-style: italic; }
.koop-text { margin: 0; color: var(--ink-2); font-size: var(--fs-sm); }

/* ---------- Mobile ---------- */
@media (max-width: 810px) {
	.koop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.up-styles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
	.up-cards-3 { grid-template-columns: 1fr; }
	.up-cards-3 .up-card-face { flex-direction: row; align-items: center; min-height: 64px; padding: 14px 16px; gap: 14px; }
	.up-cards-2 { grid-template-columns: 1fr; }
	.up-styles { grid-template-columns: 1fr; }
	.up-style-face { display: grid; grid-template-columns: 120px 1fr; align-items: center; }
	.up-style-media { aspect-ratio: 1; height: 100%; }
	.up-style .up-check { top: 50%; right: 14px; transform: translateY(-50%); }
	.koop-grid { grid-template-columns: 1fr; }
	.koop-card { min-height: 0; }
	.up-summary { grid-template-columns: 1fr; gap: 2px; }
	.up-summary dd { margin-bottom: 10px; }
	.up-nav { position: sticky; bottom: calc(var(--dock-h) + 0px); background: var(--paper); padding-bottom: 12px; margin-inline: calc(-1 * var(--pad)); padding-inline: var(--pad); z-index: 4; }
	.up-progress { margin-inline: calc(-1 * var(--pad)); padding-inline: var(--pad); }
	.up-done-actions .btn { width: 100%; justify-content: center; }
}

/* ---------- Dorade nakon pregleda: kontrast rubova kontrola ---------- */
.upitnik-wrap { --up-line: #968D81; }
.up-card input:not(:checked) + .up-card-face, .up-style input:not(:checked) + .up-style-face, .up-chip input:not(:checked) + span, .up-m2-input input,
.upitnik .field input[type="text"], .upitnik .field input[type="email"], .upitnik .field input[type="tel"], .upitnik .field textarea { border-color: var(--up-line); }
.up-nomail, .konf-nomail { padding: 10px 14px; background: #FBEFD6; color: #6E4300; border-left: 3px solid #C48A2C; font-size: 14px; }
