/* ==========================================================================
   Bney Brit Hadasha - Registration Service
   Design System: shadcn/ui Architecture (Tailwind / Slate / Gold Accent)
   ========================================================================== */

:root {
  /* shadcn/ui design tokens adapted to dark navy & gold luxury theme */
  --background: 222 47% 7%;        /* #060e1d */
  --foreground: 210 40% 98%;       /* #f8fafc */

  --card: 222 47% 11%;             /* #0b172e */
  --card-foreground: 210 40% 98%;  /* #f8fafc */
  
  --popover: 222 47% 11%;
  --popover-foreground: 210 40% 98%;

  --primary: 43 65% 52%;           /* #d4af37 Gold */
  --primary-foreground: 222 47% 11%;
  --primary-hover: 43 72% 58%;     /* #e6c55b */

  --secondary: 217 33% 17%;        /* #1e293b Slate-800 */
  --secondary-foreground: 210 40% 98%;

  --muted: 217 33% 17%;            /* #1e293b */
  --muted-foreground: 215 20% 65%; /* #94a3b8 */

  --accent: 217 33% 20%;
  --accent-foreground: 210 40% 98%;

  --destructive: 0 84% 60%;        /* #ef4444 */
  --destructive-foreground: 210 40% 98%;

  --border: 217 33% 20%;           /* rgba(255, 255, 255, 0.1) */
  --input: 217 33% 22%;            /* #243247 */
  --ring: 43 65% 52%;              /* gold focus ring */

  --radius: 0.75rem;               /* 12px default */
  --radius-sm: 0.5rem;             /* 8px */
  --radius-lg: 1rem;               /* 16px */
  --radius-xl: 1.25rem;            /* 20px */

  /* Gold Luxury Accents */
  --gold-glow: rgba(212, 175, 55, 0.2);
  --gold-border: rgba(212, 175, 55, 0.4);
  --gold-border-subtle: rgba(212, 175, 55, 0.2);
  
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Cinzel", "Playfair Display", Georgia, serif;
}

/* Base Reset & Typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: hsl(var(--background));
  background-image: 
    radial-gradient(circle at 50% 0%, hsl(222 47% 15%) 0%, hsl(var(--background)) 70%),
    radial-gradient(circle at 100% 100%, hsl(220 40% 12%) 0%, transparent 50%);
  color: hsl(var(--foreground));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Multi-step view management */
