/**
 * Amy Agent — Submit Your Idea conversational UI.
 * Unified device-tray chat shell; reuses floating-widget CSS custom properties.
 */

.amy-submit-idea {
	--amy-bg: #0a0a0a;
	--amy-panel: rgba(20, 20, 20, 0.92);
	--amy-border: rgba(255, 210, 122, 0.35);
	--amy-accent: #ffd27a;
	--amy-accent-soft: #ffeac2;
	--amy-text: #f5f5f5;
	--amy-muted: #c9c9c9;
	--amy-brand-rgb: 255, 210, 122;
	color: var(--amy-text);
	font-family: "Space Grotesk", Inter, system-ui, -apple-system, Segoe UI, sans-serif;
	max-width: 52rem;
	margin: 0 auto;
}

.amy-si-section {
	display: none;
}

.amy-si-section.is-active {
	display: block;
}

.amy-si-heading {
	margin: 0 0 0.5rem;
	font-size: clamp(1.35rem, 2.5vw, 1.75rem);
	font-weight: 700;
	color: var(--amy-accent-soft);
	letter-spacing: 0.01em;
}

.amy-si-sub {
	margin: 0 0 1.5rem;
	color: var(--amy-muted);
	font-size: 0.95rem;
	line-height: 1.5;
}

/* —— Device tray (glossy amber/black bezel) —— */
.amy-si-tray {
	--amy-tray-radius: 24px;
	--amy-tray-bezel: 16px;
	position: relative;
	display: flex;
	flex-direction: column;
	padding: var(--amy-tray-bezel);
	border-radius: var(--amy-tray-radius);
	background:
		linear-gradient(
			145deg,
			rgba(255, 230, 180, 0.55) 0%,
			rgba(180, 140, 70, 0.45) 12%,
			rgba(60, 52, 36, 0.95) 38%,
			rgba(18, 16, 12, 1) 68%,
			rgba(6, 6, 6, 1) 100%
		);
	box-shadow:
		0 22px 48px rgba(0, 0, 0, 0.55),
		0 4px 12px rgba(0, 0, 0, 0.35),
		inset 0 1px 0 rgba(255, 236, 200, 0.45),
		inset 0 -3px 6px rgba(0, 0, 0, 0.55),
		inset 1px 0 0 rgba(255, 210, 122, 0.12),
		inset -1px 0 0 rgba(0, 0, 0, 0.4);
}

.amy-si-tray::before {
	content: "";
	position: absolute;
	inset: var(--amy-tray-bezel);
	border-radius: calc(var(--amy-tray-radius) - 10px);
	pointer-events: none;
	z-index: 0;
	background-color: var(--amy-bg);
	background-image: radial-gradient(rgba(255, 210, 122, 0.09) 0.5px, transparent 0.5px);
	background-size: 3px 3px;
	box-shadow:
		inset 0 1px 0 rgba(255, 210, 122, 0.12),
		inset 0 0 0 1px rgba(0, 0, 0, 0.55);
}

.amy-si-tray > * {
	position: relative;
	z-index: 1;
}

/* —— Ticker —— */
.amy-si-ticker {
	overflow: hidden;
	flex-shrink: 0;
	padding: 0.4rem 0;
	border-bottom: 1px solid rgba(var(--amy-brand-rgb), 0.14);
	mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.amy-si-ticker__track {
	display: inline-block;
	white-space: nowrap;
	font-size: 0.68rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--amy-accent);
	opacity: 0.72;
	animation: amy-si-ticker-marquee 42s linear infinite;
	will-change: transform;
}

@keyframes amy-si-ticker-marquee {
	from {
		transform: translateX(0);
	}
	to {
		transform: translateX(-50%);
	}
}

/* —— Chat screen —— */
.amy-si-chat {
	display: flex;
	flex-direction: column;
	gap: 1.35rem;
	padding: 0.85rem 1rem 0.75rem;
	min-height: 14rem;
	max-height: min(32rem, 58vh);
	overflow-y: auto;
	background: transparent;
	border: 0;
	border-radius: 0;
	scrollbar-width: thin;
	scrollbar-color: rgba(var(--amy-brand-rgb), 0.35) transparent;
	box-sizing: border-box;
}

