/**
 * Ticket dashboard styles.
 *
 * Single file for the unified /tickets page — login, header,
 * ticket cards, QR, fields, transfer, completion.
 * All selectors scoped under .tmwpass-td.
 */

/* ── Layout ───────────────────────────────────────────────────── */

.tmwpass-td {
	max-width: 680px;
	margin: 0 auto;
	padding: 0 0 3em;
}

/* ── Notices ──────────────────────────────────────────────────── */

.tmwpass-td__notice {
	padding: 0.85em 1.1em;
	border-radius: 6px;
	margin-bottom: 1.5em;
	font-size: 0.925em;
	line-height: 1.5;
}

.tmwpass-td__notice--error {
	background: #fef2f2;
	color: #991b1b;
	border: 1px solid #fecaca;
}

.tmwpass-td__notice--success {
	background: #f0fdf4;
	color: #166534;
	border: 1px solid #bbf7d0;
}

/* ── Header (signed in state) ─────────────────────────────────── */

.tmwpass-td__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1em;
	margin-bottom: 2em;
	padding-bottom: 1em;
	border-bottom: 1px solid #e5e7eb;
}

.tmwpass-td__email {
	margin: 0;
	font-size: 0.9em;
	color: #6b7280;
	flex: 1;
	min-width: 0;
}

.tmwpass-td__email strong {
	word-break: break-word;
}

.tmwpass-td__header .tmwpass-td__btn--text {
	flex-shrink: 0;
	white-space: nowrap;
	align-self: flex-start;
	padding: 0.35em 0.7em;
	border: 1px solid #e5e7eb;
	border-radius: 9999px;
	background: #f9fafb;
	color: #4b5563;
	font-size: 0.8em;
	line-height: 1.2;
}

.tmwpass-td__header .tmwpass-td__btn--text:hover:not(:disabled) {
	background: #f3f4f6;
	border-color: #d1d5db;
	color: #1f2937;
}

.tmwpass-td__header .tmwpass-td__btn--text:focus-visible {
	outline: none;
	border-color: #9ca3af;
	box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.08);
}

/* ── Section headings ─────────────────────────────────────────── */

.tmwpass-td__section-heading {
	font-size: 1.05em;
	font-weight: 600;
	margin: 0 0 1em;
	padding: 0;
	color: #111827;
}

.tmwpass-td__section-heading + .tmwpass-td__section-heading {
	margin-top: 2.5em;
}

.tmwpass-td .tmwpass-td__section-heading:not(:first-of-type) {
	margin-top: 2.5em;
}

.tmwpass-td__inactive-group {
	margin: 1.5em 0 2em;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	background: #f9fafb;
}

.tmwpass-td__inactive-summary {
	padding: 0.95em 1.25em;
	cursor: pointer;
	font-size: 0.92em;
	font-weight: 600;
	color: #374151;
	list-style: none;
}

.tmwpass-td__inactive-summary::-webkit-details-marker {
	display: none;
}

.tmwpass-td__inactive-summary::before {
	content: "\25B8";
	display: inline-block;
	margin-right: 0.55em;
	color: #6b7280;
	transition: transform 0.15s ease;
}

.tmwpass-td__inactive-group[open] .tmwpass-td__inactive-summary::before {
	transform: rotate(90deg);
}

.tmwpass-td__inactive-content {
	padding: 0.5em 1.25em 1.25em;
	border-top: 1px solid #e5e7eb;
}

/* ── Event group heading ─────────────────────────────────────── */

.tmwpass-td__event-heading {
	font-size: 1.05em;
	font-weight: 600;
	margin: 0 0 0.75em;
	padding: 0;
	color: #111827;
}

.tmwpass-td__event-heading + .tmwpass-td__event-heading {
	margin-top: 2em;
}

.tmwpass-td__ticket + .tmwpass-td__event-heading {
	margin-top: 2em;
}

/* ── Empty state ──────────────────────────────────────────────── */

.tmwpass-td__empty {
	text-align: center;
	padding: 3em 1em;
	color: #9ca3af;
}

