/*
Theme Name: VisitTatry
Theme URI: https://cardberg.com/
Author: AnorWeb
Author URI: https://anorweb.com/
Description: A single-purpose, alpine-themed WordPress theme that recreates the VisitTatry / TatryCard reservation-verification flow from the TATRY Figma design. Visitors verify a reservation, view their stay benefits, activate a free TatryCard, and buy a discounted travel ticket. Built as a classic PHP theme with a filterable AJAX backend so the verification/activation can be wired to a real API. Powered by cardberg.com.
Version: 1.5.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: visittatry
Tags: custom-background, translation-ready, full-width-template, one-column
*/

/* ==========================================================================
   Design tokens — sampled from the TATRY Figma file
   ========================================================================== */
:root {
	--c-primary:        #A079FF;
	--c-primary-dark:   #8A5CE6;
	--c-primary-soft:   #EFE9FF;
	--c-accent:         #DF5959;
	--c-accent-dark:    #C94A4A;
	--c-accent-soft:    #FCEDED;
	--c-ink:            #11283B;
	--c-text:           #3F4E5B;
	--c-muted:          #8B98A6;
	--c-line:           #E7E2F4;
	--c-card:           #FFFFFF;
	--c-card-2:         #F6F4FE;
	--c-bg:             #F4EFFF;
	--c-header:         #A079FF;
	--c-btn:            #6E6E76;
	--c-btn-dark:       #5A5A62;
	--c-sky-1:          #CFE4F6;
	--c-sky-2:          #EAF3FB;
	--c-sky-3:          #F7FBFE;

	--radius:           18px;
	--radius-sm:        12px;
	--radius-pill:      999px;
	--shadow-card:      0 18px 45px -22px rgba(17, 40, 59, .35);
	--shadow-soft:      0 8px 24px -14px rgba(17, 40, 59, .30);
	--shell:            1100px;

	--font-head: "Poppins", "Segoe UI", system-ui, sans-serif;
	--font-body: "Inter", "Segoe UI", system-ui, sans-serif;
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	min-height: 100vh;
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.5;
	color: var(--c-text);
	background: var(--c-bg);
	background-attachment: fixed;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

h1, h2, h3 { font-family: var(--font-head); color: var(--c-ink); margin: 0; }

.tt-visually-hidden {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ==========================================================================
   Mountain background
   ========================================================================== */
.tt-bg {
	position: fixed;
	inset: 0;
	z-index: -1;
	overflow: hidden;
	pointer-events: none;
	background: var(--c-bg) url(assets/img/new-background.png) top right / cover no-repeat;
}

/* ==========================================================================
   Shell / layout
   ========================================================================== */
.tt-shell {
	width: 100%;
	max-width: var(--shell);
	margin: 0 auto;
	padding: 0 24px;
}

.tt-page { padding-bottom: 56px; }

/* ==========================================================================
   Masthead (full-width purple band) + top bar
   ========================================================================== */
.tt-masthead {
	width: 100%;
	background: var(--c-header);
}
.tt-masthead__inner {
	display: flex;
	align-items: center;
	min-height: 61px;
	padding-top: 6px;
	padding-bottom: 6px;
}
.tt-logo { display: inline-flex; align-items: center; gap: 10px; }
.tt-logo__img { height: 38px; width: auto; display: block; }

.tt-topbar {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 16px;
	padding: 20px 0 0;
}
.tt-logo__mark { width: 42px; height: 42px; flex: 0 0 auto; }
.tt-logo__word {
	font-family: var(--font-head);
	font-weight: 700;
	font-size: 22px;
	letter-spacing: -.01em;
	color: var(--c-primary);
}
.tt-logo__word b { color: var(--c-accent); font-weight: 700; }

/* Language switcher */
.tt-lang { position: relative; }
.tt-lang__btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-width: 84px;
	padding: 11px 16px;
	background: var(--c-card);
	border: 1px solid var(--c-line);
	border-radius: var(--radius-sm);
	font-weight: 600;
	color: var(--c-ink);
	box-shadow: var(--shadow-soft);
}
.tt-lang__btn svg { width: 14px; height: 14px; transition: transform .2s ease; }
.tt-lang[data-open="true"] .tt-lang__btn svg { transform: rotate(180deg); }
.tt-lang__menu {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	min-width: 100%;
	background: var(--c-card);
	border: 1px solid var(--c-line);
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow-card);
	padding: 6px;
	display: none;
	z-index: 30;
}
.tt-lang[data-open="true"] .tt-lang__menu { display: block; }
.tt-lang__menu a,
.tt-lang__menu button {
	display: block;
	width: 100%;
	text-align: left;
	padding: 8px 12px;
	border: 0;
	background: none;
	border-radius: 8px;
	font-weight: 600;
	color: var(--c-text);
	text-decoration: none;
}
.tt-lang__menu a:hover,
.tt-lang__menu button:hover { background: var(--c-primary-soft); color: var(--c-primary); }
.tt-lang__menu .is-active { color: var(--c-primary); }