.step-view {
  display: none !important;
  opacity: 0;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.step-view.active {
  display: flex !important;
  flex-direction: column;
  opacity: 1;
}

/* Container */
.container {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 20px 20px 56px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* ==========================================================================
   Header & Community Identity
   ========================================================================== */
.app-header {
  position: relative;
  text-align: center;
  padding: 12px 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Floating Language Switcher button (RU / RO) in top right */
.lang-switch-btn {
  position: absolute;
  top: 10px;
  right: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 34px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: var(--radius-sm);
  color: var(--gold-light);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
  touch-action: manipulation;
}

.lang-switch-btn:hover {
  background: rgba(212, 175, 55, 0.18);
  border-color: var(--gold-primary);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.25);
}

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

.lang-badge {
  line-height: 1;
}

.brand-emblem {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: hsl(var(--card));
  border: 1px solid var(--gold-border-subtle);
  margin-bottom: 12px;
  box-shadow: 0 0 18px var(--gold-glow);
  padding: 6px;
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.community-name {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(43 65% 85%);
  margin-bottom: 3px;
}

.community-sub {
  font-size: 12px;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ==========================================================================
   shadcn/ui Progress / Stepper Component
   ========================================================================== */
.progress-stepper {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  padding: 0 12px;
}

.progress-track {
  position: absolute;
  top: 15px;
  left: 36px;
  right: 36px;
  height: 2px;
  background: hsl(var(--muted));
  z-index: 1;
  border-radius: 9999px;
}

.progress-bar-fill {
  height: 100%;
  background: hsl(var(--primary));
  transition: width 0.3s ease;
  border-radius: 9999px;
  box-shadow: 0 0 8px var(--gold-glow);
}

.step-item {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: default;
}

.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  background: hsl(var(--background));
  border: 2px solid hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.25s ease;
}

.step-item.active .step-circle {
  border-color: hsl(var(--primary));
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.15);
}

.step-item.completed .step-circle {
  border-color: hsl(var(--primary));
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.step-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: hsl(var(--muted-foreground));
}

.step-item.active .step-label {
  color: hsl(43 65% 85%);
}

/* ==========================================================================
   Typography (shadcn Page Headings)
   ========================================================================== */
.step-title {
  font-size: 22px;
  font-weight: 700;
  color: hsl(var(--foreground));
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 6px;
}

.step-subtitle {
  font-size: 14px;
  color: hsl(var(--muted-foreground));
  line-height: 1.5;
  margin-bottom: 20px;
}

/* Центрирование заголовка и описания на шагах 1 и 2 */
#step1View .step-title,
#step1View .step-subtitle,
#step2View .step-title,
#step2View .step-subtitle {
  text-align: center;
}

/* ==========================================================================
   shadcn/ui Alert Component
   ========================================================================== */
.alert-error {
  position: relative;
  background: hsl(0 62% 12%);
  border: 1px solid hsl(var(--destructive));
  color: hsl(0 84% 85%);
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.alert-error button {
  background: hsl(0 84% 60% / 0.15);
  border: 1px solid hsl(0 84% 60% / 0.3);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  font-weight: 600;
}

/* ==========================================================================
   Groups Stack & shadcn Card Architecture
   ========================================================================== */
.group-list,
.groups-list,
#groupsContainer {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  gap: 14px !important;
  margin-bottom: 24px !important;
}

/* shadcn Card Container: Белая премиальная карточка на всех этапах */
.group-card {
  position: relative;
  width: 100% !important;
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 1.5px solid #cbd5e1 !important; /* Усиленный контрастный контур карточки */
  border-radius: var(--radius-lg);
  padding: 20px 20px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25), 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  display: flex;
  flex-direction: column;
}

.group-card:hover {
  border-color: #d4af37 !important;
  background-color: #ffffff !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.32), 0 0 0 1px rgba(212, 175, 55, 0.4);
}

/* Selected State with gold highlight */
.group-card.selected {
  border-color: #d4af37 !important;
  background-color: #ffffff !important;
  box-shadow: 0 0 0 2px #d4af37, 0 10px 32px rgba(0, 0, 0, 0.4);
}

/* Card Header with Title and Radio indicator */
.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.card-title-wrap {
  flex: 1;
}

/* Card Title: Bold uppercase heading */
.card-title {
  font-size: 17px;
  font-weight: 800; /* BOLD */
  color: #0f172a !important;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.3;
}

/* shadcn Radio Item indicator */
.radio-check {
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  border: 2px solid #cbd5e1;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all 0.2s ease;
}

.group-card.selected .radio-check {
  border-color: hsl(var(--primary));
  background: hsl(var(--primary));
}

.radio-check svg {
  width: 12px;
  height: 12px;
  fill: #060e1d;
  display: none;
}

.group-card.selected .radio-check svg {
  display: block;
}

/* ==========================================================================
   Руководитель (Leader) Block under Title
   ========================================================================== */
.leader-row {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  padding: 8px 14px 8px 8px;
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: var(--radius);
  transition: all 0.2s ease;
}

.group-card.selected .leader-row {
  background: #fefce8 !important;
  border-color: rgba(212, 175, 55, 0.6) !important;
}

/* Заготовка под аватарку: увеличенная еще на 20% (было 85x85 -> стало 102x102px) */
.leader-avatar-placeholder {
  width: 102px;
  height: 102px;
  border-radius: var(--radius-sm); /* аккуратное небольшое скругление */
  background: linear-gradient(135deg, hsl(222 47% 20%) 0%, hsl(222 47% 9%) 100%);
  color: #ffffff;
  border: 2px solid #d4af37;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  flex-shrink: 0;
}