.amy-si-custom {
	width: 100%;
	max-width: 100%;
}

.amy-si-custom--services {
	align-self: stretch;
}

.amy-si-custom--choices,
.amy-si-custom--summary {
	align-self: flex-start;
	max-width: 96%;
}

.amy-si-q-choices {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.65rem;
}

.amy-si-q-choices.is-locked {
	opacity: 0.72;
}

.amy-si-q-continue {
	margin-top: 0.15rem;
}

/* —— Service pill grid —— */
.amy-si-service-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.7rem;
	width: 100%;
}

.amy-si-service-pill {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: flex-start;
	gap: 0.55rem;
	width: 100%;
	text-align: left;
	padding: 0.7rem 1rem 0.7rem 0.75rem;
	border-radius: 999px;
	border: 1px solid rgba(var(--amy-brand-rgb), 0.45);
	background: linear-gradient(145deg, var(--amy-accent-soft), var(--amy-accent));
	color: #0a0a0a;
	cursor: pointer;
	font: inherit;
	box-shadow:
		0 4px 14px rgba(0, 0, 0, 0.28),
		inset 0 1px 0 rgba(255, 255, 255, 0.35);
	transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, filter 0.2s ease;
}

.amy-si-service-pill:hover,
.amy-si-service-pill:focus-visible {
	transform: translateY(-2px);
	border-color: #fff3d6;
	filter: brightness(1.06);
	box-shadow:
		0 8px 22px rgba(0, 0, 0, 0.35),
		0 0 18px rgba(var(--amy-brand-rgb), 0.28),
		inset 0 1px 0 rgba(255, 255, 255, 0.45);
	outline: none;
}

.amy-si-service-pill:disabled {
	opacity: 0.55;
	cursor: not-allowed;
	transform: none;
	filter: none;
}

.amy-si-service-pill__icon {
	flex-shrink: 0;
	width: 1.85rem;
	height: 1.85rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	border: 1px solid rgba(10, 10, 10, 0.18);
	background: rgba(10, 10, 10, 0.1);
	color: #0a0a0a;
	font-size: 0.85rem;
	font-weight: 700;
	line-height: 1;
}

.amy-si-service-pill__label {
	font-size: 0.8rem;
	font-weight: 600;
	line-height: 1.25;
}

