*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #6c5ce7; --primary-dark: #5b4cc4; --primary-light: #a78bfa;
  --accent: #10b981; --accent-dark: #059669; --blue: #3b82f6; --amber: #f59e0b;
  --bg: #f8fafc; --card: #ffffff; --text: #1e293b; --text-muted: #64748b;
  --border: #e2e8f0; --shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.1); --radius: 12px; --radius-sm: 8px;
}

body { 
  font-family: system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif; 
  background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; 
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.site-header { 
  background: var(--card); border-bottom: 1px solid var(--border); padding: 16px 0; margin-bottom: 30px; box-shadow: var(--shadow); 
}
.site-header .container { display: flex; justify-content: space-between; align-items: center; }

.logo { font-size: 1.5rem; font-weight: 700; color: var(--primary); text-decoration: none; display: flex; align-items: center; gap: 8px; }

nav a { text-decoration: none; color: var(--text-muted); font-weight: 500; transition: color 0.2s; padding: 6px 12px; border-radius: var(--radius-sm); margin-left: 16px; }
nav a:hover, nav a.active { color: var(--primary); background: rgba(108, 92, 231, 0.1); }

main { flex: 1; padding: 20px 0 40px; }

.section { display: none; animation: fadeIn 0.3s ease; }
.section.active { display: block; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } } 

h1 { font-size: 2rem; margin-bottom: 24px; color: var(--text); text-align: center; font-weight: 700; }

.shows-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; margin-bottom: 40px; }
.show-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: transform 0.2s, box-shadow 0.2s; cursor: pointer; border: 1px solid var(--border); display: flex; flex-direction: column; }
.show-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.show-card img { width: 100%; height: 180px; object-fit: cover; background: #e0e7ff; }
.show-card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.show-card h3 { color: var(--primary); margin-bottom: 6px; font-size: 1.25rem; }
.show-card .date { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 10px; }
.show-card .description { color: var(--text); line-height: 1.4; margin-bottom: 16px; flex: 1; font-size: 0.95rem; }
.show-card .btn { width: 100%; margin: 0; }

/* === КАРТОЧКА СПЕКТАКЛЯ (НОВАЯ) === */
.show-info-card {
  max-width: 1050px;
  margin: 0 auto 32px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}

.card-header {
  padding: 20px 24px 14px;
  text-align: center;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.card-header h2 { color: var(--primary); font-size: 1.9rem; margin: 0 0 6px; font-weight: 700; }
.card-header .show-meta { color: var(--text-muted); font-weight: 600; font-size: 1rem; letter-spacing: 0.5px; }

.card-body {
  display: flex;
  gap: 24px;
  padding: 24px;
  align-items: flex-start;
}

.show-poster {
  flex: 0 0 280px;
  max-height: 420px;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  display: block;
}

#show-full-desc {
  flex: 1;
  min-width: 260px;
  color: var(--text);
  line-height: 1.65;
  font-size: 1.05rem;
  white-space: pre-wrap;
  padding-top: 4px;
}

/* === СХЕМА ЗАЛА === */
.seats-wrapper { max-width: 900px; margin: 0 auto; }

.hall-container { background: var(--card); padding: 24px; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); margin-bottom: 24px; }

.stage { 
  background: linear-gradient(180deg, #e0e7ff 0%, #c7d2fe 100%); border: 3px dashed var(--primary); border-bottom: none; border-radius: 12px 12px 0 0; text-align: center; padding: 12px; font-weight: 700; color: var(--primary); font-size: 1rem; margin-bottom: 16px; letter-spacing: 2px; 
}

.seat-grid { display: grid; gap: 6px; justify-content: center; margin-bottom: 20px; }

.row-label { display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--text-muted); width: 28px; font-size: 0.85rem; }