/* ── Ticket card ──────────────────────────────────────────────── */

.tmwpass-td__ticket {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	margin-bottom: 1.75em;
	overflow: hidden;
}

.tmwpass-td__ticket--disabled {
	opacity: 0.6;
}

/* ── Ticket header ────────────────────────────────────────────── */

.tmwpass-td__ticket-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1em;
	padding: 1.25em 1.5em;
	background: #f9fafb;
	border-bottom: 1px solid #e5e7eb;
}

.tmwpass-td__ticket-info {
	flex: 1;
	min-width: 0;
}

.tmwpass-td__product-name {
	margin: 0;
	font-size: 1.05em;
	font-weight: 600;
	line-height: 1.3;
}

/* ── Order reference ─────────────────────────────────────────── */

.tmwpass-td__order-ref {
	padding: 0.5em 1.5em;
	font-size: 0.8em;
	color: #9ca3af;
	border-bottom: 1px solid #e5e7eb;
}

.tmwpass-td__ticket-meta {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.4em;
	flex-shrink: 0;
}

.tmwpass-td__public-code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.8em;
	color: #9ca3af;
	letter-spacing: 0.02em;
}

/* ── Status badges ────────────────────────────────────────────── */

.tmwpass-td__status {
	display: inline-block;
	padding: 0.15em 0.6em;
	border-radius: 9999px;
	font-size: 0.75em;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	line-height: 1.5;
	white-space: nowrap;
}

.tmwpass-td__status--checked-in {
	background: #fef3c7;
	color: #92400e;
}

.tmwpass-td__status--void {
	background: #fee2e2;
	color: #991b1b;
}

.tmwpass-td__status--archived {
	background: #f3f4f6;
	color: #6b7280;
}

/* ── Attendee info + transfer toggle ──────────────────────────── */

.tmwpass-td__attendee-section {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1em;
	padding: 0.9em 1.5em;
	border-bottom: 1px solid #e5e7eb;
}

.tmwpass-td__attendee-info {
	display: flex;
	align-items: baseline;
	gap: 0.45em;
	min-width: 0;
}

.tmwpass-td__attendee-label {
	font-size: 0.82em;
	color: #6b7280;
	white-space: nowrap;
}

.tmwpass-td__attendee-email {
	font-size: 0.9em;
	color: #1f2937;
	word-break: break-all;
}

.tmwpass-td__attendee-actions {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.3em;
	flex-shrink: 0;
}

.tmwpass-td__attendee-action-buttons {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 0.45em;
}

.tmwpass-td__attendee-action-buttons .tmwpass-td__btn--text {
	padding: 0.35em 0.7em;
	border: 1px solid #e5e7eb;
	border-radius: 9999px;
	background: #f9fafb;
	color: #4b5563;
	font-size: 0.8em;
	font-weight: 500;
	line-height: 1.2;
	box-shadow: none;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.tmwpass-td__attendee-action-buttons .tmwpass-td__btn--text:hover:not(:disabled) {
	background: #f3f4f6;
	border-color: #d1d5db;
	color: #1f2937;
}

.tmwpass-td__attendee-action-buttons .tmwpass-td__btn--text:focus-visible {
	outline: none;
	border-color: #9ca3af;
	box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.08);
}

.tmwpass-td__email-feedback {
	font-size: 0.8em;
	line-height: 1.4;
	text-align: right;
}

.tmwpass-td__email-feedback:empty {
	display: none;
}

.tmwpass-td__email-feedback--success {
	color: #166534;
}

.tmwpass-td__email-feedback--error {
	color: #991b1b;
}

/* ── Transfer form ────────────────────────────────────────────── */

.tmwpass-td__transfer-form {
	padding: 1em 1.5em 1.25em;
	border-bottom: 1px dashed #e5e7eb;
}

.tmwpass-td__transfer-form[hidden] {
	display: none;
}

.tmwpass-td__transfer-desc {
	margin: 0 0 0.65em;
	font-size: 0.86em;
	color: #4b5563;
	line-height: 1.5;
}