.leader-initials {
  font-size: 30px; /* пропорционально увеличен размер инициалов (+20%) */
  font-weight: 800;
  color: #fef08a !important; /* Яркое золото на темно-синем фоне аватара, контраст 14:1 */
  letter-spacing: 0.05em;
  line-height: 1;
}

.leader-avatar-icon {
  display: none;
  width: 44px;
  height: 44px;
  fill: #fef08a;
}

.leader-avatar-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius-sm) - 2px);
}

.leader-text {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
  gap: 3px;
}

.leader-role-label {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  color: #475569 !important; /* Slate-600: высокая контрастность 7.24:1 AAA */
  letter-spacing: 0.08em;
}

.leader-name {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a !important; /* Slate-900: максимальный контраст 16.3:1 AAA */
}

/* Card Description: глубокий и четкий контрастный цвет */
.card-description {
  font-size: 14px;
  color: #334155 !important; /* Slate-700, контрастность 10.35:1 AAA */
  line-height: 1.55;
  margin: 12px 0 14px 0;
}

/* ==========================================================================
   shadcn/ui Badge / Chip Architecture (для светлых карточек)
   ========================================================================== */
.chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 0;
  border-top: none; /* Без разделительной линии */
}

/* shadcn-style Badge / Chip с высокой контрастностью */
.ui-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--radius-sm); /* shadcn badge subtle radius */
  font-size: 12.5px;
  font-weight: 500;
  color: #334155 !important; /* Slate-700, контрастность 9.45:1 AAA */
  background: #f1f5f9 !important; /* Slate-100 */
  border: 1px solid #cbd5e1 !important; /* Slate-300 */
  line-height: 1.3;
  transition: all 0.15s ease;
}

.ui-chip strong {
  font-weight: 700;
  color: #0f172a !important; /* Slate-900, максимальный контраст 16.3:1 AAA */
}

.chip-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: #64748b !important;
  opacity: 1;
}

/* Semantic Badges */
.chip-time {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}

.chip-time .chip-icon {
  color: #b45309 !important; /* Теплый янтарно-золотой */
}

.chip-start {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}

.chip-start .chip-icon {
  color: #2563eb !important; /* Четкий синий */
}

.chip-format.chip-online {
  background: #ecfdf5 !important; /* Emerald-50 */
  border-color: #a7f3d0 !important;
  color: #065f46 !important; /* Emerald-800, контрастность 7.29:1 AAA */
}

.chip-format.chip-online strong {
  color: #064e3b !important;
}

.chip-format.chip-online .chip-icon {
  color: #059669 !important;
}

.chip-format.chip-offline {
  background: #fefce8 !important; /* Amber-50 */
  border-color: #fde68a !important;
  color: #854d0e !important; /* Amber-800, контрастность 6.62:1 AAA */
}

.chip-format.chip-offline strong {
  color: #713f12 !important;
}

.chip-format.chip-offline .chip-icon {
  color: #b45309 !important;
}

/* Clickable location chip with external link */
a.ui-chip.chip-clickable {
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

a.ui-chip.chip-clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  filter: brightness(0.97);
}

a.ui-chip.chip-clickable:active {
  transform: translateY(0);
}

a.ui-chip.chip-clickable .chip-link-icon {
  transition: transform 0.15s ease;
}

a.ui-chip.chip-clickable:hover .chip-link-icon {
  transform: translate(1px, -1px);
  opacity: 1 !important;
}

/* ==========================================================================
   shadcn/ui Form Controls (Input, Textarea, Label)
   ========================================================================== */
.form-row {
  display: flex;
  gap: 16px;
  width: 100%;
}

.form-row-2col > .form-group {
  flex: 1 1 0%;
  min-width: 0;
}

@media (max-width: 480px) {
  .form-row-2col {
    gap: 12px;
  }
}

.form-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: hsl(var(--foreground));
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.required-star {
  color: hsl(var(--destructive));
  font-weight: bold;
}

.form-hint {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  margin-top: 6px;
}

/* shadcn input */
.form-control {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  background-color: hsl(var(--card));
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
  outline: none;
}

.form-control::placeholder {
  color: hsl(var(--muted-foreground) / 0.6);
}

