/* =====================================================================
   Appointment Booking Pro — the meeting card
   Every colour, font and layout choice below is driven by the custom
   properties the settings screen writes onto :root (and onto the card
   itself, so a card dropped into the console still looks right).
   ================================================================== */

@font-face {
	font-family: "IRANSans";
	src: url("../fonts/iransans.woff2") format("woff2");
	font-weight: 400;
	font-display: swap;
}

@font-face {
	font-family: "IRANSans";
	src: url("../fonts/iransans-bold.woff2") format("woff2");
	font-weight: 700;
	font-display: swap;
}

:root {
	--abp-accent: #6b8f68;
	--abp-accent-deep: #2f4030;
	--abp-page: #e2e8e0;

	--abp-card-bg: #f8f7f2;
	--abp-card-head-bg: #2f4030;
	--abp-card-head-fg: #ffffff;
	--abp-card-title: #2f4030;
	--abp-card-label: #6d7c6b;
	--abp-card-value: #2f4030;
	--abp-card-accent: #6b8f68;
	--abp-card-sans: "IRANSans", "Segoe UI", system-ui, -apple-system, Tahoma, sans-serif;
	--abp-card-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

body.abp-card-body {
	margin: 0;
	padding: clamp(16px, 5vw, 54px) 14px;
	min-height: 100vh;
	background:
		radial-gradient(900px 500px at 15% -10%, rgba(255, 255, 255, .8), transparent 60%),
		var(--abp-page);
	font-family: var(--abp-card-sans);
	color: var(--abp-card-value);
	-webkit-text-size-adjust: 100%;
}

.abp-card-page { max-width: 620px; margin: 0 auto; }

/* =====================================================================
   The card
   ================================================================== */

.abp-card {
	position: relative;
	max-width: 580px;
	border-radius: 24px;
	background: var(--abp-card-bg);
	font-family: var(--abp-card-sans);
	box-shadow: 0 44px 90px -42px rgba(34, 48, 31, .6);
	overflow: hidden;
	box-sizing: border-box;
	animation: abp-card-in .7s cubic-bezier(.22, 1, .36, 1) both;
}

.abp-card *,
.abp-card *::before,
.abp-card *::after { box-sizing: border-box; }

@keyframes abp-card-in {
	from { opacity: 0; transform: translateY(20px) scale(.98); }
	to { opacity: 1; transform: none; }
}

/* faint guilloche wash — makes a photocopy look obviously wrong */
.abp-card::after {
	content: "";
	position: absolute;
	inset: 0;
	background-image:
		repeating-linear-gradient(58deg, rgba(47, 64, 48, .03) 0 1px, transparent 1px 7px),
		repeating-linear-gradient(-58deg, rgba(47, 64, 48, .03) 0 1px, transparent 1px 7px);
	pointer-events: none;
}

.abp-card-sheen {
	position: absolute;
	top: -60%;
	left: -30%;
	width: 60%;
	height: 220%;
	background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
	transform: rotate(12deg);
	pointer-events: none;
	animation: abp-sheen 6s ease-in-out 1s infinite;
}

@keyframes abp-sheen {
	0%, 70%, 100% { transform: translateX(0) rotate(12deg); opacity: 0; }
	78% { opacity: .9; }
	85%, 99% { transform: translateX(340%) rotate(12deg); opacity: 0; }
}

/* ---------- header band ---------- */

.abp-card-head {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 22px clamp(20px, 4vw, 32px);
	background: var(--abp-card-head-bg);
	color: var(--abp-card-head-fg);
	border-bottom: 5px solid var(--abp-card-accent);
}

.abp-card-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }

.abp-card-mark {
	display: grid;
	place-items: center;
	width: 54px;
	height: 54px;
	flex: 0 0 auto;
	border-radius: 15px;
	background: rgba(255, 255, 255, .12);
	overflow: hidden;
}

.abp-card-mark img {
	width: 40px;
	height: 40px;
	object-fit: contain;
	filter: brightness(0) invert(1);
	opacity: .96;
}

.abp-card-brand strong {
	display: block;
	font-size: 1.02rem;
	font-weight: 700;
	line-height: 1.25;
	color: var(--abp-card-head-fg);
}

.abp-card-brand span {
	display: block;
	margin-top: 3px;
	font-size: .8rem;
	color: var(--abp-card-head-fg);
	opacity: .7;
}

.abp-card-kind {
	flex: 0 0 auto;
	padding: 7px 15px;
	border-radius: 999px;
	background: var(--abp-card-accent);
	color: #fff;
	font-size: .68rem;
	font-weight: 700;
	letter-spacing: .16em;
	text-transform: uppercase;
	white-space: nowrap;
}

/* ---------- reference ---------- */

.abp-card-code {
	position: relative;
	z-index: 1;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 14px;
	padding: 22px clamp(20px, 4vw, 32px) 18px;
}

.abp-card-code-label {
	width: 100%;
	font-size: .68rem;
	font-weight: 700;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--abp-card-label);
}

.abp-card-code-value {
	font-family: var(--abp-card-mono);
	font-size: clamp(1.45rem, 5vw, 1.95rem);
	font-weight: 700;
	letter-spacing: .04em;
	color: var(--abp-card-accent);
}

.abp-card-status {
	padding: 6px 14px;
	border-radius: 999px;
	font-size: .74rem;
	font-weight: 700;
	background: rgba(47, 64, 48, .1);
	color: var(--abp-card-title);
}