.seat { width: 38px; height: 38px; border-radius: var(--radius-sm); border: 2px solid transparent; font-weight: 600; cursor: pointer; transition: all 0.2s; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; position: relative; }
.seat.available { background: var(--accent); border-color: var(--accent); }
.seat.available:hover:not(:disabled) { transform: translateY(-2px) scale(1.05); box-shadow: 0 4px 10px rgba(16, 185, 129, 0.4); background: var(--accent-dark); }
.seat.booked { background: var(--amber); border-color: #d97706; cursor: not-allowed; }
.seat.verified { background: #3b82f6; border-color: #3b82f6; cursor: not-allowed; position: relative; }
.seat.verified::after { content: '✓'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 1.3rem; font-weight: 900; color: rgba(255, 255, 255, 0.4); }
.seat:disabled { opacity: 0.6; cursor: not-allowed; }

.aisle { width: 24px; border-left: 1px solid #cbd5e1; border-right: 1px solid #cbd5e1; }

.legend { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
.legend-dot { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 2px solid transparent; }
.legend-dot.available { background: var(--accent); border-color: var(--accent); }
.legend-dot.booked { background: var(--amber); border-color: #d97706; }
.legend-dot.verified { background: #3b82f6; border-color: #3b82f6; }

.btn-back { background: none; border: none; color: var(--primary); font-size: 1rem; cursor: pointer; margin-bottom: 20px; padding: 8px 0; font-weight: 500; display: flex; align-items: center; gap: 6px; transition: color 0.2s; }
.btn-back:hover { color: var(--primary-dark); text-decoration: underline; }

/* === МОДАЛЬНЫЕ ОКНА И ФОРМЫ === */
.modal { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.6); justify-content: center; align-items: center; z-index: 2000; backdrop-filter: blur(4px); padding: 20px; }
.modal.active { display: flex; animation: modalFadeIn 0.3s ease; }

@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-content { background: var(--card); padding: 24px; border-radius: var(--radius); width: 100%; max-width: 460px; position: relative; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2); max-height: 90vh; overflow-y: auto; }
.modal-close { position: absolute; top: 14px; right: 16px; background: none; border: none; font-size: 1.6rem; color: var(--text-muted); cursor: pointer; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.modal-close:hover { color: var(--text); background: rgba(0, 0, 0, 0.05); }

.modal-content h2 { color: var(--primary); margin-bottom: 14px; font-size: 1.4rem; font-weight: 700; text-align: center; }
.modal-info { text-align: center; margin-bottom: 16px; color: var(--text-muted); font-size: 0.95rem; padding: 10px; background: var(--bg); border-radius: var(--radius-sm); }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 600; color: var(--text); font-size: 0.9rem; }
.form-group input { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.95rem; background: var(--card); }
.form-group input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15); }
.form-group.checkbox { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; }
.form-group.checkbox input { width: auto; margin-top: 3px; cursor: pointer; }
.form-group.checkbox label { margin: 0; font-size: 0.85rem; color: var(--text-muted); font-weight: 400; cursor: pointer; }

.modal-actions { display: flex; gap: 10px; margin-top: 18px; justify-content: flex-end; }

.btn { padding: 10px 20px; border: none; border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; font-size: 0.95rem; transition: all 0.2s; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.secondary { background: #e2e8f0; color: var(--text); }
.btn.secondary:hover { background: #cbd5e1; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.captcha-box { background: #f8fafc; padding: 10px; border-radius: 8px; border: 1px solid #e2e8f0; margin-bottom: 12px; }
.captcha-content { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.captcha-text { font-size: 1.1rem; font-weight: 800; color: var(--primary); min-width: 90px; text-align: center; user-select: none; }
.captcha-content input { flex: 1; padding: 8px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; }
.captcha-content input.input-error { border-color: #ef4444 !important; background: #fef2f2 !important; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important; }
.captcha-error-msg { color: #ef4444; font-size: 0.8rem; margin-top: 4px; font-weight: 600; display: none; }
.btn-refresh-captcha { background: none; border: 1px solid #cbd5e1; border-radius: 6px; cursor: pointer; font-size: 1rem; padding: 5px 8px; }
.btn-refresh-captcha:hover { background: #e2e8f0; }

.loading { text-align: center; color: var(--text-muted); padding: 30px; font-size: 1rem; }

/* === ФУТЕР === */
.site-footer { background: var(--card); border-top: 1px solid var(--border); padding: 30px 0 16px; box-shadow: var(--shadow); margin-top: auto; }
.footer-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 24px; margin-bottom: 24px; }
.footer-section h3 { color: var(--primary); margin-bottom: 10px; font-size: 1.05rem; font-weight: 700; }
.footer-section p { color: var(--text-muted); margin-bottom: 5px; font-size: 0.9rem; }
.social-links { display: flex; gap: 10px; flex-wrap: wrap; }
.social-link { display: inline-block; padding: 7px 14px; background: var(--primary); color: #fff; text-decoration: none; border-radius: var(--radius-sm); font-weight: 500; transition: background 0.2s; font-size: 0.85rem; }
.social-link:hover { background: var(--primary-dark); }
.footer-bottom { text-align: center; padding-top: 16px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.85rem; }

/* === АДАПТИВНОСТЬ === */
@media (max-width: 768px) {
  .container { padding: 0 14px; }
  .show-info-card { max-width: 100%; margin-bottom: 20px; }
  .card-body { flex-direction: column; align-items: center; text-align: center; gap: 16px; }
  .show-poster { flex: none; max-width: 90%; max-height: 300px; }
  #show-full-desc { min-width: auto; text-align: left; }
  .seat { width: 34px; height: 34px; font-size: 0.8rem; }
  .hall-container { padding: 16px; margin-bottom: 80px; }
  .modal-actions { flex-direction: column; }
  .modal-actions .btn { width: 100%; }
}

@media (max-width: 480px) { 
  h1 { font-size: 1.5rem; } 
  .legend { flex-direction: column; align-items: center; gap: 6px; } 
}