:root {
	--bg-page: #edf2f7;
	--bg-card: #f6f8fb;
	--bg-card-strong: #ffffff;
	--ink: #1f2633;
	--ink-soft: #6d7688;
	--line: #dde3ee;
	--blue: #2f66d8;
	--blue-soft: #e8efff;
	--red: #e31d2f;
	--red-dark: #c81426;
	--ok: #249957;
	--warn: #d09100;
	--radius-lg: 20px;
	--radius-md: 14px;
	--radius-sm: 10px;
	--shadow-soft: 0 10px 28px rgba(31, 38, 51, 0.08);
}

body {
	font-family: 'Onest', sans-serif;
	color: var(--ink);
	background:
		radial-gradient(circle at 20% -10%, #ffffff 0, rgba(255, 255, 255, 0) 45%),
		linear-gradient(180deg, #f8fbff 0%, var(--bg-page) 48%, #eef3f8 100%);
}

.container {
	max-width: 1160px;
	margin: 0 auto;
	padding: 34px 16px 48px;
}

.appointment-form {
	background: linear-gradient(180deg, #fdfefe 0%, #f8fbff 100%);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-soft);
	padding: 28px;
	position: relative;
	overflow: hidden;
}

.appointment-form::before {
	content: "";
	position: absolute;
	inset: -120px auto auto -80px;
	width: 320px;
	height: 320px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(47, 102, 216, 0.12) 0%, rgba(47, 102, 216, 0) 70%);
	pointer-events: none;
}

.appointment-form h1 {
	margin: 0 0 16px;
	font: 700 32px/1.15 'Unbounded', sans-serif;
	letter-spacing: 0.2px;
	color: #202735;
}

.progress-bar {
	height: 12px;
	border-radius: 999px;
	background: #e8edf7;
	overflow: hidden;
	border: 1px solid #dde5f2;
}

.progress-fill {
	height: 100%;
	width: 0;
	border-radius: 999px;
	background: linear-gradient(90deg, #2f66d8 0%, #4f86f7 70%, #6ea1ff 100%);
	transition: width 0.35s ease;
}

.progress-text {
	margin-top: 8px;
	color: var(--ink-soft);
	font-weight: 600;
}

.step {
	display: none;
	margin-top: 20px;
	background: var(--bg-card);
	border: 1px solid var(--line);
	border-radius: var(--radius-md);
	padding: 18px;
}

.step.active {
	display: block;
	animation: riseIn 0.22s ease;
}

.step h3 {
	margin: 0 0 14px;
	font: 600 20px/1.3 'Onest', sans-serif;
	color: #253146;
}

.branches-grid,
.specialities-grid,
.doctors-grid,
.dates-grid,
.times-grid {
	display: grid;
	gap: 12px;
}

.branches-grid,
.specialities-grid,
.doctors-grid {
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.dates-grid {
	grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
}

.times-grid {
	grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
}

.branch-card,
.speciality-card,
.doctor-card,
.date-card,
.time-card {
	background: var(--bg-card-strong);
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	padding: 14px;
	cursor: pointer;
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.branch-card:hover,
.speciality-card:hover,
.doctor-card:hover,
.date-card:hover,
.time-card:hover {
	transform: translateY(-2px);
	border-color: #b8c8e7;
	box-shadow: 0 8px 18px rgba(36, 60, 110, 0.1);
}

.branch-card.selected,
.speciality-card.selected,
.doctor-card.selected,
.date-card.selected,
.time-card.selected {
	border-color: var(--blue);
	background: linear-gradient(180deg, #f4f8ff 0%, #e9f1ff 100%);
	box-shadow: inset 0 0 0 1px rgba(47, 102, 216, 0.15), 0 8px 20px rgba(47, 102, 216, 0.16);
}

.branch-name,
.speciality-name,
.doctor-name {
	font-weight: 700;
	color: #1f2b3d;
}

.branch-address,
.doctor-speciality,
.doctor-experience,
.date-info,
.date-month {
	margin-top: 6px;
	color: var(--ink-soft);
	font-size: 14px;
}

.date-card {
	text-align: center;
	padding: 12px 10px;
}

.date-day {
	font-size: 24px;
	font-weight: 700;
	color: #24324a;
	line-height: 1;
}

.date-card.weekend .date-day {
	color: #355cb9;
}

.date-card.disabled,
.date-card.unavailable {
	opacity: 0.45;
	cursor: not-allowed;
	filter: grayscale(0.15);
}

.date-card.available {
	border-style: dashed;
	border-color: #bcd0f7;
}

.time-display {
	font-weight: 700;
	color: #202f45;
	text-align: center;
}

.time-card.taken {
	opacity: 0.45;
	text-decoration: line-through;
	pointer-events: none;
}

.loading,
.error-message,
.hidden-days-info,
.availability-status,
.api-success,
.cache-warning {
	border-radius: var(--radius-sm);
	padding: 12px 14px;
	font-size: 14px;
}

.loading {
	background: #f1f5fb;
	border: 1px solid #dbe4f3;
	color: #43546f;
}

.error-message {
	background: #fff2f2;
	border: 1px solid #ffd7d7;
	color: #9e2530;
}

.loading-dots {
	display: inline-flex;
	gap: 4px;
	margin-left: 6px;
}

.loading-dots span {
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: #6e86b4;
	animation: pulseDots 1s infinite ease-in-out;
}

.loading-dots span:nth-child(2) { animation-delay: 0.15s; }
.loading-dots span:nth-child(3) { animation-delay: 0.3s; }

#patient-form {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

.form-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.form-group:last-child,
.form-group textarea,
#patient-comment,
#patient-birthday {
	font-family: 'Onest', sans-serif;
}

.form-group:nth-child(6) {
	grid-column: 1 / -1;
}

.form-group label {
	font-size: 14px;
	color: #4a5870;
	font-weight: 600;
}

.form-group input,
.form-group textarea {
	border: 1px solid #d2ddeb;
	border-radius: 10px;
	background: #fff;
	color: #1f2a3e;
	padding: 10px 12px;
	font-size: 15px;
	outline: none;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.form-group input:focus,
.form-group textarea:focus {
	border-color: #7ba1ea;
	box-shadow: 0 0 0 3px rgba(47, 102, 216, 0.14);
}

.appointment-summary {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	padding: 14px;
}

.appointment-summary p {
	margin: 0;
	padding: 8px 0;
	border-bottom: 1px dashed #dbe3f1;
	color: #2f3d54;
}

.appointment-summary p:last-child {
	border-bottom: 0;
}

.navigation {
	margin-top: 20px;
	display: flex;
	justify-content: space-between;
	gap: 10px;
	flex-wrap: wrap;
}

.btn {
	border: 0;
	border-radius: 12px;
	padding: 11px 18px;
	font: 700 14px/1 'Onest', sans-serif;
	letter-spacing: 0.1px;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn:active {
	transform: translateY(1px);
}

.btn-primary {
	color: #fff;
	background: linear-gradient(180deg, #3c73e2 0%, #2f66d8 100%);
	box-shadow: 0 8px 16px rgba(47, 102, 216, 0.28);
}

.btn-primary:hover {
	filter: brightness(1.04);
}

.btn-success {
	color: #fff;
	background: linear-gradient(180deg, #ef2a3d 0%, var(--red) 100%);
	box-shadow: 0 8px 18px rgba(227, 29, 47, 0.26);
}

.btn-success:hover {
	background: linear-gradient(180deg, #f23346 0%, var(--red-dark) 100%);
}

.btn-secondary {
	color: #32445f;
	background: #eef3fb;
	border: 1px solid #cfdaec;
}

.btn.loading {
	opacity: 0.8;
	cursor: wait;
}

.result {
	margin-top: 18px;
}

@keyframes pulseDots {
	0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
	40% { opacity: 1; transform: translateY(-2px); }
}

@keyframes riseIn {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
	.appointment-form {
		padding: 18px;
		border-radius: 16px;
	}

	.appointment-form h1 {
		font-size: 26px;
	}

	#patient-form {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 640px) {
	.container {
		padding: 14px 10px 28px;
	}

	.step {
		padding: 14px;
	}

	.dates-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.times-grid,
	.branches-grid,
	.specialities-grid,
	.doctors-grid {
		grid-template-columns: 1fr;
	}

	.btn {
		width: 100%;
	}

	.navigation {
		display: grid;
		grid-template-columns: 1fr;
	}
}