.abp-status-confirmed { background: rgba(107, 143, 104, .22); color: #3d6039; }
.abp-status-pending { background: rgba(184, 134, 58, .2); color: #8a6220; }
.abp-status-cancelled,
.abp-status-rejected { background: rgba(180, 69, 60, .18); color: #93362e; }
.abp-status-completed { background: rgba(47, 64, 48, .16); color: #2f4030; }
.abp-status-no_show { background: rgba(120, 120, 120, .18); color: #555; }

/* ---------- details ---------- */

.abp-card-grid {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px 22px;
	margin: 0 clamp(20px, 4vw, 32px);
	padding: 20px 0;
	border-top: 1px dashed rgba(47, 64, 48, .18);
	border-bottom: 1px dashed rgba(47, 64, 48, .18);
}

.abp-card-field.abp-span { grid-column: 1 / -1; }

.abp-card-field label,
.abp-card-purpose label {
	display: block;
	margin-bottom: 4px;
	font-size: .68rem;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--abp-card-label);
}

.abp-card-field p {
	margin: 0;
	font-size: 1.02rem;
	font-weight: 700;
	line-height: 1.4;
	color: var(--abp-card-value);
	word-break: break-word;
}

.abp-card-purpose {
	position: relative;
	z-index: 1;
	padding: 16px clamp(20px, 4vw, 32px) 4px;
}

.abp-card-purpose p {
	margin: 0;
	font-size: .92rem;
	line-height: 1.65;
	color: var(--abp-card-value);
}

/* deterministic stripe drawn from the card token */
.abp-fingerprint {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: flex-end;
	gap: 3px;
	height: 26px;
	margin: 20px clamp(20px, 4vw, 32px) 16px;
	opacity: .5;
}

.abp-fingerprint span {
	flex: 1 1 auto;
	background: var(--abp-card-head-bg);
	border-radius: 1px;
}

.abp-card-foot {
	position: relative;
	z-index: 1;
	margin: 0 clamp(20px, 4vw, 32px);
	padding: 14px 0 22px;
	border-top: 1px solid rgba(47, 64, 48, .1);
	font-size: .78rem;
	line-height: 1.7;
	color: var(--abp-card-label);
}

.abp-card-foot p { margin: 0 0 4px; }
.abp-card-addr { font-weight: 600; }

/* =====================================================================
   Layout variants
   ================================================================== */

/* stacked — one column, easier to read on a phone or in a scan */
.abp-card-stacked .abp-card-grid { grid-template-columns: 1fr; }

/* ticket — a torn stub on the left carrying the reference */
.abp-card-ticket .abp-card-code {
	margin: 20px clamp(20px, 4vw, 32px) 4px;
	padding: 16px 20px;
	border-radius: 16px;
	background: rgba(47, 64, 48, .06);
	border-left: 5px solid var(--abp-card-accent);
}

.abp-card-ticket .abp-card-grid {
	border-top: 0;
	margin-top: 8px;
}

.abp-card-ticket::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 64%;
	border-top: 2px dashed rgba(47, 64, 48, .18);
	z-index: 0;
}

/* centred alignment */
.abp-card-centered .abp-card-head { flex-direction: column; text-align: center; }
.abp-card-centered .abp-card-brand { flex-direction: column; text-align: center; }
.abp-card-centered .abp-card-code { justify-content: center; text-align: center; }
.abp-card-centered .abp-card-code-label { text-align: center; }
.abp-card-centered .abp-card-foot { text-align: center; }

/* =====================================================================
   Page chrome around the card
   ================================================================== */

.abp-card-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	margin-top: 26px;
}

.abp-card-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 50px;
	padding: 0 26px;
	border: 0;
	border-radius: 999px;
	background: var(--abp-card-accent);
	color: #fff;
	font-family: inherit;
	font-size: .94rem;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	box-shadow: 0 16px 30px -18px rgba(47, 64, 48, .9);
	transition: transform .25s cubic-bezier(.22, 1, .36, 1), box-shadow .25s;
}

.abp-card-btn:hover { transform: translateY(-2px); box-shadow: 0 22px 38px -20px rgba(47, 64, 48, .95); }

.abp-card-btn.ghost {
	background: transparent;
	color: var(--abp-card-title);
	box-shadow: inset 0 0 0 1.5px rgba(47, 64, 48, .2);
}

.abp-card-missing {
	max-width: 460px;
	margin: 12vh auto;
	padding: 34px;
	border-radius: 24px;
	background: var(--abp-card-bg);
	text-align: center;
	box-shadow: 0 40px 80px -44px rgba(34, 48, 31, .6);
}

.abp-card-missing h1 { margin: 0 0 10px; font-size: 1.3rem; color: var(--abp-card-title); }
.abp-card-missing p { margin: 0; color: var(--abp-card-label); font-size: .92rem; }

/* =====================================================================
   Phone
   ================================================================== */

@media (max-width: 520px) {
	.abp-card-grid { grid-template-columns: 1fr; }
	.abp-card-head { flex-direction: column; align-items: flex-start; }
	.abp-card-btn { width: 100%; }
	.abp-card-ticket::before { display: none; }
}

/* =====================================================================
   Print — kept working even though the button now offers a picture
   ================================================================== */

@media print {
	body.abp-card-body { background: #fff; padding: 0; }

	.no-print,
	.abp-card-actions,
	.abp-card-sheen { display: none !important; }

	.abp-card {
		max-width: 100%;
		box-shadow: none;
		border: 1px solid #cfd8cd;
		border-radius: 12px;
		animation: none;
		page-break-inside: avoid;
	}

	.abp-card::after { opacity: .5; }
}