.form-control:focus {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.25);
  background-color: hsl(222 47% 13%);
}

.form-control.is-invalid {
  border-color: hsl(var(--destructive));
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.form-control.textarea {
  field-sizing: content;
  min-height: calc(3lh + 24px);
  max-height: 40lh;
  height: auto;
  padding: 12px 14px;
  line-height: 1.5;
  resize: vertical;
}

.field-error {
  font-size: 12px;
  color: hsl(var(--destructive));
  margin-top: 6px;
  font-weight: 500;
}

/* ==========================================================================
   Date Picker Card (Step 2)
   ========================================================================== */
.date-picker-card {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow: hidden; /* предотвращает вылезание за пределы экрана на узких экранах типа iPhone 13 mini */
}

/* Date picker card and its inner content centered */
.date-picker-card {
  text-align: center;
}

.date-picker-card .form-label {
  display: block;
  text-align: center;
  color: #0f172a !important;
  font-weight: 600;
  margin-bottom: 10px;
}

.date-picker-card .date-helper {
  text-align: center;
}

.date-picker-card .field-error {
  text-align: center;
}

/* Date input wrapper with calendar icon & tight overflow containment */
.date-input-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

.date-calendar-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #64748b;
  pointer-events: none;
  z-index: 2;
  transition: color 0.2s ease;
}

/* Скрываем нативный нелокализованный текст даты, пока значение не выбрано,
   и показываем аккуратный локализованный плейсхолдер на русском (дд.мм.гггг) или румынском (zz.ll.aaaa) */
.date-input-wrapper:not(.has-value):not(:focus-within) input[type="date"] {
  color: transparent !important;
}

.date-input-wrapper.has-value input[type="date"],
.date-input-wrapper:focus-within input[type="date"] {
  color: #0f172a !important;
}

.date-custom-placeholder {
  position: absolute;
  left: 40px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 14px;
  font-weight: 500;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.15s ease;
}

.date-input-wrapper.has-value .date-custom-placeholder,
.date-input-wrapper:focus-within .date-custom-placeholder {
  opacity: 0 !important;
  visibility: hidden !important;
}

.date-input-wrapper:focus-within .date-calendar-icon {
  color: hsl(var(--primary));
}

.date-picker-card .form-control {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding-left: 38px !important; /* место под иконку календаря */
  font-size: 15px !important;
  font-weight: 500;
  border-radius: var(--radius-sm);
  appearance: none;
  -webkit-appearance: none;
}

.date-picker-card .form-control:focus {
  background: #ffffff !important;
  border-color: hsl(var(--primary)) !important;
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.25) !important;
}

.date-input-wrapper input[type="date"] {
  color-scheme: light;
  min-height: 44px;
}

/* Safari on iOS / iPhone 13 mini date styling */
.date-input-wrapper input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s ease;
  margin-right: 4px;
}

.date-input-wrapper input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

.date-helper {
  font-size: 13px;
  color: #64748b !important;
  line-height: 1.45;
}

.btn-chip {
  display: inline-flex;
  align-items: center;
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: #fefce8 !important;
  border: 1px solid rgba(212, 175, 55, 0.4) !important;
  color: #854d0e !important;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-chip:hover {
  background: #fef9c3 !important;
  border-color: hsl(var(--primary)) !important;
}

/* ==========================================================================
   Selected Group Summary Card (Step 2 & 3) - Темная карточка shadcn
   ========================================================================== */
