/* Tweety AI Studio – link u podnožju i prozor. */

/* Okidac je godina u podnozju. Pokazivac postavlja skripta, i to samo
   uredniku - obicnom posjetitelju se skripta uopce ne ucitava. */
.tw-footer__year { -webkit-tap-highlight-color: transparent; }

.twai-modal { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.twai-modal[hidden] { display: none; }
.twai-modal__backdrop { position: absolute; inset: 0; background: rgba(36,29,38,.55); }
.twai-modal__box {
	position: relative; background: #fff; border-radius: 18px; padding: 26px;
	width: min(560px, 100%); max-height: 88vh; overflow-y: auto;
	box-shadow: 0 24px 60px rgba(0,0,0,.22);
}
.twai-modal__x {
	position: absolute; right: 14px; top: 12px; border: 0; background: none;
	font-size: 26px; line-height: 1; cursor: pointer; color: #8b8391;
}
.twai-modal h2 { margin: 0 0 6px; font-size: 20px; }
.twai-hint { color: #8b8391; font-size: 14px; margin: 0 0 14px; }

.twai-input {
	width: 100%; padding: 11px 14px; border: 1.5px solid #ece7ea; border-radius: 999px;
	font: inherit; font-size: 16px; margin-bottom: 10px; background: #fff;
}
textarea.twai-input { border-radius: 14px; resize: vertical; }
.twai-input:focus { outline: 0; border-color: #ffc2ce; }

.twai-btn {
	border: 0; border-radius: 999px; padding: 11px 18px; cursor: pointer;
	background: #241d26; color: #fff; font: inherit; font-size: 14px; font-weight: 600;
}
.twai-btn:hover { background: #f2456b; }
.twai-btn:disabled { opacity: .55; cursor: default; }
.twai-btn--ghost { background: #fff; color: #241d26; border: 1.5px solid #ece7ea; }

/* PIN: zasebni okvirci, kao na aplikaciji. */
.twai-pin { display: flex; gap: 10px; justify-content: center; margin: 6px 0 4px; }
.twai-pin__cell {
	width: 54px; height: 62px; text-align: center;
	font: inherit; font-size: 26px; font-weight: 700; color: #241d26;
	border: 1.5px solid #ece7ea; border-radius: 14px; background: #fff;
	-moz-appearance: textfield;
}
.twai-pin__cell::-webkit-outer-spin-button,
.twai-pin__cell::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.twai-pin__cell:focus { outline: 0; border-color: #f2456b; box-shadow: 0 0 0 4px #fff2f5; }

.twai-product { margin-top: 18px; border-top: 1px solid #ece7ea; padding-top: 16px; }
.twai-product__head { display: flex; gap: 14px; align-items: flex-start; }
.twai-product__img { width: 76px; height: 76px; object-fit: cover; border-radius: 12px; background: #f7f4f6; flex: none; }
.twai-meta { font-size: 13px; color: #6b636f; margin-top: 4px; }
.twai-flags { font-size: 12.5px; color: #f2456b; margin-top: 6px; }

.twai-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

.twai-result { margin-top: 16px; border-top: 1px solid #ece7ea; padding-top: 14px; font-size: 14px; }
.twai-result label { display: block; font-size: 12.5px; color: #6b636f; margin-bottom: 8px; }
.twai-result__img { max-width: 220px; border-radius: 12px; margin-top: 8px; display: block; }
.twai-old { color: #8b8391; font-size: 13px; margin: 0 0 10px; }

.twai-error { color: #c0392b; font-size: 13.5px; margin: 10px 0 0; }
.twai-error[hidden] { display: none; }

@media (max-width: 600px) {
	.twai-modal__box { padding: 20px 16px; border-radius: 14px; }
	.twai-row { flex-direction: column; }
	.twai-row .twai-btn { width: 100%; }
}

/* Koraci generiranja - kvacica se pali tek kad je taj dio stvarno gotov. */
.twai-steps { list-style: none; margin: 16px 0 0; padding: 0; }
.twai-steps[hidden] { display: none; }
.twai-steps li {
	display: flex; align-items: center; gap: 10px;
	padding: 7px 0; font-size: 14px; color: #8b8391;
}
.twai-steps__mark {
	width: 20px; height: 20px; flex: none; border-radius: 50%;
	border: 2px solid #ece7ea; position: relative;
}
.twai-steps .is-running { color: #241d26; font-weight: 600; }
.twai-steps .is-running .twai-steps__mark {
	border-color: #f2456b; border-top-color: transparent;
	animation: twai-spin .7s linear infinite;
}
.twai-steps .is-done { color: #241d26; }
.twai-steps .is-done .twai-steps__mark { border-color: #2e9e6b; background: #2e9e6b; }
.twai-steps .is-done .twai-steps__mark::after {
	content: ""; position: absolute; left: 5px; top: 1px;
	width: 4px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}
.twai-steps .is-failed { color: #c0392b; }
.twai-steps .is-failed .twai-steps__mark { border-color: #c0392b; }
.twai-steps .is-failed .twai-steps__mark::after {
	content: "!"; position: absolute; inset: 0; text-align: center;
	line-height: 16px; font-size: 12px; font-weight: 700; color: #c0392b;
}

@keyframes twai-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
	.twai-steps .is-running .twai-steps__mark { animation: none; border-top-color: #f2456b; }
}

/* Napomena uz proizvod - biljezi se odmah, ispravlja kasnije. */
.twai-note { margin-top: 16px; border-top: 1px solid #ece7ea; padding-top: 14px; }
.twai-note label { display: block; font-size: 12.5px; color: #6b636f; margin-bottom: 6px; }
.twai-note textarea { margin-bottom: 8px; }
.twai-note__count { display: inline-block; margin-left: 10px; font-size: 12.5px; color: #2e9e6b; }