/* —— Contact / thank-you form bits (unchanged step markup) —— */
.amy-si-form {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.amy-si-field {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.amy-si-field__label {
	font-size: 0.92rem;
	font-weight: 600;
	color: var(--amy-text);
}

.amy-si-field__label .amy-si-optional {
	font-weight: 400;
	color: var(--amy-muted);
	font-size: 0.8rem;
}

.amy-si-input,
.amy-si-textarea {
	width: 100%;
	box-sizing: border-box;
	border-radius: 0.7rem;
	border: 1px solid rgba(var(--amy-brand-rgb), 0.25);
	background: rgba(0, 0, 0, 0.35);
	color: var(--amy-text);
	padding: 0.75rem 0.85rem;
	font: inherit;
	font-size: 0.92rem;
}

.amy-si-textarea {
	min-height: 6rem;
	resize: vertical;
}

.amy-si-input:focus,
.amy-si-textarea:focus {
	outline: none;
	border-color: var(--amy-accent);
	box-shadow: 0 0 0 2px rgba(var(--amy-brand-rgb), 0.15);
}

.amy-si-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.amy-si-pill {
	appearance: none;
	border-radius: 999px;
	border: 1px solid rgba(var(--amy-brand-rgb), 0.3);
	background: rgba(0, 0, 0, 0.3);
	color: var(--amy-text);
	font: inherit;
	font-size: 0.85rem;
	padding: 0.45rem 0.9rem;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.amy-si-pill:hover,
.amy-si-pill:focus-visible {
	border-color: var(--amy-accent);
	outline: none;
}

.amy-si-pill.is-active {
	background: rgba(var(--amy-brand-rgb), 0.18);
	border-color: var(--amy-accent);
	color: var(--amy-accent-soft);
}

.amy-si-pill:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.amy-si-files {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	min-height: 0;
	padding: 0.35rem 0.15rem 0.15rem;
}

.amy-si-files:empty {
	display: none;
}

.amy-si-file-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	max-width: 100%;
	padding: 6px 10px;
	border-radius: 8px;
	border: 1px solid rgba(255, 210, 122, 0.3);
	background: transparent;
	font-size: 0.8rem;
	color: var(--amy-accent-soft);
	line-height: 1.2;
}

.amy-si-file-chip--sent {
	border-color: rgba(255, 210, 122, 0.25);
}

.amy-si-file-chip__icon {
	display: inline-flex;
	color: var(--amy-accent);
	flex-shrink: 0;
}

.amy-si-file-chip__meta {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	min-width: 0;
}

.amy-si-file-chip__name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 11rem;
}

.amy-si-file-chip__size {
	font-size: 0.7rem;
	color: var(--amy-muted);
}

.amy-si-file-thumb {
	width: 32px;
	height: 32px;
	object-fit: cover;
	border-radius: 6px;
	border: 1px solid rgba(255, 210, 122, 0.3);
	flex-shrink: 0;
	display: block;
}

.amy-si-file-thumb--sent {
	width: 56px;
	height: 56px;
	border-radius: 8px;
	border-color: rgba(255, 210, 122, 0.25);
}

.amy-si-file-chip--image.amy-si-file-chip--sent {
	padding: 0;
	border: 0;
	background: transparent;
}

.amy-si-file-chip__remove {
	appearance: none;
	border: 0;
	background: transparent;
	color: var(--amy-muted);
	cursor: pointer;
	font-size: 0.85rem;
	line-height: 1;
	padding: 0 0.1rem;
	margin-left: 0.15rem;
}

.amy-si-file-chip__remove:hover {
	color: var(--amy-accent);
}

.amy-si-bubble-files {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	margin-top: 0.45rem;
	justify-content: flex-end;
}

.amy-si-bubble--assistant .amy-si-bubble-files {
	justify-content: flex-start;
}

.amy-si-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem;
	margin-top: 0.5rem;
}