.selected-group-summary,
.selected-group-summary-card {
  background: hsl(var(--card)) !important;
  color: hsl(var(--card-foreground)) !important;
  border: 1px solid hsl(var(--border)) !important;
  border-left: 4px solid hsl(var(--primary)) !important;
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 24px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.brief-title {
  font-size: 16px;
  font-weight: 800;
  color: hsl(var(--card-foreground)) !important;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

.brief-title-prefix {
  color: hsl(var(--muted-foreground)) !important;
  font-weight: 600;
  margin-right: 4px;
}

.brief-title-name {
  color: hsl(var(--primary)) !important;
  text-transform: uppercase;
  font-weight: 800;
}

.brief-meta {
  font-size: 13.5px;
  color: hsl(var(--muted-foreground)) !important;
  font-weight: 500;
}

/* ==========================================================================
   Step 3: Two-Card Layout (Confirmation Card + Form Card)
   ========================================================================== */
.step3-cards-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Card 1: Confirmation Card */
.confirmation-card {
  background: hsl(var(--card)) !important;
  color: hsl(var(--card-foreground)) !important;
  border: 1px solid rgba(212, 175, 55, 0.4) !important;
  border-left: 4px solid hsl(var(--primary)) !important;
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.conf-badge-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.conf-badge-tag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 9999px;
  background: rgba(212, 175, 55, 0.15);
  color: hsl(var(--primary)) !important;
  border: 1px solid rgba(212, 175, 55, 0.35);
}

.conf-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.conf-group-row,
.conf-schedule-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.conf-label {
  font-size: 13.5px;
  color: hsl(var(--muted-foreground)) !important;
  font-weight: 500;
  flex-shrink: 0;
}

.conf-group-name {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff !important;
  letter-spacing: 0.02em;
  text-align: right;
  text-transform: uppercase;
}

.conf-schedule-val {
  font-size: 14px;
  font-weight: 700;
  color: hsl(var(--primary)) !important;
  text-align: right;
  line-height: 1.4;
}

/* Card 2: Form Card */
.form-card {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
  box-sizing: border-box;
  width: 100%;
}

.form-card .form-label {
  color: #0f172a !important;
  font-weight: 600;
}

.form-card .form-control {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}

.form-card .form-control:focus {
  background: #ffffff !important;
  border-color: hsl(var(--primary)) !important;
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.25) !important;
}

.form-card .form-control::placeholder {
  color: #94a3b8 !important;
}

.form-card .field-hint {
  color: #64748b !important;
}

.form-card .btn-submit {
  width: 100%;
  margin-top: 8px;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 700;
}

/* Final Summary Card (Step 3) - Белая карточка */
.final-summary-card {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin: 16px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
}

.summary-badge {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #b45309 !important;
  margin-bottom: 2px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
  gap: 12px;
}

.summary-item-label {
  color: #64748b !important;
}

.summary-item-val {
  color: #0f172a !important;
  font-weight: 700;
  text-align: right;
}

/* ==========================================================================
   shadcn/ui Button Variants & Fixed Floating Dock Bar
   ========================================================================== */
.btn-footer {
  margin-top: 8px;
}

/* Фиксированная плавающая панель внизу вьюпорта */
.fixed-floating-footer {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 99999 !important;
  pointer-events: none; /* Клики проходят сквозь края плашки к контенту под ней */
  display: none;
  justify-content: center;
  align-items: flex-end;
  box-sizing: border-box;

  /* Отступы с учетом Safe Area Inset на всех поколениях iOS и Android:
     - старый WebKit: constant(safe-area-inset-bottom)
     - современный стандарт: env(safe-area-inset-bottom)
     - динамический остров (Dynamic Island) и Liquid Glass home bar */
  padding: 14px 20px;
  padding-bottom: calc(18px + constant(safe-area-inset-bottom));
  padding-bottom: calc(18px + env(safe-area-inset-bottom, 18px));

  /* Эффект Liquid Glass / Frosted Glass:
     - backdrop-filter для современных Safari, Chrome, Edge
     - -webkit-backdrop-filter для Safari на iOS всех версий
     - fallback на глубокий темный градиент для старых Android/браузеров без backdrop-filter */
  background: rgba(6, 14, 29, 0.88);
  -webkit-backdrop-filter: blur(20px) saturate(190%) contrast(110%);
  backdrop-filter: blur(20px) saturate(190%) contrast(110%);
  border-top: 1px solid rgba(212, 175, 55, 0.3);
  box-shadow: 0 -10px 36px rgba(0, 0, 0, 0.6), 0 -1px 0 rgba(255, 255, 255, 0.08) inset;

  /* Анимация плавного вылета снизу */
  opacity: 0;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease;
}

.fixed-floating-footer.visible {
  display: flex !important;
  opacity: 1 !important;
  transform: translateY(0) !important;
}

.floating-dock-card {
  width: 100%;
  max-width: 520px; /* Совпадает с шириной основного контейнера .container */
  pointer-events: auto; /* Включаем кликабельность на кнопке */
  display: flex;
  justify-content: center;
}

.btn-floating-next {
  width: 100% !important;
  height: 50px !important;
  font-size: 15.5px !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.35), 0 2px 6px rgba(0, 0, 0, 0.4) !important;
}

