/* =============================================================================
   Docs ticket — "Open a support ticket" button at the top of the docs root,
   plus the modal form that POSTs to /docs-ticket/submit. Tokens inherit from
   the .docs wrapper in docs.css; all selectors scoped under .docs-ticket*.
   ============================================================================= */

.docs-ticket__open {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 12px;
	padding: 8px 14px;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--bg);
	color: var(--text);
	font: inherit;
	font-size: 14px;
	cursor: pointer;
	transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.docs-ticket__open:hover,
.docs-ticket__open:focus-visible {
	background: var(--surface);
	border-color: var(--accent);
	color: var(--accent);
	outline: none;
}

/* ── Modal overlay ───────────────────────────────────────────────────── */
.docs-ticket {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px 16px;
}

.docs-ticket[hidden] { display: none; }

.docs-ticket__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 15, 26, 0.45);
	backdrop-filter: blur(2px);
}

.docs-ticket__panel {
	position: relative;
	width: 100%;
	max-width: 560px;
	max-height: calc(100vh - 48px);
	display: flex;
	flex-direction: column;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-dropdown);
	overflow: hidden;
}

.docs-ticket__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid var(--border);
}

.docs-ticket__heading {
	font-size: 18px;
	font-weight: 700;
	margin: 0;
	color: var(--text);
}

.docs-ticket__close {
	background: transparent;
	border: 0;
	font-size: 24px;
	line-height: 1;
	color: var(--muted);
	cursor: pointer;
	padding: 4px 8px;
	border-radius: var(--radius-sm);
}

.docs-ticket__close:hover,
.docs-ticket__close:focus-visible {
	background: var(--surface);
	color: var(--text);
	outline: none;
}

/* ── Form ───────────────────────────────────────────────────────────── */
.docs-ticket__form {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 20px;
	overflow-y: auto;
}

.docs-ticket__form[hidden] { display: none; }

.docs-ticket__field {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.docs-ticket__field[hidden] { display: none; }

.docs-ticket__label {
	font-size: 13px;
	font-weight: 600;
	color: var(--text);
}

.docs-ticket__form input[type="text"],
.docs-ticket__form input[type="email"],
.docs-ticket__form select,
.docs-ticket__form textarea {
	appearance: none;
	-webkit-appearance: none;
	display: block;
	width: 100%;
	box-sizing: border-box;
	background-color: rgba(237, 242, 247, 1);
	color: #374151;
	border: 1px solid #d1d5db;
	border-radius: 0.375rem;
	padding: 0.9rem 1rem;
	font-family: var(--font-body);
	font-size: 15px;
	line-height: 1.4;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.docs-ticket__form input[type="text"]::placeholder,
.docs-ticket__form input[type="email"]::placeholder,
.docs-ticket__form textarea::placeholder {
	color: #9ca3af;
	opacity: 1;
}

.docs-ticket__form input[type="text"]:hover,
.docs-ticket__form input[type="email"]:hover,
.docs-ticket__form select:hover,
.docs-ticket__form textarea:hover {
	border-color: #b8bdc7;
}

.docs-ticket__form input[type="text"]:focus,
.docs-ticket__form input[type="email"]:focus,
.docs-ticket__form select:focus,
.docs-ticket__form textarea:focus {
	outline: none;
	background-color: #ffffff;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(66, 109, 173, 0.15);
}

.docs-ticket__form textarea {
	resize: vertical;
	min-height: 120px;
	line-height: 1.55;
}

.docs-ticket__form select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b6b8a' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 10px 7px;
	padding-right: 36px;
	cursor: pointer;
}

.docs-ticket__captcha {
	display: flex;
	justify-content: center;
}

.docs-ticket__feedback {
	padding: 10px 12px;
	border-radius: var(--radius-sm);
	font-size: 14px;
	line-height: 1.4;
}

.docs-ticket__success {
	display: flex;
	flex-direction: column;
	gap: 18px;
	padding: 28px 20px 20px;
	text-align: center;
}

.docs-ticket__success[hidden] { display: none; }

.docs-ticket__success-message {
	margin: 0;
	font-size: 16px;
	line-height: 1.5;
	color: var(--text);
}

.docs-ticket__feedback--ok {
	background: rgba(16, 185, 129, 0.10);
	color: #065f46;
	border: 1px solid rgba(16, 185, 129, 0.35);
}

.docs-ticket__feedback--err {
	background: rgba(220, 38, 38, 0.10);
	color: #991b1b;
	border: 1px solid rgba(220, 38, 38, 0.35);
}

.docs-ticket__actions {
	display: flex;
	gap: 8px;
	justify-content: flex-end;
	padding-top: 4px;
}

.docs-ticket__cancel,
.docs-ticket__submit {
	padding: 8px 16px;
	border-radius: var(--radius-sm);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	border: 1px solid transparent;
}

.docs-ticket__cancel {
	background: transparent;
	color: var(--muted);
	border-color: var(--border);
}

.docs-ticket__cancel:hover {
	background: var(--surface);
	color: var(--text);
}

.docs-ticket__submit {
	background: var(--accent);
	color: #fff;
}

.docs-ticket__submit:hover,
.docs-ticket__submit:focus-visible {
	background: #2f548c;
	outline: none;
}

.docs-ticket__submit:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

body.docs-ticket-open { overflow: hidden; }

@media (max-width: 600px) {
	.docs-ticket { padding: 0; }
	.docs-ticket__panel {
		max-width: none;
		max-height: 100vh;
		height: 100vh;
		border-radius: 0;
		border: 0;
	}
}

/* ── Inline variant — the support form on the docs landing page. Reuses all the
      form/field styling; only resets the fixed-overlay behaviour. ── */
.docs-ticket--inline {
	position: static;
	inset: auto;
	z-index: auto;
	display: block;
	padding: 0;
	margin-top: 40px;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	overflow: hidden;
}

/* Collapsed by default; the <summary> is the clickable header. */
.docs-ticket__disclosure {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 16px 20px;
	cursor: pointer;
	list-style: none;
	user-select: none;
}

/* Strip the native disclosure triangle (WebKit + others). */
.docs-ticket__disclosure::-webkit-details-marker { display: none; }
.docs-ticket__disclosure::marker { content: ""; }

.docs-ticket__disclosure:hover .docs-ticket__heading,
.docs-ticket--inline[open] .docs-ticket__disclosure .docs-ticket__heading {
	color: var(--accent);
}

.docs-ticket__disclosure:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: -2px;
	border-radius: var(--radius-lg);
}

.docs-ticket__disclosure-text {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.docs-ticket__intro {
	margin: 0;
	color: var(--muted);
	font-size: 14px;
	font-weight: 400;
}

.docs-ticket__chevron {
	flex: 0 0 auto;
	color: var(--muted);
	transition: transform 0.18s ease;
}

.docs-ticket--inline[open] .docs-ticket__chevron {
	transform: rotate(180deg);
}

/* Divider between the summary and the revealed form. */
.docs-ticket--inline[open] .docs-ticket__disclosure {
	border-bottom: 1px solid var(--border);
}

/* The form's explicit display:flex overrides the native closed-details hiding,
   so hide the revealed content ourselves when the disclosure is collapsed. */
.docs-ticket--inline:not([open]) .docs-ticket__form,
.docs-ticket--inline:not([open]) .docs-ticket__success {
	display: none;
}