.amy-si-btn {
	appearance: none;
	border-radius: 0.7rem;
	border: 1px solid var(--amy-border);
	background: linear-gradient(145deg, #1a1a1a, #101010);
	color: #fff;
	font: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	padding: 0.7rem 1.15rem;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.amy-si-btn:hover:not(:disabled),
.amy-si-btn:focus-visible:not(:disabled) {
	border-color: var(--amy-accent);
	background: rgba(var(--amy-brand-rgb), 0.16);
	outline: none;
}

.amy-si-btn:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.amy-si-btn--primary {
	border-color: var(--amy-accent);
	color: #0a0a0a;
	background: linear-gradient(145deg, #ffeac2, #ffd27a);
}

.amy-si-btn--primary:hover:not(:disabled),
.amy-si-btn--primary:focus-visible:not(:disabled) {
	background: linear-gradient(145deg, #fff3d6, #ffd27a);
	border-color: var(--amy-accent-soft);
}

.amy-si-error {
	color: #ff8f8f;
	font-size: 0.85rem;
	margin: 0;
}

/* —— Bubbles (text-only; no card chrome) —— */
.amy-si-bubble {
	max-width: 92%;
	padding: 0;
	border-radius: 0;
	font-size: 0.9rem;
	line-height: 1.5;
	word-break: break-word;
	overflow-wrap: anywhere;
	background: transparent;
	border: 0;
	box-shadow: none;
	backdrop-filter: none;
}

.amy-si-bubble__sender {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-size: 11px;
	line-height: 1.2;
	color: rgba(255, 210, 122, 1);
	margin-bottom: 4px;
	font-weight: 600;
	letter-spacing: 0.02em;
}

.amy-si-bubble__dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: rgba(255, 210, 122, 1);
	flex-shrink: 0;
}

.amy-si-bubble__body {
	color: var(--amy-text);
}

.amy-si-bubble--assistant {
	align-self: flex-start;
	text-align: left;
	max-width: 90%;
	background: transparent;
	border: 0;
	color: var(--amy-text);
}

.amy-si-bubble--assistant .amy-si-bubble__body {
	border-inline-start: 2px solid rgba(255, 210, 122, 0.35);
	padding-inline-start: 12px;
}

.amy-si-bubble--assistant .amy-si-bubble__body p {
	margin: 0 0 0.65rem;
}

.amy-si-bubble--assistant .amy-si-bubble__body p:last-child {
	margin-bottom: 0;
}

.amy-si-bubble--assistant .amy-si-bubble__body strong {
	font-weight: 700;
	color: var(--amy-accent);
}

.amy-si-bubble--assistant .amy-si-bubble__body ol,
.amy-si-bubble--assistant .amy-si-bubble__body ul {
	margin: 0.35rem 0 0.65rem;
	padding-left: 1.25rem;
}

.amy-si-bubble--assistant .amy-si-bubble__body a {
	color: #ffd27a;
	text-decoration: underline;
}

.amy-si-bubble--user {
	align-self: flex-end;
	text-align: right;
	max-width: 80%;
	background: transparent;
	border: 0;
	white-space: normal;
}

.amy-si-bubble--user .amy-si-bubble__body {
	white-space: pre-wrap;
	border-inline-end: 2px solid rgba(255, 210, 122, 0.35);
	padding-inline-end: 12px;
}

.amy-si-bubble--user .amy-si-bubble__sender {
	justify-content: flex-end;
	width: 100%;
}

.amy-si-bubble--status {
	align-self: center;
	text-align: center;
	background: transparent;
	border: 0;
	color: var(--amy-muted);
	font-size: 0.8rem;
	padding: 0.25rem 0.5rem;
}

/* —— Terminal success card —— */
.amy-si-tray.is-success .amy-si-ticker,
.amy-si-tray.is-success .amy-si-chat,
.amy-si-tray.is-success .amy-si-files,
.amy-si-tray.is-success .amy-si-composer {
	display: none !important;
}

.amy-si-success {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 2.75rem 1.5rem;
	min-height: 16rem;
	box-sizing: border-box;
}

.amy-si-success__badge {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	border: 2px solid rgba(255, 210, 122, 0.35);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 1.45rem;
	line-height: 1;
	margin-bottom: 1.25rem;
	background: transparent;
}

.amy-si-success__text {
	margin: 0;
	max-width: 420px;
	color: var(--amy-text);
	line-height: 1.55;
	font-size: 1rem;
}

.amy-si-choices {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 0.15rem;
}

.amy-si-summary-actions .amy-si-pill.amy-si-btn--primary {
	color: #0a0a0a;
}

/* —— Composer —— */
.amy-si-composer {
	display: flex;
	align-items: flex-end;
	gap: 0.45rem;
	margin-top: 0.2rem;
	padding: 0.35rem 0.15rem 0.45rem;
	border-top: 1px solid rgba(var(--amy-brand-rgb), 0.12);
}

.amy-si-files:not(:empty) {
	border-top: 1px solid rgba(var(--amy-brand-rgb), 0.12);
	padding-top: 0.55rem;
}

.amy-si-files:not(:empty) + .amy-si-composer {
	border-top: 0;
}

.amy-si-composer .amy-si-input {
	flex: 1;
	min-width: 0;
	min-height: 2.4rem;
	max-height: 7.5rem;
	resize: none;
	line-height: 1.4;
	overflow-y: hidden;
}

.amy-si-composer.is-choice-mode .amy-si-input,
.amy-si-composer.is-choice-mode [data-si-composer-send] {
	display: none;
}

.amy-si-custom--contact {
	align-self: stretch;
	max-width: 100%;
}

.amy-si-contact-bubble {
	padding: 0.85rem 0.9rem;
	border-radius: 0.85rem;
	border: 1px solid rgba(var(--amy-brand-rgb), 0.22);
	background: rgba(255, 255, 255, 0.04);
}

.amy-si-phone-row {
	display: flex;
	align-items: stretch;
	gap: 0.45rem;
}

.amy-si-country-dd {
	position: relative;
	flex: 0 0 auto;
	min-width: 0;
}

.amy-si-country-dd__btn {
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	width: max-content;
	min-height: 2.55rem;
	padding: 0.55rem 0.7rem;
	border-radius: 0.7rem;
	border: 1px solid rgba(var(--amy-brand-rgb), 0.25);
	background: rgba(0, 0, 0, 0.35);
	color: var(--amy-text);
	font: inherit;
	font-size: 0.9rem;
	cursor: pointer;
	white-space: nowrap;
}

.amy-si-country-dd__btn:hover,
.amy-si-country-dd__btn:focus-visible,
.amy-si-country-dd.is-open .amy-si-country-dd__btn {
	outline: none;
	border-color: var(--amy-accent);
	box-shadow: 0 0 0 2px rgba(var(--amy-brand-rgb), 0.15);
}

.amy-si-flag {
	width: 20px;
	height: 15px;
	object-fit: cover;
	border-radius: 2px;
	flex-shrink: 0;
	display: block;
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.amy-si-country-dd__code {
	color: var(--amy-accent-soft);
	font-weight: 600;
}

.amy-si-country-dd__chevron {
	width: 0;
	height: 0;
	margin-left: 0.15rem;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 5px solid var(--amy-muted);
}

.amy-si-country-dd__list {
	position: absolute;
	left: 0;
	bottom: calc(100% + 0.35rem);
	z-index: 30;
	margin: 0;
	padding: 0.35rem;
	list-style: none;
	min-width: min(18rem, 78vw);
	max-height: 14rem;
	overflow-y: auto;
	border-radius: 0.75rem;
	border: 1px solid rgba(var(--amy-brand-rgb), 0.35);
	background: #121212;
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
	scrollbar-width: thin;
}

.amy-si-country-dd__option {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.5rem 0.55rem;
	border-radius: 0.5rem;
	cursor: pointer;
	color: var(--amy-text);
	font-size: 0.85rem;
}

.amy-si-country-dd__option:hover,
.amy-si-country-dd__option.is-active,
.amy-si-country-dd__option[aria-selected="true"] {
	background: rgba(var(--amy-brand-rgb), 0.14);
}

.amy-si-country-dd__label {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.amy-si-country-dd__dial {
	color: var(--amy-accent);
	font-weight: 600;
	flex-shrink: 0;
}

.amy-si-phone-row [data-si-whatsapp] {
	flex: 1;
	min-width: 0;
}

.amy-si-attach {
	appearance: none;
	flex-shrink: 0;
	width: 2.4rem;
	height: 2.4rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 0.7rem;
	border: 1px solid rgba(var(--amy-brand-rgb), 0.28);
	background: rgba(0, 0, 0, 0.35);
	color: var(--amy-accent-soft);
	font-size: 1.05rem;
	line-height: 1;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.amy-si-attach:hover:not(:disabled),
.amy-si-attach:focus-visible:not(:disabled) {
	border-color: var(--amy-accent);
	background: rgba(var(--amy-brand-rgb), 0.12);
	outline: none;
}

.amy-si-attach:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

@media (max-width: 560px) {
	.amy-si-tray {
		--amy-tray-bezel: 12px;
		--amy-tray-radius: 20px;
	}

	.amy-si-service-pill {
		padding: 0.6rem 0.75rem 0.6rem 0.55rem;
		gap: 0.4rem;
	}

	.amy-si-service-pill__label {
		font-size: 0.72rem;
	}

	.amy-si-service-pill__icon {
		width: 1.55rem;
		height: 1.55rem;
		font-size: 0.75rem;
	}

	.amy-si-chat {
		max-height: min(28rem, 52vh);
		padding-inline: 0.85rem;
	}

	.amy-si-country-dd__list {
		min-width: min(16rem, 86vw);
		max-height: 12rem;
	}

	.amy-si-file-chip__name {
		max-width: 8rem;
	}

	.amy-si-bubble--user {
		max-width: 88%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.amy-si-service-pill,
	.amy-si-pill,
	.amy-si-btn,
	.amy-si-attach {
		transition: none;
	}

	.amy-si-ticker__track {
		animation: none;
		transform: none;
	}
}
