/* Titip Book Calculator — front-end
   Tokens from the original Hostinger build; page sits on warm paper, the card on white,
   with the same offset "print" shadow motif as the hero image. */

:root {
	--tbc-paper: hsl(40 33% 97%);
	--tbc-bg: hsl(0 0% 100%);
	--tbc-fg: hsl(30 22% 14%);
	--tbc-card: hsl(0 0% 100%);
	--tbc-primary: hsl(355 55% 38%);
	--tbc-primary-fg: hsl(42 40% 96%);
	--tbc-secondary: hsl(38 24% 82%);
	--tbc-muted: hsl(38 24% 84%);
	--tbc-muted-fg: hsl(30 18% 38%);
	--tbc-border: hsl(34 22% 70%);
	--tbc-ink: hsl(225 36% 31%);
	--tbc-panel: hsl(337 58% 93%);
	--tbc-alert: hsl(344 80% 58%);
	--tbc-display: "Archivo Black", "Arial Black", sans-serif;
	--tbc-serif: "Newsreader", Georgia, serif;
	--tbc-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--tbc-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	--tbc-offset: 8px;
}

/* ------------------------------------------------------------- base (page owns the document) */
.tbc-page,
.tbc-page * { box-sizing: border-box; }
.tbc-page {
	margin: 0;
	background: var(--tbc-paper);
	color: var(--tbc-fg);
	font-family: var(--tbc-sans);
	font-size: 16px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}