/* Отступ снизу для списка групп на шаге 1, чтобы последняя карточка не перекрывалась плавающей кнопкой */
#step1View {
  padding-bottom: calc(88px + env(safe-area-inset-bottom, 20px));
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  padding: 0 20px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  border: none;
  outline: none;
  gap: 8px;
}

/* shadcn Primary Button: Gold Accent */
.btn-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2);
}

.btn-primary:hover:not(:disabled) {
  background: hsl(var(--primary-hover));
  box-shadow: 0 4px 14px var(--gold-glow);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary svg {
  width: 18px;
  height: 18px;
}

/* shadcn Ghost / Outline Back Button */
.back-link-wrap {
  margin-bottom: 16px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid hsl(var(--border));
  color: hsl(var(--muted-foreground));
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-back:hover {
  background: hsl(var(--secondary));
  color: hsl(var(--foreground));
  border-color: hsl(var(--muted-foreground) / 0.4);
}

.btn-back svg {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   Loading Spinner
   ========================================================================== */
.spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid hsl(var(--muted));
  border-top-color: hsl(var(--primary));
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Success View
   ========================================================================== */
.success-screen-box {
  text-align: center;
}

.success-card {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: var(--radius-xl);
  padding: 36px 24px 32px;
  text-align: center;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.35);
}

.success-card .success-title {
  color: #0f172a !important;
}

.success-card .success-message {
  color: #475569 !important;
}

.success-card .success-summary-card {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

.success-card .success-label {
  color: #64748b !important;
}

.success-card .success-val {
  color: #0f172a !important;
}

.success-icon-wrap {
  width: 60px;
  height: 60px;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.15);
  border: 1.5px solid hsl(142 71% 45%);
  color: hsl(142 71% 45%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.success-icon-wrap svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

.success-title {
  font-size: 24px;
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-bottom: 12px;
  text-align: center;
}

.success-message {
  font-size: 14px;
  color: hsl(var(--muted-foreground));
  line-height: 1.6;
  margin-bottom: 24px;
  text-align: center;
}

.success-summary-card {
  background: #f8fafc !important;
  color: #0f172a !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 24px;
  text-align: center;
}

.success-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 12px;
}

.success-row:last-child {
  margin-bottom: 0;
}

.success-label {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
  text-align: center;
}

.success-val {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a !important;
  text-align: center;
}

/* ==========================================================================
   Modern iOS / shadcn Toggle Switch Component
   ========================================================================== */
.switch-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.switch-control input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.switch-track {
  position: relative;
  width: 38px;
  height: 22px;
  background-color: #cbd5e1;
  border-radius: 9999px;
  transition: background-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
  flex-shrink: 0;
}

.switch-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background-color: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.switch-control input[type="checkbox"]:checked + .switch-track {
  background-color: #d4af37; /* community gold accent */
}

.switch-control input[type="checkbox"]:checked + .switch-track::after {
  transform: translateX(16px);
}

.switch-control input[type="checkbox"]:focus-visible + .switch-track {
  outline: 2px solid #b45309;
  outline-offset: 2px;
}

.switch-label-text {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}

/* ==========================================================================
   Mobile responsiveness
   ========================================================================== */
@media (max-width: 480px) {
  .container {
    padding: 16px 16px 40px;
  }
  .group-card {
    padding: 16px;
  }
  .leader-avatar-placeholder {
    width: 90px; /* Увеличено на 20% (было 75px -> 90px) */
    height: 90px;
  }
  .leader-initials {
    font-size: 26px;
  }
}