/* ==========================================================================
   Hero
   ========================================================================== */
.tt-hero { text-align: center; padding: 14px 0 34px; }
.tt-hero h1 {
	font-size: clamp(30px, 4.4vw, 46px);
	font-weight: 800;
	line-height: 1.08;
	letter-spacing: -.02em;
}
.tt-hero p {
	margin: 12px 0 0;
	font-size: clamp(16px, 1.8vw, 20px);
	color: var(--c-text);
}

/* ==========================================================================
   App grid (verify ↔ results)
   ========================================================================== */
.tt-app {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 22px;
}
.tt-app__cols {
	display: flex;
	justify-content: center;
	gap: 22px;
	width: 100%;
}
.tt-verify { width: 100%; max-width: 360px; }
.tt-results { display: none; flex: 1; max-width: 700px; }
.tt-feature, .tt-ticket { display: none; width: 100%; }

/* Verified state */
body.is-verified .tt-app__cols { align-items: flex-start; justify-content: center; }
body.is-verified .tt-verify { max-width: 320px; flex: 0 0 320px; }
body.is-verified .tt-results { display: block; }
body.is-verified .tt-feature,
body.is-verified .tt-ticket { display: block; }

/* Static benefits page template — always expanded */
.tt-app.is-static .tt-results,
.tt-app.is-static .tt-feature,
.tt-app.is-static .tt-ticket { display: block; }

/* ==========================================================================
   Cards
   ========================================================================== */
.tt-card {
	background: var(--c-card);
	border: 1px solid rgba(228, 234, 240, .9);
	border-radius: var(--radius);
	box-shadow: var(--shadow-card);
	padding: 22px;
}
.tt-card__head {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin-bottom: 18px;
}
.tt-card__ico {
	flex: 0 0 auto;
	width: 40px; height: 40px;
	display: grid; place-items: center;
	border-radius: 50%;
	background: var(--c-accent);
}
.tt-card__ico .tt-ico-img { height: 19px; width: auto; }
.tt-card__title { font-size: 16px; font-weight: 700; color: var(--c-accent); line-height: 1.2; }
.tt-card__sub { margin: 3px 0 0; font-size: 13px; color: var(--c-muted); }

/* ==========================================================================
   Fields (floating label)
   ========================================================================== */
