/* ============================================================
   Trenity Appointments – Public Stylesheet v2.0
   Templates: modern (default), elegant, minimal, corporate
   ============================================================ */

/* ── CSS Variables (Modern – default) ── */
:root {
	--trenity-primary:    #1a2e44;
	--trenity-accent:     #e8a020;
	--trenity-success:    #27ae60;
	--trenity-danger:     #e74c3c;
	--trenity-gray:       #6b7280;
	--trenity-light:      #f8f9fa;
	--trenity-border:     #e0e4ea;
	--trenity-radius:     10px;
	--trenity-shadow:     0 4px 24px rgba(0,0,0,0.08);
	--trenity-transition: 0.2s ease;
	--trenity-card-bg:    #ffffff;
	--trenity-step-done:  #27ae60;
	--trenity-text:       #1f2937;
	--trenity-font:       -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	--trenity-heading-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	--trenity-title-size: 26px;
	--trenity-title-weight: 700;
	--trenity-body-size:  14px;
	--trenity-btn-radius: var(--trenity-radius);
	--trenity-btn-font-size: 15px;
	--trenity-btn-font-weight: 700;
	--trenity-btn-padding-y: 12px;
	--trenity-btn-padding-x: 28px;
}

/* ── Template: Elegant ── */
.trenity-template-elegant {
	--trenity-primary:  #2c1654;
	--trenity-accent:   #c9a84c;
	--trenity-success:  #4caf7d;
	--trenity-radius:   4px;
	--trenity-shadow:   0 2px 16px rgba(44,22,84,0.12);
	--trenity-card-bg:  #fdfcff;
}
.trenity-template-elegant .trenity-booking-header {
	background: linear-gradient(135deg, #2c1654, #4a1f8a);
	color: #fff;
	border-radius: 8px 8px 0 0;
	padding: 32px 24px 24px;
	margin-bottom: 0;
}
.trenity-template-elegant .trenity-booking-title { color: #f5e6a3; }
.trenity-template-elegant .trenity-step-label { color: rgba(255,255,255,0.75); }
.trenity-template-elegant .trenity-step-number { background: rgba(255,255,255,0.2); color: #fff; }
.trenity-template-elegant .trenity-step-number.active { background: var(--trenity-accent); color: #2c1654; }
.trenity-template-elegant .trenity-step-connector { background: rgba(255,255,255,0.3); }
.trenity-template-elegant .trenity-step-panel { background: #fdfcff; border: 1px solid #e8e0f0; border-top: none; border-radius: 0 0 8px 8px; padding: 28px; }

/* ── Template: Minimal ── */
.trenity-template-minimal {
	--trenity-primary:  #111827;
	--trenity-accent:   #6366f1;
	--trenity-radius:   6px;
	--trenity-shadow:   none;
	--trenity-card-bg:  #fff;
	--trenity-border:   #d1d5db;
}
.trenity-template-minimal .trenity-booking-header { border-bottom: 2px solid #111827; padding-bottom: 20px; }
.trenity-template-minimal .trenity-branch-card { border: 1px solid #d1d5db; box-shadow: none; }
.trenity-template-minimal .trenity-branch-card:hover,
.trenity-template-minimal .trenity-branch-card.selected { border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99,102,241,0.15); }
.trenity-template-minimal .trenity-btn-primary { background: #111827; border-radius: 4px; }
.trenity-template-minimal .trenity-btn-primary:hover { background: #374151; }
.trenity-template-minimal .trenity-cal-day.selected { background: #111827; }
.trenity-template-minimal .trenity-slot.selected { background: #111827; border-color: #111827; }
.trenity-template-minimal .trenity-step-number.active { background: #111827; }
.trenity-template-minimal .trenity-step-number.done { background: #6366f1; }

/* ── Template: Corporate ── */
.trenity-template-corporate {
	--trenity-primary:  #003366;
	--trenity-accent:   #0072bc;
	--trenity-success:  #008542;
	--trenity-radius:   3px;
	--trenity-shadow:   0 1px 6px rgba(0,51,102,0.12);
	--trenity-card-bg:  #f4f6f9;
}
.trenity-template-corporate .trenity-booking-header {
	background: #003366;
	border-radius: 4px 4px 0 0;
	padding: 24px;
	margin-bottom: 0;
}
.trenity-template-corporate .trenity-booking-title,
.trenity-template-corporate .trenity-step-label { color: #fff; }
.trenity-template-corporate .trenity-step-number { background: rgba(255,255,255,0.2); color: #fff; }
.trenity-template-corporate .trenity-step-number.active { background: #0072bc; }
.trenity-template-corporate .trenity-step-connector { background: rgba(255,255,255,0.3); }
.trenity-template-corporate .trenity-step-panel { background: #f4f6f9; border: 1px solid #c8d4e0; border-top: none; border-radius: 0 0 4px 4px; padding: 24px; }
.trenity-template-corporate .trenity-btn-primary { background: #0072bc; border-radius: 3px; letter-spacing: 0.5px; text-transform: uppercase; font-size: 13px; }
.trenity-template-corporate .trenity-btn-primary:hover { background: #005a9a; }

/* ── Base Layout ────────────────────────────────────────────── */
.trenity-booking-wrap {
	max-width: 880px;
	margin: 0 auto;
	font-family: var(--trenity-font);
	font-size: var(--trenity-body-size);
	color: var(--trenity-text);
	box-sizing: border-box;
}
.trenity-booking-wrap *, .trenity-booking-wrap *::before, .trenity-booking-wrap *::after {
	box-sizing: inherit;
}

/* ── Header ─────────────────────────────────────────────────── */
.trenity-booking-header {
	text-align: center;
	margin-bottom: 28px;
}
.trenity-booking-title {
	font-size: var(--trenity-title-size);
	font-weight: var(--trenity-title-weight);
	font-family: var(--trenity-heading-font);
	color: var(--trenity-primary);
	margin: 0 0 20px;
}

/* ── Steps indicator ──────────────────────────────────────── */
.trenity-steps {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	flex-wrap: wrap;
}
.trenity-step {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-direction: column;
}
.trenity-step-number {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--trenity-border);
	color: var(--trenity-gray);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: 700;
	transition: background var(--trenity-transition), color var(--trenity-transition);
}
.trenity-step-number.active  { background: var(--trenity-primary); color: #fff; }
.trenity-step-number.done    { background: var(--trenity-success); color: #fff; }
.trenity-step-label {
	font-size: 11px;
	color: var(--trenity-gray);
	white-space: nowrap;
}
.trenity-step-connector {
	width: 44px;
	height: 2px;
	background: var(--trenity-border);
	margin: 0 4px;
	margin-bottom: 18px;
}

/* ── Panels ──────────────────────────────────────────────── */
.trenity-step-panel { display: none; animation: trenityFadeIn 0.25s ease; }
.trenity-step-panel.active { display: block; }
@keyframes trenityFadeIn {
	from { opacity: 0; transform: translateY(10px); }
	to   { opacity: 1; transform: translateY(0); }
}
.trenity-panel-title {
	font-size: 19px;
	font-weight: 700;
	color: var(--trenity-primary);
	margin: 0 0 20px;
}

/* ── Back button ─────────────────────────────────────────── */
.trenity-back-btn {
	background: none;
	border: none;
	color: var(--trenity-gray);
	font-size: 14px;
	cursor: pointer;
	padding: 0;
	margin-bottom: 16px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	transition: color var(--trenity-transition);
}
.trenity-back-btn:hover { color: var(--trenity-primary); }

/* ── Branch cards ────────────────────────────────────────── */
.trenity-branch-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 16px;
	margin-bottom: 24px;
}
.trenity-branch-card {
	background: var(--trenity-card-bg);
	border: 2px solid var(--trenity-border);
	border-radius: var(--trenity-radius);
	padding: 18px;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	transition: border-color var(--trenity-transition), box-shadow var(--trenity-transition), transform var(--trenity-transition);
}
.trenity-branch-card:hover {
	border-color: var(--trenity-accent);
	box-shadow: var(--trenity-shadow);
	transform: translateY(-2px);
}
.trenity-branch-card.selected {
	border-color: var(--trenity-primary);
	box-shadow: 0 0 0 3px rgba(26,46,68,0.12);
}
.trenity-branch-card-header {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin-bottom: 12px;
}
.trenity-branch-icon { font-size: 26px; flex-shrink: 0; }
.trenity-branch-name { font-weight: 700; font-size: 16px; color: var(--trenity-primary); }
.trenity-branch-address { font-size: 13px; color: var(--trenity-gray); margin-top: 2px; }
.trenity-branch-phone { font-size: 13px; color: var(--trenity-gray); margin-bottom: 6px; }
.trenity-timezone-badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: #eef2ff;
	color: #3730a3;
	font-size: 12px;
	font-weight: 600;
	padding: 3px 10px;
	border-radius: 20px;
	margin-bottom: 8px;
}
.trenity-branch-hours { font-size: 12px; color: var(--trenity-gray); margin-bottom: 8px; }
.trenity-branch-services { display: flex; flex-wrap: wrap; gap: 6px; }
.trenity-service-tag {
	background: #f0fdf4;
	color: #166534;
	font-size: 11px;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 12px;
	border: 1px solid #bbf7d0;
}
.trenity-branch-card-footer {
	margin-top: auto;
	padding-top: 12px;
	border-top: 1px solid var(--trenity-border);
}
.trenity-btn-card {
	width: 100%;
	padding: 9px 14px;
	font-size: 13px;
}
.trenity-branch-card.selected .trenity-btn-card {
	background: var(--trenity-accent);
	color: #1f2937;
}

/* ── Timezone notice ────────────────────────────────────── */
.trenity-timezone-notice {
	display: flex;
	align-items: center;
	gap: 8px;
	background: #fffbeb;
	border: 1px solid #fcd34d;
	border-radius: var(--trenity-radius);
	padding: 10px 16px;
	font-size: 13px;
	margin-bottom: 18px;
}
.trenity-tz-icon { font-size: 18px; }

/* ── Date & Time Layout ─────────────────────────────────── */
.trenity-datetime-wrap {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	margin-bottom: 24px;
}
@media (max-width: 640px) {
	.trenity-datetime-wrap { grid-template-columns: 1fr; }
}

/* ── Calendar ───────────────────────────────────────────── */
.trenity-calendar-wrap {
	background: var(--trenity-card-bg);
	border: 1px solid var(--trenity-border);
	border-radius: var(--trenity-radius);
	padding: 16px;
	box-shadow: var(--trenity-shadow);
}
.trenity-calendar-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 14px;
}
.trenity-cal-title { font-weight: 700; font-size: 15px; color: var(--trenity-primary); }
.trenity-btn-icon {
	background: none;
	border: 1px solid var(--trenity-border);
	border-radius: 6px;
	width: 32px;
	height: 32px;
	cursor: pointer;
	font-size: 16px;
	color: var(--trenity-primary);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background var(--trenity-transition);
}
.trenity-btn-icon:hover { background: var(--trenity-light); }
.trenity-btn-icon:disabled { opacity: 0.4; cursor: not-allowed; }

.trenity-cal-weekdays {
	display: grid !important;
	grid-template-columns: repeat(7, 1fr) !important;
	text-align: center;
	font-size: 11px;
	font-weight: 600;
	color: var(--trenity-gray);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 8px;
}
.trenity-cal-days {
	display: grid !important;
	grid-template-columns: repeat(7, 1fr) !important;
	grid-auto-rows: minmax(38px, auto);
	gap: 4px;
}
.trenity-cal-day {
	/* aspect-ratio alone collapses to 0 when Elementor/theme resets override
	   the implicit width. Use explicit width + min-height instead. */
	width: 100%;
	min-height: 38px;
	height: auto;
	aspect-ratio: 1;
	border: none;
	border-radius: 6px;
	background: transparent;
	font-size: 13px;
	font-weight: 500;
	color: var(--trenity-text);
	cursor: pointer;
	transition: background var(--trenity-transition), color var(--trenity-transition);
	display: flex !important;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	padding: 0;
	line-height: 1;
}
.trenity-cal-day.available:hover { background: #eef2ff; color: var(--trenity-primary); }
.trenity-cal-day.today { font-weight: 800; color: var(--trenity-accent); }
.trenity-cal-day.selected { background: var(--trenity-primary); color: #fff !important; border-radius: 6px; }
.trenity-cal-day.disabled { color: #d1d5db; cursor: not-allowed; }
.trenity-cal-day.empty    { visibility: hidden; }

/* ── Time slots ─────────────────────────────────────────── */
.trenity-slots-wrap {
	background: var(--trenity-card-bg);
	border: 1px solid var(--trenity-border);
	border-radius: var(--trenity-radius);
	padding: 16px;
	box-shadow: var(--trenity-shadow);
	display: flex;
	flex-direction: column;
	max-height: 360px;
}
.trenity-slots-header { margin-bottom: 12px; }
.trenity-selected-date-display { font-weight: 700; font-size: 14px; color: var(--trenity-primary); min-height: 20px; }
.trenity-slot-selected-label { font-size: 11px; color: var(--trenity-success); font-weight: 600; margin-left: 6px; }
.trenity-slots-list { overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.trenity-slot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: var(--trenity-light);
	border: 2px solid var(--trenity-border);
	border-radius: 8px;
	padding: 10px 14px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	color: var(--trenity-primary);
	transition: all var(--trenity-transition);
	width: 100%;
	text-align: left;
}
.trenity-slot:hover  { border-color: var(--trenity-accent); background: #fffbf0; }
.trenity-slot.selected { background: var(--trenity-primary); border-color: var(--trenity-primary); color: #fff; }
.trenity-slot-avail { font-size: 11px; font-weight: 600; opacity: 0.75; }
.trenity-slots-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 32px 0;
	color: var(--trenity-gray);
	gap: 8px;
	flex: 1;
}
.trenity-slots-placeholder span { font-size: 32px; }
.trenity-slots-placeholder p { margin: 0; font-size: 13px; text-align: center; }
.trenity-slots-loading {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--trenity-gray);
	font-size: 13px;
	padding: 20px;
	justify-content: center;
}
/* Spinner */
.trenity-spinner {
	display: inline-block;
	width: 18px;
	height: 18px;
	border: 2px solid var(--trenity-border);
	border-top-color: var(--trenity-primary);
	border-radius: 50%;
	animation: trenitySpinAnim 0.7s linear infinite;
}
@keyframes trenitySpinAnim { to { transform: rotate(360deg); } }

/* ── Form ───────────────────────────────────────────────── */
.trenity-booking-summary-mini {
	display: flex;
	align-items: center;
	gap: 10px;
	background: var(--trenity-light);
	border: 1px solid var(--trenity-border);
	border-radius: var(--trenity-radius);
	padding: 10px 16px;
	font-size: 13px;
	font-weight: 600;
	color: var(--trenity-primary);
	margin-bottom: 20px;
}
.trenity-form-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin-bottom: 24px;
}
@media (max-width: 560px) { .trenity-form-grid { grid-template-columns: 1fr; } }
.trenity-form-group { display: flex; flex-direction: column; gap: 6px; }
.trenity-form-group--full { grid-column: 1 / -1; }
.trenity-form-group label { font-size: 13px; font-weight: 600; color: #374151; }
.trenity-required { color: var(--trenity-danger); }
.trenity-input {
	border: 1.5px solid var(--trenity-border);
	border-radius: var(--trenity-radius);
	padding: 10px 14px;
	font-size: 14px;
	width: 100%;
	transition: border-color var(--trenity-transition), box-shadow var(--trenity-transition);
	background: #fff;
	color: #1f2937;
	font-family: inherit;
}
.trenity-input:focus {
	outline: none;
	border-color: var(--trenity-primary);
	box-shadow: 0 0 0 3px rgba(26,46,68,0.1);
}
.trenity-textarea { resize: vertical; min-height: 80px; }
.trenity-checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: #374151; cursor: pointer; }
.trenity-checkbox-label input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }
.trenity-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

/* ── Phone Selector ─────────────────────────────────────── */
.trenity-phone-wrap { position: relative; display: flex; align-items: stretch; gap: 0; }
.trenity-phone-code-trigger {
	display: flex;
	align-items: center;
	gap: 5px;
	padding: 0 12px;
	border: 1.5px solid var(--trenity-border);
	border-right: none;
	border-radius: var(--trenity-radius) 0 0 var(--trenity-radius);
	background: var(--trenity-light);
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	min-width: 88px;
	color: var(--trenity-primary);
	transition: background var(--trenity-transition);
	user-select: none;
}
.trenity-phone-code-trigger:hover { background: #e9ecef; }
.trenity-phone-flag { font-size: 18px; }
.trenity-phone-caret { font-size: 10px; color: var(--trenity-gray); }
.trenity-phone-number {
	border-radius: 0 var(--trenity-radius) var(--trenity-radius) 0 !important;
	flex: 1;
}
.trenity-phone-dropdown {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	background: #fff;
	border: 1.5px solid var(--trenity-border);
	border-radius: var(--trenity-radius);
	box-shadow: 0 8px 32px rgba(0,0,0,0.14);
	z-index: 9999;
	width: 280px;
	overflow: hidden;
}
.trenity-phone-search {
	width: 100%;
	border: none;
	border-bottom: 1px solid var(--trenity-border);
	padding: 10px 14px;
	font-size: 13px;
	outline: none;
	color: #1f2937;
}
.trenity-phone-options { max-height: 220px; overflow-y: auto; }
.trenity-phone-option {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 14px;
	cursor: pointer;
	font-size: 13px;
	color: #1f2937;
	transition: background 0.15s;
}
.trenity-phone-option:hover { background: var(--trenity-light); }
.trn-flag { font-size: 18px; }
.trn-lbl { flex: 1; }
.trn-no-results { padding: 14px; text-align: center; color: var(--trenity-gray); font-size: 13px; }

/* ── Confirm card ───────────────────────────────────────── */
.trenity-confirm-card {
	background: var(--trenity-card-bg);
	border: 1px solid var(--trenity-border);
	border-radius: var(--trenity-radius);
	box-shadow: var(--trenity-shadow);
	padding: 24px;
	margin-bottom: 20px;
}
.trenity-confirm-row {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 12px 0;
	border-bottom: 1px solid var(--trenity-border);
}
.trenity-confirm-row:last-child { border-bottom: none; }
.trenity-confirm-icon { font-size: 20px; flex-shrink: 0; }
.trenity-confirm-label { font-size: 12px; color: var(--trenity-gray); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 3px; }
.trenity-confirm-value { font-size: 15px; font-weight: 600; color: var(--trenity-primary); }
.trenity-confirm-tz { font-size: 12px; color: var(--trenity-gray); margin-top: 3px; }
.trenity-confirm-note {
	font-size: 13px;
	color: var(--trenity-gray);
	text-align: center;
	margin-bottom: 20px;
}

/* ── Buttons ────────────────────────────────────────────── */
.trenity-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: var(--trenity-btn-padding-y) var(--trenity-btn-padding-x);
	border-radius: var(--trenity-btn-radius);
	font-size: var(--trenity-btn-font-size);
	font-weight: var(--trenity-btn-font-weight);
	border: none;
	cursor: pointer;
	transition: background var(--trenity-transition), transform var(--trenity-transition), opacity var(--trenity-transition);
	text-decoration: none;
	font-family: inherit;
}
.trenity-btn-primary { background: var(--trenity-primary); color: #fff; }
.trenity-btn-primary:hover:not(:disabled) { background: #162638; transform: translateY(-1px); }
.trenity-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.trenity-btn-secondary { background: var(--trenity-light); color: var(--trenity-primary); border: 1px solid var(--trenity-border); }
.trenity-btn-secondary:hover { background: var(--trenity-border); }
.trenity-btn-confirm { width: 100%; font-size: 16px; padding: 14px; }

/* ── Error / Success ────────────────────────────────────── */
.trenity-error-msg {
	background: #fef2f2;
	border: 1px solid #fca5a5;
	border-radius: var(--trenity-radius);
	color: var(--trenity-danger);
	padding: 12px 16px;
	font-size: 14px;
	margin-bottom: 16px;
}
.trenity-success-wrap {
	text-align: center;
	padding: 48px 24px;
}
.trenity-success-icon { font-size: 64px; margin-bottom: 16px; }
.trenity-success-wrap h2 { font-size: 26px; font-weight: 800; color: var(--trenity-success); margin: 0 0 12px; }
.trenity-success-wrap p  { font-size: 15px; color: var(--trenity-gray); margin: 0 0 20px; }
.trenity-success-ref {
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	border-radius: var(--trenity-radius);
	padding: 12px 20px;
	font-size: 15px;
	color: #166534;
	font-weight: 600;
	margin-bottom: 24px;
	display: inline-block;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 480px) {
	.trenity-booking-title { font-size: 20px; }
	.trenity-step-label { display: none; }
	.trenity-step-connector { width: 24px; }
	.trenity-btn { font-size: 14px; padding: 11px 20px; }
	.trenity-branch-grid { grid-template-columns: 1fr; }
}