.tbc-page main { flex: 1 0 auto; }
.tbc-page img { max-width: 100%; height: auto; display: block; }
.tbc-page a { color: inherit; text-decoration: none; }
:where(.tbc-page) :where(h1, h2, h3, p) { margin: 0; font-weight: inherit; }
:where(.tbc-page) :where(button) { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:where(.tbc-page) :where(input, textarea, select) { font: inherit; color: inherit; }
.tbc-page :focus-visible { outline: 2px solid var(--tbc-primary); outline-offset: 3px; }
.tbc-page.admin-bar .tbc-header { top: 32px; }
@media (max-width: 782px) { .tbc-page.admin-bar .tbc-header { top: 46px; } }

/* ------------------------------------------------------------- header */
.tbc-header {
	position: sticky;
	top: 0;
	z-index: 30;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.5rem 1.25rem;
	border-top: 3px solid var(--tbc-primary);
	border-bottom: 1px solid var(--tbc-border);
	background: hsl(40 33% 97% / 0.85);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}
.tbc-brand { display: inline-flex; align-items: center; min-height: 44px; }
.tbc-brand img { height: 3.6rem; width: auto; border-radius: 2px; }
@media (min-width: 768px) { .tbc-brand img { height: 4.25rem; } }
.tbc-brand span { font-family: var(--tbc-display); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; }
.tbc-header-actions { display: flex; align-items: center; gap: 0.5rem; }
.tbc-pill {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-width: 44px;
	min-height: 44px;
	padding: 0 0.85rem;
	border: 1px solid var(--tbc-border);
	border-radius: 999px;
	background: var(--tbc-bg);
	color: var(--tbc-fg);
	font-family: var(--tbc-display);
	font-size: 0.7rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	transition: color 0.15s, border-color 0.15s, transform 0.15s, background 0.15s;
}
.tbc-pill:hover { color: var(--tbc-primary); border-color: var(--tbc-primary); }
.tbc-pill:active { transform: scale(0.96); }
.tbc-pill .fa-whatsapp { font-size: 1.25rem; }
.tbc-pill-ghost { background: transparent; }
.tbc-pill-text { display: none; }
@media (min-width: 640px) { .tbc-pill-text { display: inline; } }
.tbc-cart-count {
	min-width: 1.35rem;
	height: 1.35rem;
	padding: 0 0.35rem;
	border-radius: 999px;
	background: var(--tbc-primary);
	color: var(--tbc-primary-fg);
	font-size: 0.65rem;
	line-height: 1.35rem;
	text-align: center;
}
.tbc-cart-count[hidden] { display: none; }
@media (max-width: 639px) {
	.tbc-cart-count { position: absolute; top: -6px; right: -4px; }
}

/* ------------------------------------------------------------- hero */
.tbc-hero {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: calc(100dvh - 5.5rem);
	padding: 2.5rem 1.25rem 5rem;
	text-align: center;
}
.tbc-tagline {
	font-family: var(--tbc-serif);
	font-style: italic;
	font-weight: 500;
	font-size: 1.25rem;
	letter-spacing: 0.02em;
	color: var(--tbc-fg);
}
.tbc-hero-image {
	position: relative;
	width: 20rem;
	max-width: 100%;
	margin: 1.5rem auto 0;
	transform: rotate(-3deg);
}
.tbc-hero-image-offset {
	position: absolute;
	inset: 0;
	transform: translate(var(--tbc-offset), var(--tbc-offset));
	background: hsl(355 55% 38% / 0.4);
}
.tbc-hero-image img {
	position: relative;
	width: 100%;
	border: 1px solid var(--tbc-border);
	object-fit: cover;
}
@media (min-width: 768px) {
	.tbc-tagline { font-size: 1.6rem; }
	.tbc-hero-image { width: 28rem; }
}

/* One orchestrated entrance; nothing else moves on its own. */
.tbc-reveal { animation: tbc-reveal 0.55s ease-out both; animation-delay: calc(var(--i, 0) * 0.09s); }
@keyframes tbc-reveal { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.tbc-hero-image.tbc-reveal { animation-name: tbc-reveal-tilt; }
@keyframes tbc-reveal-tilt { from { opacity: 0; transform: translateY(14px) rotate(-3deg); } to { opacity: 1; transform: rotate(-3deg); } }

/* ------------------------------------------------------------- calculator card */
.tbc-card-wrap { width: 100%; max-width: 42rem; margin: 3.5rem auto 0; }
.tbc-card {
	position: relative;
	width: 100%;
	max-width: 42rem;
	margin: 0 auto;
	padding: 1.5rem;
	border: 1px solid var(--tbc-border);
	background: var(--tbc-card);
	box-shadow: var(--tbc-offset) var(--tbc-offset) 0 hsl(355 55% 38% / 0.14);
	text-align: left;
	color: var(--tbc-fg);
}
@media (min-width: 768px) { .tbc-card { padding: 2.5rem; } }
.tbc-grid { display: grid; gap: 1.75rem; }
.tbc-grid-secondary { margin-top: 2.25rem; padding-top: 1.5rem; border-top: 1px solid var(--tbc-border); gap: 1.5rem; }
@media (min-width: 768px) { .tbc-grid { grid-template-columns: 1fr 1fr; gap: 2rem; } }
.tbc-field label,
.tbc-label {
	display: block;
	font-family: var(--tbc-display);
	font-size: 0.72rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--tbc-muted-fg);
}
.tbc-input-wrap {
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
	margin-top: 0.7rem;
	padding-bottom: 0.5rem;
	border-bottom: 2px solid var(--tbc-border);
	transition: border-color 0.15s;
}
.tbc-input-wrap:focus-within { border-bottom-color: var(--tbc-primary); }
.tbc-affix { font-family: var(--tbc-display); font-size: 1.1rem; color: hsl(30 18% 38% / 0.55); }
.tbc-input {
	flex: 1 1 auto;
	min-width: 0;
	width: 100%;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	font-family: var(--tbc-display);
	font-weight: 400;
	font-size: 1.125rem;
	line-height: 1.3;
	letter-spacing: 0.01em;
	color: var(--tbc-fg);
	outline: none;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
}
.tbc-input::placeholder { color: hsl(30 18% 38% / 0.35); }
.tbc-input:focus { outline: none; box-shadow: none; }
.tbc-input-lg { font-size: 1.875rem; }
.tbc-input-wrap-lg .tbc-affix { font-size: 1.25rem; }
#tbc-link { font-size: 1rem; }
@media (min-width: 768px) {
	.tbc-input { font-size: 1.25rem; }
	.tbc-input-lg { font-size: 2.25rem; }
	.tbc-input-wrap-lg .tbc-affix { font-size: 1.5rem; }
	#tbc-link { font-size: 1.05rem; }
}
.tbc-total-wrap { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--tbc-border); }
.tbc-total {
	margin-top: 0.5rem;
	font-family: var(--tbc-display);
	font-size: clamp(1.6rem, 8.5vw, 3rem);
	line-height: 1;
	letter-spacing: -0.01em;
	color: var(--tbc-primary);
	text-shadow: 0.04em 0.04em 0 hsl(355 55% 38% / 0.28);
	white-space: nowrap;
	overflow: hidden;
}
@media (min-width: 768px) { .tbc-total { font-size: 4.5rem; } }
.tbc-total.is-bump { animation: tbc-bump 0.25s ease-out; }
@keyframes tbc-bump { from { opacity: 0.4; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.tbc-error {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-top: 1rem;
	font-family: var(--tbc-serif);
	font-style: italic;
	font-size: 0.95rem;
	color: var(--tbc-primary);
}
.tbc-error::before { content: "!"; flex: 0 0 auto; width: 1rem; height: 1rem; border: 1.5px solid currentColor; border-radius: 50%; font-family: var(--tbc-display); font-style: normal; font-size: 0.65rem; line-height: 0.85rem; text-align: center; }
.tbc-error[hidden] { display: none; }

.tbc-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	width: 100%;
	min-height: 48px;
	padding: 1rem 1.5rem;
	border: 1px solid var(--tbc-primary);
	background: var(--tbc-primary);
	color: var(--tbc-primary-fg);
	font-family: var(--tbc-display);
	font-size: 0.875rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	text-align: center;
	transition: filter 0.15s, transform 0.1s, opacity 0.15s, background 0.2s;
}
.tbc-btn:hover:not(:disabled):not(.is-disabled) { filter: brightness(1.1); }
.tbc-btn:active:not(:disabled) { transform: scale(0.98); }
.tbc-btn:disabled, .tbc-btn.is-disabled { opacity: 0.3; cursor: not-allowed; }
.tbc-btn-inline { display: inline-flex; width: auto; }
.tbc-btn-outline { background: transparent; color: var(--tbc-primary); }
.tbc-add {
	margin-top: 2rem;
	box-shadow: 5px 5px 0 hsl(355 55% 22% / 0.35);
	transition: background 0.25s, color 0.25s, border-color 0.25s, box-shadow 0.25s, transform 0.1s, filter 0.15s;
}
.tbc-add:disabled {
	opacity: 1;
	background: hsl(355 28% 90%);
	border-color: hsl(355 28% 84%);
	color: hsl(355 30% 48%);
	box-shadow: 5px 5px 0 hsl(355 28% 84% / 0.8);
	cursor: not-allowed;
}
.tbc-add:not(:disabled):active { transform: translate(2px, 2px); box-shadow: 3px 3px 0 hsl(355 55% 22% / 0.35); }
.tbc-add.is-done { background: hsl(150 40% 32%); border-color: hsl(150 40% 32%); box-shadow: 5px 5px 0 hsl(150 40% 18% / 0.35); }
.tbc-add-spinner { display: none; animation: tbc-spin 0.8s linear infinite; }
.tbc-add.is-busy .tbc-add-icon { display: none; }
.tbc-add.is-busy .tbc-add-spinner { display: block; }
@keyframes tbc-spin { to { transform: rotate(360deg); } }
.tbc-note {
	margin-top: 1rem;
	text-align: center;
	font-family: var(--tbc-serif);
	font-style: italic;
	font-size: 0.85rem;
	color: var(--tbc-muted-fg);
}

/* Instruction box */
.tbc-instructions {
	margin-top: 1.5rem;
	border: 1px solid hsl(34 22% 70% / 0.75);
	background: var(--tbc-paper);
	padding: 0.9rem 0.85rem;
	color: var(--tbc-ink);
	font-size: 0.78rem;
	line-height: 1.55;
}
.tbc-instructions ol { margin: 0; padding-left: 1.2rem; }
.tbc-instructions li + li { margin-top: 0.5rem; }
.tbc-instructions strong { font-weight: 700; }
.tbc-examples {
	margin: 0.45rem 0 0.2rem;
	border-radius: 0.45rem;
	background: var(--tbc-panel);
	padding: 0.45rem 0.7rem;
	font-family: var(--tbc-mono);
	font-size: 0.72rem;
	line-height: 1.7;
}
.tbc-warning { color: var(--tbc-alert); font-weight: 700; }

/* ------------------------------------------------------------- footer */
.tbc-footer { border-top: 1px solid var(--tbc-border); background: var(--tbc-bg); padding: 2.5rem 1.25rem; }
.tbc-footer-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1.5rem;
	max-width: 72rem;
	margin: 0 auto;
	text-align: center;
}
.tbc-footer-brand { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.tbc-footer-brand img { height: 4.5rem; width: auto; border-radius: 2px; }
.tbc-footer-brand span { font-family: var(--tbc-display); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; }
.tbc-footer-tagline { font-family: var(--tbc-serif); font-style: italic; font-size: 0.9rem; color: var(--tbc-muted-fg); }
.tbc-social { display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.tbc-social a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	font-size: 1.75rem;
	color: var(--tbc-fg);
	transition: transform 0.15s;
}
.tbc-social a:hover { transform: translateY(-2px); }
.tbc-social .fa-whatsapp { color: #25d366; }
.tbc-social .fa-threads { color: #000; }
.tbc-social .fa-instagram {
	background: linear-gradient(45deg, #feda77 0%, #d62976 50%, #4f5bd5 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	-webkit-text-fill-color: transparent;
}
.tbc-copyright { font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--tbc-muted-fg); }
@media (min-width: 768px) {
	.tbc-footer-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; text-align: left; }
	.tbc-footer-brand { align-items: flex-start; justify-self: start; }
	.tbc-copyright { justify-self: end; }
}

/* ------------------------------------------------------------- cart drawer */
.tbc-drawer-backdrop {
	position: fixed;
	inset: 0;
	z-index: 40;
	background: hsl(30 22% 14% / 0.45);
}
.tbc-drawer-backdrop[hidden] { display: none; }
.tbc-drawer {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: 50;
	display: flex;
	flex-direction: column;
	width: min(28rem, 100%);
	background: var(--tbc-paper);
	color: var(--tbc-fg);
	border-left: 1px solid var(--tbc-border);
	transform: translateX(100%);
	transition: transform 0.25s ease-out;
	box-shadow: -12px 0 40px hsl(30 22% 14% / 0.15);
}
.tbc-drawer.is-open { transform: none; }
.tbc-drawer-open { overflow: hidden; }
.tbc-drawer-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1.25rem 1.5rem;
	border-bottom: 1px solid var(--tbc-border);
	background: var(--tbc-bg);
}
.tbc-drawer-head h2 { font-family: var(--tbc-display); font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; }
.tbc-drawer-close { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
.tbc-drawer-body { flex: 1 1 auto; overflow-y: auto; padding: 1.5rem; }
.tbc-drawer-empty { font-family: var(--tbc-serif); font-style: italic; color: var(--tbc-muted-fg); }
.tbc-drawer-empty[hidden] { display: none; }
.tbc-drawer-items { list-style: none; margin: 0; padding: 0; }
.tbc-drawer-item {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 1rem;
	border: 1px solid var(--tbc-border);
	border-left: 3px solid var(--tbc-primary);
	background: var(--tbc-bg);
}
.tbc-drawer-item + .tbc-drawer-item { margin-top: 0.75rem; }
.tbc-drawer-item-main { min-width: 0; }
.tbc-drawer-item-name { font-family: var(--tbc-display); font-size: 0.85rem; line-height: 1.35; }
.tbc-drawer-item-meta { margin-top: 0.25rem; font-size: 0.8rem; color: var(--tbc-muted-fg); }
.tbc-drawer-item-link { display: block; margin-top: 0.25rem; font-size: 0.72rem; color: var(--tbc-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbc-drawer-item-side { display: flex; flex-direction: column; align-items: flex-end; gap: 0.5rem; flex: 0 0 auto; }
.tbc-drawer-item-total { font-family: var(--tbc-display); color: var(--tbc-primary); }
.tbc-drawer-remove { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tbc-muted-fg); text-decoration: underline; text-underline-offset: 3px; }
.tbc-drawer-remove:hover { color: var(--tbc-primary); }
.tbc-drawer-foot { padding: 1.5rem; border-top: 1px solid var(--tbc-border); background: var(--tbc-bg); }
.tbc-drawer-row { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--tbc-muted-fg); }
.tbc-drawer-row + .tbc-drawer-row { margin-top: 0.4rem; }
.tbc-drawer-total { font-family: var(--tbc-display); font-size: 1rem; color: var(--tbc-fg); }
.tbc-drawer-total strong { color: var(--tbc-primary); }
.tbc-drawer-hint { margin-top: 0.5rem; font-family: var(--tbc-serif); font-style: italic; font-size: 0.78rem; color: var(--tbc-muted-fg); }
.tbc-drawer-checkout { margin-top: 1rem; }

/* ------------------------------------------------------------- toast */
.tbc-toast {
	position: fixed;
	left: 50%;
	bottom: 1.5rem;
	z-index: 60;
	max-width: min(32rem, calc(100% - 2rem));
	padding: 0.85rem 1.1rem;
	border: 1px solid var(--tbc-border);
	border-left: 3px solid var(--tbc-primary);
	background: var(--tbc-bg);
	color: var(--tbc-fg);
	font-size: 0.85rem;
	line-height: 1.4;
	box-shadow: 0 10px 30px hsl(30 22% 14% / 0.15);
	transform: translateX(-50%);
}
.tbc-toast.is-error { border-left-color: var(--tbc-alert); color: var(--tbc-alert); }
.tbc-toast[hidden] { display: none; }

/* ------------------------------------------------------------- shell (checkout / thank-you) */
.tbc-shell-main { padding: 2.5rem 1.25rem 5rem; }
.tbc-shell-inner { max-width: 68rem; margin: 0 auto; }
.tbc-shell-head { margin-bottom: 2rem; }
.tbc-back {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	min-height: 44px;
	font-family: var(--tbc-display);
	font-size: 0.7rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--tbc-muted-fg);
}
.tbc-back:hover { color: var(--tbc-primary); }
.tbc-shell-title { margin: 0.25rem 0 0; font-family: var(--tbc-display); font-weight: 400; font-size: 2rem; line-height: 1.1; text-shadow: 0.04em 0.04em 0 hsl(355 55% 38% / 0.18); }
.tbc-shell-sub { margin-top: 0.5rem; max-width: 40rem; font-family: var(--tbc-serif); font-style: italic; font-size: 1rem; color: var(--tbc-muted-fg); }
@media (min-width: 768px) {
	.tbc-shell-main { padding: 3rem 2rem 6rem; }
	.tbc-shell-title { font-size: 2.75rem; }
}

@media (prefers-reduced-motion: reduce) {
	.tbc-reveal, .tbc-hero-image.tbc-reveal, .tbc-drawer, .tbc-total, .tbc-pill, .tbc-btn, .tbc-social a { transition: none; animation: none; }
}