.tt-fields { display: grid; gap: 14px; min-width: 0; }
.tt-fields--row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
@media (max-width: 400px) { .tt-fields--row { grid-template-columns: 1fr; } }
.tt-field input[type="date"] { min-height: 24px; color: var(--c-ink); }
.tt-field input[type="date"]::-webkit-calendar-picker-indicator { opacity: .5; cursor: pointer; }
.tt-field {
	display: block;
	position: relative;
	min-width: 0;
	background: var(--c-card);
	border: 1px solid var(--c-line);
	border-radius: var(--radius-sm);
	padding: 10px 16px 8px;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.tt-field:focus-within {
	border-color: var(--c-primary);
	box-shadow: 0 0 0 3px rgba(25, 106, 178, .12);
}
.tt-field__label {
	display: block;
	font-size: 12px;
	color: var(--c-muted);
	font-weight: 500;
	margin-bottom: 2px;
}
.tt-field__label .req { color: var(--c-accent); }
.tt-field input,
.tt-field select {
	width: 100%;
	min-width: 0;
	max-width: 100%;
	border: 0;
	padding: 0;
	background: none;
	font-family: inherit;
	font-size: 16px;
	font-weight: 500;
	color: var(--c-ink);
	outline: none;
	appearance: none;
}
.tt-field input::placeholder { color: var(--c-muted); font-weight: 400; }
.tt-field--select::after {
	content: "";
	position: absolute;
	right: 16px; top: 50%;
	width: 9px; height: 9px;
	border-right: 2px solid var(--c-muted);
	border-bottom: 2px solid var(--c-muted);
	transform: translateY(-65%) rotate(45deg);
	pointer-events: none;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.tt-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 15px 22px;
	border: 1px solid transparent;
	border-radius: var(--radius-sm);
	font-family: var(--font-head);
	font-weight: 600;
	font-size: 14px;
	letter-spacing: .03em;
	text-transform: uppercase;
	transition: transform .08s ease, background .15s ease, box-shadow .15s ease;
}
.tt-btn:active { transform: translateY(1px); }
.tt-btn[disabled] { opacity: .7; cursor: not-allowed; }
.tt-btn svg { width: 18px; height: 18px; flex: 0 0 auto; }

/* Design SVG icon assets rendered as <img> */
.tt-ico-img { display: block; }

.tt-btn--primary { background: var(--c-primary); color: #fff; box-shadow: 0 12px 24px -14px rgba(25,106,178,.9); }
.tt-btn--primary:hover { background: var(--c-primary-dark); }

.tt-btn--accent { background: var(--c-accent); color: #fff; box-shadow: 0 12px 24px -14px rgba(223,89,89,.9); }
.tt-btn--accent:hover { background: var(--c-accent-dark); }

.tt-btn--ghost {
	background: var(--c-card);
	color: var(--c-primary);
	border-color: var(--c-line);
	text-transform: none;
	letter-spacing: 0;
	font-weight: 600;
}
.tt-btn--ghost:hover { background: var(--c-primary-soft); }

.tt-btn.is-done { background: #2E9E6B; box-shadow: none; }
.tt-btn.is-done:hover { background: #2E9E6B; }

/* Space between the fields (or error alert) and the submit button */
.tt-form > .tt-btn { margin-top: 26px; }

.tt-form__msg { margin: 0; }
.tt-form__msg:empty { display: none; }
.tt-form__msg.tt-alert {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 14px 0 2px;
	padding: 12px 14px;
	font-size: 13.5px;
	font-weight: 500;
	line-height: 1.4;
	color: #A23131;
	background: var(--c-accent-soft);
	border: 1px solid #F1C4C4;
	border-radius: var(--radius-sm);
	animation: tt-alert-in .25s ease;
}
.tt-alert__ico { flex: 0 0 auto; width: 20px; height: 20px; color: var(--c-accent); margin-top: 1px; }
.tt-alert__text { flex: 1; }
@keyframes tt-alert-in {
	from { opacity: 0; transform: translateY(-4px); }
	to   { opacity: 1; transform: translateY(0); }
}
.tt-spinner {
	width: 16px; height: 16px;
	border: 2px solid rgba(255,255,255,.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: tt-spin .7s linear infinite;
}
@keyframes tt-spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Results — details + promo
   ========================================================================== */
.tt-results__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.tt-results .tt-card__title { font-size: 17px; }

.tt-details { display: grid; gap: 2px; margin-top: 4px; }
.tt-detail {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 9px 0;
	border-bottom: 1px solid var(--c-line);
}
.tt-detail:last-child { border-bottom: 0; }
.tt-detail__ico {
	flex: 0 0 auto;
	width: 34px; height: 34px;
	display: grid; place-items: center;
	border-radius: 50%;
	background: var(--c-primary);
}
.tt-detail__ico .tt-ico-img { height: 17px; width: auto; }
.tt-detail__label { font-size: 11px; color: var(--c-muted); text-transform: uppercase; letter-spacing: .04em; }
.tt-detail__value { font-size: 15px; font-weight: 600; color: var(--c-ink); }

.tt-change { margin-top: 16px; }

/* TatryCard promo */
.tt-promo { display: flex; flex-direction: column; }
.tt-promo__art {
	width: 100%;
	height: auto;
	display: block;
	border-radius: var(--radius-sm);
}
.tt-promo__text { font-size: 13px; color: var(--c-text); margin: 14px 0 16px; }

/* ==========================================================================
   Feature bar
   ========================================================================== */
.tt-feature__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 18px;
	padding-top: 6px;
}
.tt-feature__item { text-align: center; display: grid; gap: 8px; justify-items: center; }
.tt-feature__ico {
	width: 48px; height: 48px;
	display: grid; place-items: center;
	border-radius: 14px;
	background: var(--c-card);
	border: 1px solid var(--c-line);
	box-shadow: var(--shadow-soft);
}
.tt-feature__ico .tt-ico-img { height: 24px; width: auto; }
.tt-feature__label { font-size: 13px; font-weight: 600; color: var(--c-ink); max-width: 130px; }

/* ==========================================================================
   Travel ticket
   ========================================================================== */
.tt-ticket .tt-card { display: grid; grid-template-columns: 1.4fr auto auto; align-items: center; gap: 24px; }
.tt-ticket__head { display: flex; align-items: center; gap: 14px; }
.tt-ticket__ico {
	width: 46px; height: 46px; flex: 0 0 auto;
	display: grid; place-items: center;
	border-radius: 12px; background: var(--c-accent-soft); color: var(--c-accent);
}
.tt-ticket__ico svg { width: 26px; height: 26px; }
.tt-ticket__title { font-size: 17px; font-weight: 700; color: var(--c-accent); }
.tt-ticket__sub { font-size: 13px; color: var(--c-muted); margin-top: 2px; }
.tt-ticket__meta { text-align: right; line-height: 1.5; }
.tt-ticket__meta small { color: var(--c-muted); }
.tt-ticket__price { font-family: var(--font-head); font-weight: 700; color: var(--c-primary); font-size: 18px; }
.tt-ticket .tt-btn { width: auto; padding-left: 28px; padding-right: 28px; }

/* ==========================================================================
   Footer credit
   ========================================================================== */
.tt-credit {
	text-align: center;
	padding: 34px 0 8px;
	font-size: 13px;
	color: var(--c-muted);
}
.tt-credit a { color: var(--c-primary); font-weight: 600; }

/* ==========================================================================
   Generic WP content (pages/posts fallback)
   ========================================================================== */
.tt-content { max-width: 760px; margin: 0 auto; }
.tt-content .tt-card { padding: 34px; }
.tt-content h1, .tt-content h2 { color: var(--c-ink); }
.tt-content a { text-decoration: underline; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
	body.is-verified .tt-app__cols { flex-direction: column; align-items: stretch; }
	body.is-verified .tt-verify { flex: none; max-width: 520px; margin: 0 auto; width: 100%; }
	.tt-results { max-width: 520px; margin: 0 auto; }
	.tt-results__grid { grid-template-columns: 1fr; }
	.tt-feature__grid { grid-template-columns: repeat(2, 1fr); }
	.tt-ticket .tt-card { grid-template-columns: 1fr; text-align: left; }
	.tt-ticket__meta { text-align: left; }
	.tt-ticket .tt-btn { width: 100%; }
}

@media (max-width: 560px) {
	.tt-shell { padding: 0 18px; }
	.tt-topbar { flex-wrap: wrap; justify-content: center; gap: 12px; }
	.tt-logo { width: 100%; justify-content: center; }
	.tt-hero { padding-top: 4px; }
	.tt-feature__grid { grid-template-columns: 1fr 1fr; }
	.tt-card { padding: 18px; }
}
