/* stage-34-form-picker-polish: late Warm Glass OS layer for modal fields, date picker, and time picker. */

:root {
  --focus-field-height: 3rem;
  --focus-field-radius: var(--focus-radius-md, 18px);
  --focus-picker-surface: color-mix(in srgb, var(--surface-elevated, var(--glass-elevated)) 82%, transparent);
  --focus-picker-border: color-mix(in srgb, var(--surface-border-strong, var(--glass-border-strong)) 76%, transparent);
}

.modal-fields :where(label, .focus-reminder-date, .focus-reminder-time),
.create-fields :where(label, .focus-reminder-date, .focus-reminder-time),
.wizard-card :where(label, .focus-reminder-date, .focus-reminder-time),
.schedule-form-grid :where(label, .focus-reminder-date, .focus-reminder-time) {
  display: grid;
  min-width: 0;
  gap: 0.42rem;
  color: var(--text-secondary, var(--muted-strong));
  font-size: 0.86rem;
  font-weight: 760;
  letter-spacing: 0;
}

.modal-fields :where(input, textarea, select),
.create-fields :where(input, textarea, select),
.wizard-card :where(input, textarea, select),
.schedule-form-grid :where(input, textarea, select) {
  width: 100%;
  min-height: var(--focus-field-height);
  border: 1px solid color-mix(in srgb, var(--surface-border, var(--glass-border)) 76%, transparent);
  border-radius: var(--focus-field-radius);
  background:
    radial-gradient(circle at 16% 0%, color-mix(in srgb, #fff 17%, transparent), transparent 56%),
    linear-gradient(145deg, color-mix(in srgb, var(--surface-elevated, var(--glass-elevated)) 48%, transparent), color-mix(in srgb, var(--surface-glass, var(--glass-surface)) 76%, transparent));
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 14%, transparent),
    0 8px 22px color-mix(in srgb, #000 4%, transparent);
  color: var(--text-primary, var(--text));
  font: inherit;
  font-size: clamp(0.98rem, 1.1vw, 1.04rem);
  font-weight: 610;
  outline: none;
  padding: 0.82rem 1rem;
  transition:
    border-color var(--motion-standard, 220ms cubic-bezier(.2,.8,.2,1)),
    background var(--motion-standard, 220ms cubic-bezier(.2,.8,.2,1)),
    box-shadow var(--motion-standard, 220ms cubic-bezier(.2,.8,.2,1)),
    transform var(--motion-fast, 140ms cubic-bezier(.2,.8,.2,1));
}

.modal-fields :where(textarea),
.create-fields :where(textarea),
.wizard-card :where(textarea),
.schedule-form-grid :where(textarea) {
  min-height: 6.2rem;
  line-height: 1.45;
  resize: vertical;
}

.modal-fields :where(input, textarea, select):focus,
.create-fields :where(input, textarea, select):focus,
.wizard-card :where(input, textarea, select):focus,
.schedule-form-grid :where(input, textarea, select):focus {
  border-color: color-mix(in srgb, var(--primary, #5678f5) 52%, var(--surface-border-strong, var(--glass-border-strong)));
  background:
    radial-gradient(circle at 16% 0%, color-mix(in srgb, #fff 22%, transparent), transparent 56%),
    linear-gradient(145deg, color-mix(in srgb, var(--surface-elevated, var(--glass-elevated)) 58%, transparent), color-mix(in srgb, var(--surface-glass, var(--glass-surface)) 82%, transparent));
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--primary, #5678f5) 13%, transparent),
    0 12px 28px color-mix(in srgb, var(--primary, #5678f5) 10%, transparent),
    inset 0 1px 0 color-mix(in srgb, #fff 17%, transparent);
}

.modal-fields :where(input, textarea, select)::placeholder,
.create-fields :where(input, textarea, select)::placeholder,
.wizard-card :where(input, textarea, select)::placeholder,
.schedule-form-grid :where(input, textarea, select)::placeholder {
  color: color-mix(in srgb, var(--text-muted, var(--muted)) 82%, transparent);
  font-weight: 570;
}

input[type="date"],
input[type="time"],
input[data-date-picker] {
  color-scheme: light;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.9rem;
}

.theme-dark input[type="date"],
.theme-dark input[type="time"],
.theme-dark input[data-date-picker],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] input[data-date-picker] {
  color-scheme: dark;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 0.7rem;
  background-color: color-mix(in srgb, var(--primary, #5678f5) 13%, transparent);
  cursor: pointer;
  filter: saturate(0.9) opacity(0.72);
  padding: 0.22rem;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover {
  background-color: color-mix(in srgb, var(--primary, #5678f5) 20%, transparent);
  filter: saturate(1) opacity(0.95);
}

.date-popover {
  z-index: 30;
  width: min(100%, 26.5rem);
  margin-top: 0.72rem;
  border: 1px solid var(--focus-picker-border);
  border-radius: var(--focus-radius-lg, 24px);
  background:
    radial-gradient(circle at 16% 0%, color-mix(in srgb, var(--primary, #5678f5) 14%, transparent), transparent 15rem),
    linear-gradient(145deg, color-mix(in srgb, var(--surface-elevated, var(--glass-elevated)) 90%, transparent), color-mix(in srgb, var(--surface-glass, var(--glass-surface)) 84%, transparent));
  box-shadow:
    0 24px 60px rgba(31, 24, 18, 0.18),
    inset 0 1px 0 color-mix(in srgb, #fff 16%, transparent);
  backdrop-filter: blur(var(--focus-blur-lg, 28px)) saturate(1.08);
  -webkit-backdrop-filter: blur(var(--focus-blur-lg, 28px)) saturate(1.08);
  padding: clamp(0.78rem, 1.6vw, 0.95rem);
}

.date-picker-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(6.5rem, 0.42fr);
  gap: 0.62rem;
  margin-bottom: 0.72rem;
}

.date-picker-head label {
  display: grid;
  gap: 0.38rem;
  color: var(--text-secondary, var(--muted-strong));
  font-size: 0.78rem;
  font-weight: 780;
}

.date-picker-head span {
  opacity: 0.92;
}

.date-picker-head select {
  min-height: 2.75rem;
  border: 1px solid color-mix(in srgb, var(--primary, #5678f5) 28%, var(--surface-border, var(--glass-border)));
  border-radius: var(--focus-radius-md, 18px);
  background:
    radial-gradient(circle at 18% 0%, color-mix(in srgb, #fff 18%, transparent), transparent 64%),
    color-mix(in srgb, var(--surface-elevated, var(--glass-elevated)) 86%, transparent);
  color: var(--text-primary, var(--text));
  font-weight: 760;
  padding: 0 0.9rem;
}

.date-picker-head select option {
  background: color-mix(in srgb, var(--surface-elevated, var(--glass-elevated)) 96%, #f5f1ea);
  color: var(--text-primary, var(--text));
}

.date-picker-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.28rem;
  margin-bottom: 0.34rem;
  color: var(--text-secondary, var(--muted-strong));
  font-size: 0.76rem;
  font-weight: 820;
  text-align: center;
}

.date-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.28rem;
}

.date-picker-day {
  display: inline-grid;
  min-width: 0;
  min-height: 2.22rem;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--surface-border, var(--glass-border)) 48%, transparent);
  border-radius: 0.92rem;
  background:
    radial-gradient(circle at 30% 8%, color-mix(in srgb, #fff 14%, transparent), transparent 62%),
    color-mix(in srgb, var(--surface-glass, var(--glass-surface)) 56%, transparent);
  color: var(--text-primary, var(--text));
  font-size: 0.94rem;
  font-weight: 760;
  transition:
    transform var(--motion-fast, 140ms cubic-bezier(.2,.8,.2,1)),
    border-color var(--motion-standard, 220ms cubic-bezier(.2,.8,.2,1)),
    background var(--motion-standard, 220ms cubic-bezier(.2,.8,.2,1)),
    box-shadow var(--motion-standard, 220ms cubic-bezier(.2,.8,.2,1));
}

.date-picker-day:hover,
.date-picker-day:focus-visible {
  border-color: color-mix(in srgb, var(--primary, #5678f5) 42%, var(--surface-border-strong, var(--glass-border-strong)));
  background:
    radial-gradient(circle at 30% 8%, color-mix(in srgb, #fff 20%, transparent), transparent 62%),
    color-mix(in srgb, var(--primary, #5678f5) 10%, var(--surface-elevated, var(--glass-elevated)));
  box-shadow: 0 10px 24px color-mix(in srgb, var(--primary, #5678f5) 12%, transparent);
  transform: translateY(-1px);
}

.date-picker-day.muted {
  color: color-mix(in srgb, var(--text-muted, var(--muted)) 70%, transparent);
  opacity: 0.66;
}

.date-picker-day.today {
  border-color: color-mix(in srgb, var(--focus-accent-amber, #d89a3d) 52%, var(--surface-border, var(--glass-border)));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--focus-accent-amber, #d89a3d) 18%, transparent),
    0 10px 24px color-mix(in srgb, var(--focus-accent-amber, #d89a3d) 13%, transparent);
}

.date-picker-day.selected {
  border-color: color-mix(in srgb, var(--primary, #5678f5) 72%, #fff);
  background:
    radial-gradient(circle at 32% 10%, color-mix(in srgb, #fff 24%, transparent), transparent 58%),
    linear-gradient(145deg, color-mix(in srgb, var(--primary, #5678f5) 62%, var(--surface-elevated, var(--glass-elevated))), color-mix(in srgb, var(--primary, #5678f5) 34%, var(--surface-glass, var(--glass-surface))));
  color: #fff;
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--primary, #5678f5) 16%, transparent),
    0 14px 34px color-mix(in srgb, var(--primary, #5678f5) 22%, transparent);
}

.date-picker-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 0.72rem;
  padding-top: 0.62rem;
  border-top: 1px solid color-mix(in srgb, var(--surface-border, var(--glass-border)) 62%, transparent);
}

.date-picker-actions button {
  min-height: 2.35rem;
  border: 1px solid color-mix(in srgb, var(--primary, #5678f5) 18%, var(--surface-border, var(--glass-border)));
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-glass, var(--glass-surface)) 72%, transparent);
  color: color-mix(in srgb, var(--primary, #5678f5) 78%, var(--text-primary, var(--text)));
  font-weight: 760;
  padding: 0 0.9rem;
}

.arts-time-popover {
  align-items: end;
  gap: 0.72rem;
  width: max-content;
  max-width: min(100%, 30rem);
  border: 1px solid var(--focus-picker-border);
  border-radius: var(--focus-radius-lg, 24px);
  background:
    radial-gradient(circle at 18% 0%, color-mix(in srgb, var(--primary, #5678f5) 12%, transparent), transparent 13rem),
    color-mix(in srgb, var(--surface-elevated, var(--glass-elevated)) 76%, transparent);
  box-shadow:
    0 18px 44px rgba(31, 24, 18, 0.14),
    inset 0 1px 0 color-mix(in srgb, #fff 14%, transparent);
  backdrop-filter: blur(var(--focus-blur-md, 20px)) saturate(1.06);
  -webkit-backdrop-filter: blur(var(--focus-blur-md, 20px)) saturate(1.06);
  padding: 0.7rem;
}

.time-picker {
  position: relative;
  display: grid;
  width: min(12rem, 100%);
  gap: 0.48rem;
}

.time-picker-trigger {
  display: inline-grid;
  width: 100%;
  min-height: 2.95rem;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--primary, #5678f5) 30%, var(--surface-border, var(--glass-border)));
  border-radius: var(--focus-radius-md, 18px);
  background:
    radial-gradient(circle at 26% 0%, color-mix(in srgb, #fff 18%, transparent), transparent 60%),
    color-mix(in srgb, var(--surface-glass, var(--glass-surface)) 76%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 13%, transparent);
  color: var(--text-primary, var(--text));
  font-size: 1.05rem;
  font-weight: 820;
  letter-spacing: 0.01em;
  padding: 0 0.82rem;
}

.time-picker-trigger:is(:hover, :focus-visible) {
  border-color: color-mix(in srgb, var(--primary, #5678f5) 52%, var(--surface-border-strong, var(--glass-border-strong)));
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--primary, #5678f5) 12%, transparent),
    inset 0 1px 0 color-mix(in srgb, #fff 16%, transparent);
}

.time-picker-panel {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.46rem;
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--surface-border, var(--glass-border)) 68%, transparent);
  border-radius: var(--focus-radius-md, 18px);
  background:
    radial-gradient(circle at 24% 0%, color-mix(in srgb, #fff 12%, transparent), transparent 52%),
    color-mix(in srgb, var(--surface-glass, var(--glass-surface)) 74%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 12%, transparent);
  padding: 0.38rem;
}

.time-picker.is-open .time-picker-panel {
  display: grid;
}

.time-picker-column {
  display: grid;
  max-height: 11.4rem;
  gap: 0.24rem;
  overflow: hidden auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  padding: 0.14rem;
}

.time-picker-column button {
  min-height: 2.32rem;
  border: 1px solid transparent;
  border-radius: 0.78rem;
  background: transparent;
  color: var(--text-primary, var(--text));
  font-size: 1rem;
  font-weight: 780;
  padding: 0 0.32rem;
}

.time-picker-column button:hover,
.time-picker-column button.selected {
  border-color: color-mix(in srgb, var(--primary, #5678f5) 42%, transparent);
  background:
    radial-gradient(circle at 30% 0%, color-mix(in srgb, #fff 16%, transparent), transparent 60%),
    color-mix(in srgb, var(--primary, #5678f5) 24%, var(--surface-elevated, var(--glass-elevated)));
  box-shadow: 0 8px 18px color-mix(in srgb, var(--primary, #5678f5) 12%, transparent);
  color: color-mix(in srgb, var(--primary, #5678f5) 74%, var(--text-primary, var(--text)));
}

.arts-time-popover .button,
.sport-time-popover .button,
.practice-time-popover .button {
  min-height: 2.95rem;
  border-radius: var(--focus-radius-md, 18px);
  white-space: nowrap;
  padding-inline: 1.02rem;
}

.sport-day-row,
.class-day-row,
.custom-day-row,
.practice-day-row {
  align-items: start;
  gap: 0.72rem;
}

.sport-day-button {
  min-width: 7rem;
  min-height: 3.05rem;
}

.sport-day-sessions,
.practice-day-sessions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-width: 0;
}

.sport-day-session,
.practice-day-session {
  min-height: 3.05rem;
  align-items: center;
  border-radius: var(--focus-radius-md, 18px);
  padding: 0.52rem 0.62rem 0.52rem 0.82rem;
}

.sport-day-session strong,
.practice-day-session strong {
  min-width: 4.7rem;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.sport-add-more,
.practice-add-more {
  display: inline-grid;
  width: 3.05rem;
  min-width: 3.05rem;
  height: 3.05rem;
  min-height: 3.05rem;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--primary, #5678f5) 18%, var(--surface-border, var(--glass-border)));
  border-radius: var(--focus-radius-md, 18px);
  background: color-mix(in srgb, var(--surface-glass, var(--glass-surface)) 72%, transparent);
  color: var(--text-primary, var(--text));
  font-size: 1.16rem;
  font-weight: 820;
}

@media (max-width: 760px) {
  .modal-fields :where(input, textarea, select),
  .create-fields :where(input, textarea, select),
  .wizard-card :where(input, textarea, select),
  .schedule-form-grid :where(input, textarea, select) {
    min-height: 3.18rem;
    font-size: 1rem;
  }

  .date-popover {
    width: 100%;
    margin-top: 0.62rem;
    padding: 0.78rem;
  }

  .date-picker-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .date-picker-day {
    min-height: 2.32rem;
    border-radius: 0.82rem;
    font-size: 0.88rem;
  }

  .arts-time-popover {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  .time-picker {
    width: 100%;
  }

  .sport-day-row,
  .class-day-row,
  .custom-day-row,
  .practice-day-row {
    grid-template-columns: minmax(6.5rem, 0.34fr) minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .modal-fields :where(input, textarea, select),
  .create-fields :where(input, textarea, select),
  .wizard-card :where(input, textarea, select),
  .schedule-form-grid :where(input, textarea, select),
  .date-picker-day,
  .time-picker-trigger,
  .time-picker-column button,
  .sport-add-more,
  .practice-add-more {
    transition-duration: 1ms;
  }
}