.tmwpass-td__transfer-row {
	display: flex;
	gap: 0.6em;
	align-items: center;
}

.tmwpass-td__transfer-input {
	flex: 1;
	min-width: 0;
	padding: 0.55em 0.75em;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 0.92em;
	background: #fff;
	color: #1f2937;
	box-sizing: border-box;
}

.tmwpass-td__transfer-input:focus {
	outline: none;
	border-color: #6366f1;
	box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.tmwpass-td__transfer-feedback {
	display: block;
	margin-top: 0.6em;
	font-size: 0.84em;
	line-height: 1.4;
}

.tmwpass-td__transfer-feedback:empty {
	display: none;
}

.tmwpass-td__transfer-feedback--success {
	color: #166534;
}

.tmwpass-td__transfer-feedback--error {
	color: #991b1b;
}

/* ── QR section ───────────────────────────────────────────────── */

.tmwpass-td__qr-section {
	text-align: center;
	padding: 1.5em 1.5em 1.25em;
	border-bottom: 1px dashed #e5e7eb;
}

.tmwpass-td__qr-label {
	margin: 0 0 0.75em;
	font-size: 0.8em;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #9ca3af;
}

.tmwpass-td__qr-image {
	display: inline-block;
	border: 4px solid #f3f4f6;
	border-radius: 6px;
}

.tmwpass-td__credential-code {
	margin: 1em 0 0;
	font-size: 0.85em;
	color: #6b7280;
}

.tmwpass-td__credential-label {
	display: block;
	font-size: 0.85em;
	color: #9ca3af;
	margin-bottom: 0.25em;
}

.tmwpass-td__credential-value {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 1.4em;
	font-weight: 700;
	letter-spacing: 0.15em;
	color: #1f2937;
}

/* ── Completion indicator ─────────────────────────────────────── */

.tmwpass-td__completion {
	padding: 0.75em 1.5em;
	font-size: 0.85em;
	border-bottom: 1px solid #e5e7eb;
}

.tmwpass-td__completion--complete {
	color: #166534;
}

.tmwpass-td__completion--complete::before {
	content: "\2713 ";
}

.tmwpass-td__completion--incomplete {
	color: #b45309;
}

.tmwpass-td__completion--incomplete::before {
	content: "\25CB ";
}

/* ── Fields form ──────────────────────────────────────────────── */

.tmwpass-td__fields-form {
	padding: 1.25em 1.5em 1.5em;
}

.tmwpass-td__field-row {
	margin-bottom: 1em;
}

.tmwpass-td__field-row label {
	display: block;
	margin-bottom: 0.3em;
	font-size: 0.875em;
	font-weight: 500;
	color: #374151;
}

.tmwpass-td__field-row input[type="text"],
.tmwpass-td__field-row input[type="email"],
.tmwpass-td__field-row select {
	display: block;
	width: 100%;
	padding: 0.55em 0.75em;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 0.95em;
	background: #fff;
	color: #1f2937;
	transition: border-color 0.15s;
	box-sizing: border-box;
}

.tmwpass-td__field-row input:focus,
.tmwpass-td__field-row select:focus {
	outline: none;
	border-color: #6366f1;
	box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.tmwpass-td__field-row input:disabled,
.tmwpass-td__field-row select:disabled {
	background: #f9fafb;
	color: #9ca3af;
	cursor: not-allowed;
}

.tmwpass-td__field-row--missing input,
.tmwpass-td__field-row--missing select {
	border-color: #f59e0b;
}

.tmwpass-td__field-row--error input,
.tmwpass-td__field-row--error select {
	border-color: #ef4444;
}

.tmwpass-td__required {
	color: #ef4444;
}

.tmwpass-td__field-desc {
	display: block;
	margin-top: 0.25em;
	font-size: 0.8em;
	color: #9ca3af;
}

.tmwpass-td__field-error {
	display: block;
	margin-top: 0.2em;
	font-size: 0.8em;
	color: #ef4444;
	min-height: 0;
}

.tmwpass-td__field-error:empty {
	display: none;
}

.tmwpass-td__checkbox-label {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	font-size: 0.925em;
	cursor: pointer;
}

.tmwpass-td__checkbox-label input[type="checkbox"] {
	width: 1.1em;
	height: 1.1em;
}

/* ── Form actions ─────────────────────────────────────────────── */

.tmwpass-td__form-actions {
	display: flex;
	align-items: center;
	gap: 1em;
	margin-top: 1.25em;
}

.tmwpass-td__form-feedback {
	font-size: 0.875em;
	line-height: 1.4;
}

.tmwpass-td__form-feedback--success {
	color: #166534;
}

.tmwpass-td__form-feedback--error {
	color: #991b1b;
}

/* ── Buttons ──────────────────────────────────────────────────── */

.tmwpass-td__btn {
	display: inline-block;
	padding: 0.6em 1.5em;
	border: none;
	border-radius: 6px;
	font-size: 0.925em;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	line-height: 1.4;
	transition: opacity 0.15s;
}

.tmwpass-td__btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.tmwpass-td__btn--primary {
	background: #1f2937;
	color: #fff;
}

.tmwpass-td__btn--primary:hover:not(:disabled) {
	background: #111827;
}

.tmwpass-td__btn--small {
	padding: 0.45em 1em;
	font-size: 0.875em;
	white-space: nowrap;
}

.tmwpass-td__btn--text {
	background: none;
	padding: 0.4em 0;
	color: #6b7280;
	font-weight: 500;
	font-size: 0.85em;
}

.tmwpass-td__btn--text:hover {
	color: #374151;
}

/* ── Login card ───────────────────────────────────────────────── */

.tmwpass-td__login-card {
	max-width: 420px;
	margin: 2em auto;
	padding: 2em;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
}

.tmwpass-td__login-card h2 {
	margin: 0 0 0.5em;
	font-size: 1.3em;
}

.tmwpass-td__login-card p {
	margin: 0 0 1.5em;
	font-size: 0.925em;
	color: #6b7280;
	line-height: 1.5;
}

.tmwpass-td__login-form .tmwpass-td__field-row {
	margin-bottom: 1.25em;
}

.tmwpass-td__login-feedback {
	margin-top: 1em;
	font-size: 0.9em;
	line-height: 1.5;
}

.tmwpass-td__login-feedback--success {
	color: #166534;
	padding: 0.75em 1em;
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	border-radius: 6px;
}

.tmwpass-td__login-feedback--error {
	color: #991b1b;
}

/* ── Thank-you summary variant ────────────────────────────────── */

.tmwpass-td--summary {
	padding-bottom: 1.5em;
}

.tmwpass-td--summary .tmwpass-td__heading {
	font-size: 1.15em;
	margin-bottom: 1em;
}

.tmwpass-td__ticket--summary {
	margin-bottom: 0.75em;
}

.tmwpass-td__ticket--summary .tmwpass-td__ticket-header {
	border-bottom: none;
}

.tmwpass-td__summary-cta {
	margin-top: 1.25em;
	text-align: center;
}

/* ── Responsive ───────────────────────────────────────────────── */

@media (max-width: 600px) {
	.tmwpass-td__header {
		flex-direction: column;
		align-items: flex-start;
	}

	.tmwpass-td__ticket-header {
		flex-direction: column;
		gap: 0.5em;
	}

	.tmwpass-td__ticket-meta {
		flex-direction: row;
		align-items: center;
	}

	.tmwpass-td__attendee-section {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.5em;
		padding: 0.9em 1em;
	}

	.tmwpass-td__transfer-form {
		padding: 0.9em 1em 1em;
	}

	.tmwpass-td__transfer-row {
		flex-direction: column;
		align-items: stretch;
	}

	.tmwpass-td__fields-form {
		padding: 1em;
	}

	.tmwpass-td__form-actions {
		flex-direction: column;
		align-items: flex-start;
	}
}
