/* http://meyerweb.com/eric/tools/css/reset/ 
   v2.0 | 20110126
   License: none (public domain)
*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
	display: block;
}
body {
	line-height: 1;
}
ol, ul {
	list-style: none;
}
blockquote, q {
	quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
	content: '';
	content: none;
}
table {
	border-collapse: collapse;
	border-spacing: 0;
}

/* ============================================
   Teachers Font
   ============================================ */
@font-face {
  font-family: 'Teachers';
  src: url('/fonts/Teachers-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Teachers';
  src: url('/fonts/Teachers-Italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Teachers';
  src: url('/fonts/Teachers-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Teachers';
  src: url('/fonts/Teachers-MediumItalic.ttf') format('truetype');
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Teachers';
  src: url('/fonts/Teachers-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Teachers';
  src: url('/fonts/Teachers-SemiBoldItalic.ttf') format('truetype');
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Teachers';
  src: url('/fonts/Teachers-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Teachers';
  src: url('/fonts/Teachers-BoldItalic.ttf') format('truetype');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Teachers';
  src: url('/fonts/Teachers-ExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Teachers';
  src: url('/fonts/Teachers-ExtraBoldItalic.ttf') format('truetype');
  font-weight: 800;
  font-style: italic;
  font-display: swap;
}

:root {
  font-family: 'Teachers', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
    sans-serif;
  color: #000000;
  background-color: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: #ffffff;
}

.app-shell {
  background: #ffffff;
  margin: 0 auto;
  padding: 40px 24px;
  min-height: 100vh;
  max-width: 600px;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 32px;
}

.app-header h1 {
  color: #0E0E0E;
  font-family: Teachers;
  font-size: var(--line-height-48, 48px);
  font-style: normal;
  font-weight: 600;
  line-height: var(--line-height-57_6, 57.6px); /* 120% */
}

.eyebrow {
  color: #000;
  font-family: Teachers;
  font-size: 18px;
  font-style: normal;
  font-weight: 400;
  line-height: 18px;
}

.price-tag {
  width: 159px;
  height: 60px;
  padding: 20px 28px;
  justify-content: center;
  align-items: center;
  gap: 8px;
  border-radius: 80px;
  background: #C3DCF7;
  color: #0E0E0E;

  text-align: center;
  font-family: Teachers;
  font-size: 20px;
  font-style: normal;
  font-weight: 500;
  line-height: var(--line-height-19_2, 19.2px); /* 80% */
  letter-spacing: var(--letter-spacing-0_5, 0.5px);
  text-transform: capitalize;
}

/* .step-title moved up to form section */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.card {
  border: 1px solid #E0E0E0;
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  background: #fff;
  color: #4A4A4A;
}

.card:hover,
.card.selected {
  border-color: #1A3B69;
  box-shadow: 0 10px 20px rgba(26, 59, 105, 0.15);
}

.card .subtle {
  color: #4A4A4A;
  margin: 4px 0 0;
}

/* ============================================
   Двухколоночный макет для формы
   ============================================ */
section {
  display: block;
}

.form-section {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.back-arrow-button {
  position: absolute;
  top: 6px;
  left: -75px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #004994;
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.2s ease;
  z-index: 10;
}

.back-arrow-button:hover {
  background: #be0000;
}

.form-header {
  margin-top: 8px;
  margin-bottom: 24px;
}

.form-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #000000;
  margin: 4px 0 0;
}

.form-content {
  margin-top: 0;
}

.step-title {
  font-size: 1.2rem;
  line-height: 1.3;
  font-weight: 700;
  color: #000000;
  margin: 0 0 24px 0;
}

.form-section .step-title {
  font-size: 2.5rem;
  line-height: 1.1;
  margin: 0 0 16px 0;
  font-weight: 700;
}

@media (max-width: 768px) {
  .form-section .step-title {
    font-size: 2rem;
  }
}

form {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 400;
  color: #4A4A4A;
  margin-bottom: 8px;
}

input,
textarea,
select {
  width: 100%;
  padding: 12px 0;
  border: none;
  border-bottom: 1px solid #E0E0E0;
  background: transparent;
  font-size: 1rem;
  font-family: inherit;
  color: #000000;
  transition: border-color 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-bottom-color: #1A3B69;
}

input::placeholder,
textarea::placeholder {
  color: #999999;
}

textarea {
  resize: vertical;
  min-height: 100px;
}

button:not(.back-arrow-button):not(.time-card) {
  background: #012d5a;
  border: none;
  color: #ffffff;
  padding: 15px 30px;
  font-size: 1rem;
  border-radius: 9999px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

button:not(.back-arrow-button):not(.time-card):hover:not(:disabled) {
  background: #be0000;
}

button:not(.back-arrow-button):not(.time-card):disabled {
  background: #a4a9f5;
  cursor: not-allowed;
  opacity: 0.7;
}

button:not(.back-arrow-button):not(.ghost):not(.time-card) svg {
  margin-left: 8px;
  flex-shrink: 0;
}

.ghost {
  background: #012d5a;
  color: #ffffff;
  border: none;
  margin-top: 12px;
  border-radius: 9999px;
}

.ghost:hover:not(:disabled) {
  background: #be0000;
}

.ghost::after {
  display: none;
}

.visit-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f5f5f5;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
}

.calendar-icon {
  color: #4A4A4A;
  flex-shrink: 0;
}

.visit-summary-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.875rem;
  color: #000000;
}

.visit-summary-text strong {
  font-weight: 700;
  font-size: 1rem;
}

.notice {
  padding: 12px 16px;
  border-radius: 12px;
  background: #f9fafb;
  color: #4A4A4A;
  margin-bottom: 24px;
  font-size: 1rem;
  line-height: 1.5;
}

.notice strong {
  font-weight: 600;
  color: #000000;
}

.summary-card {
  border: 1px solid #E0E0E0;
  border-radius: 16px;
  padding: 20px;
  background: #f8f9ff;
}

.summary-card h3 {
  margin-top: 0;
  color: #000000;
  font-weight: 700;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #4A4A4A;
}

.success {
  color: #027a48;
  background: #ecfdf3;
  border: 1px solid #abefc6;
}

/* ============================================
   Дополнительные стили для формы
   ============================================ */
.form-intro {
  font-size: 1rem;
  line-height: 1.6;
  color: #4A4A4A;
  margin-bottom: 32px;
}

.legal-text {
  font-size: 0.75rem;
  color: #777777;
  margin-top: 16px;
  line-height: 1.5;
}

.legal-text a {
  color: #007BFF;
  text-decoration: none;
}

.legal-text a:hover {
  text-decoration: underline;
}

/* ============================================
   Date and Time Selection Section
   ============================================ */

.date-time-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-radius: 28px;
  background: #F5F6F8;
}

.date-block {
  transition: all 0.3s ease;
}

.date-block.collapsed .date-block-content {
  display: none;
}

.date-block-header {
  border-bottom: 1px solid var(--Schemes-Outline-Variant, #CAC4D0);
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.date-block-title, .selected-date-display {
  padding: 32px 12px 32px 24px;
  justify-content: center;
  align-items: flex-end;
  gap: 8px;
  align-self: stretch;
  color: #0E0E0E;
  font-family: Teachers;
  font-size: 24px;
  font-style: normal;
  font-weight: 400;
  line-height: 130%; /* 31.2px */
}

.selected-date-display strong {
  font-weight: 700;
}

.chevron-icon {
  color: #4A4A4A;
  transition: transform 0.3s ease;
}

.date-block.collapsed .chevron-icon {
  transform: rotate(180deg);
}

.date-block-content {
  margin-top: 20px;
}

.time-block {
  background: #f5f5f5;
  border-radius: 12px;
  padding: 24px;
}

.time-block-title {
  margin-bottom: 20px;
  color: #0E0E0E;

  font-family: Teachers;
  font-size: 24px;
  font-style: normal;
  font-weight: 400;
  line-height: 130%; /* 31.2px */
}

.time-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.time-card {
  display: flex;
  padding: 20px 0;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex: 1 0 0;
  border-radius: 12px;
  border: 1px solid #004994;
  background: none;
}

.time-card:hover {
  background: #004994;
  color: #ffffff;
}

.time-value {
  color: #0E0E0E;

  text-align: center;
  font-family: Teachers;
  font-size: 18px;
  font-style: normal;
  font-weight: 500;
  line-height: var(--Label-Large-Line-Height, 20px); /* 111.111% */
  letter-spacing: var(--Label-Large-Tracking, 0.1px);
}

.time-card:hover .time-value {
  color: #ffffff;
}

.time-period {
  color: #0E0E0E;

  text-align: center;
  font-family: Teachers;
  font-size: 18px;
  font-style: normal;
  font-weight: 500;
  line-height: var(--Label-Large-Line-Height, 20px); /* 111.111% */
  letter-spacing: var(--Label-Large-Tracking, 0.1px);
}

.time-card:hover .time-period {
  color: #ffffff;
}

/* ============================================
   Стили для календаря Flatpickr
   ============================================ */
#calendar-container {
  max-width: 100%;
  margin: 0 auto;
}

.flatpickr-calendar {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  font-family: 'Teachers', system-ui, sans-serif;
  padding: 0;
  width: 100%;
}

.flatpickr-months {
  margin-bottom: 20px;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flatpickr-month {
  color: #000000;
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.flatpickr-prev-month,
.flatpickr-next-month {
  color: #4A4A4A;
  fill: #4A4A4A;
  top: 0;
  height: 24px;
  width: 24px;
  line-height: 24px;
  padding: 0;
  border-radius: 4px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.flatpickr-prev-month:hover,
.flatpickr-next-month:hover {
  color: #1A3B69;
  fill: #1A3B69;
  background: #e5e5e5;
}

.flatpickr-weekdays {
  background: transparent;
  border-bottom: none;
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.flatpickr-weekday {
  color: #000000;
  font-weight: 400;
  font-size: 0.875rem;
  text-transform: none;
  letter-spacing: 0;
}

.flatpickr-days {
  padding-top: 8px;
}

.flatpickr-day {
  color: #000000;
  border-radius: 50%;
  border: none;
  font-weight: 400;
  transition: all 0.2s ease;
  height: 36px;
  width: 36px;
  line-height: 36px;
  margin: 2px;
}

/* Current day - circled */
.flatpickr-day.current-day {
  border: 1px solid #d0d0d0;
  background: transparent;
}

/* Hover state - blue background, white text */
.flatpickr-day:not(.flatpickr-disabled):not(.prevMonthDay):not(.nextMonthDay):hover {
  background: #004994;
  color: #ffffff;
  border-color: #004994;
}

/* Selected day */
.flatpickr-day.selected {
  background: #004994  !important;
  color: #ffffff !important;
  border-color: #004994 !important;
  font-weight: 600;
}

.flatpickr-day.selected:hover {
  background: #004994;;
  border-color: #004994;;
}

/* Доступные дни */
.flatpickr-day:not(.flatpickr-disabled):not(.prevMonthDay):not(.nextMonthDay) {
  color: #000000;
  cursor: pointer;
}

/* Недоступные дни (серые, неактивные) */
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
  color: #CCCCCC;
  background: transparent;
  cursor: not-allowed;
  opacity: 0.5;
}

.flatpickr-day.flatpickr-disabled:hover {
  background: transparent;
  color: #CCCCCC;
}

/* Прошедшие дни, сегодня, завтра, послезавтра */
.flatpickr-day.flatpickr-disabled:not(.prevMonthDay):not(.nextMonthDay) {
  color: #CCCCCC;
  background: transparent;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .back-arrow-button {
    position: relative;
    top: 0;
    left: 0;
  }

  #calendar-container {
    max-width: 100%;
  }
  
  .price-tag {
    padding: 20px 20px;
    margin-top: 40px;
    font-size: 18px;
  }

  .flatpickr-day {
    height: 32px;
    width: 32px;
    line-height: 32px;
    font-size: 0.875rem;
  }
  
  .flatpickr-month {
    font-size: 0.8rem;
  }
}

.flatpickr-calendar {
  background-color: transparent !important;
  box-shadow: none !important;
  margin: 0 auto 30px;
}

