*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #0069ff;
  --primary-dark: #0052cc;
  --bg: #f5f6f7;
  --card: #ffffff;
  --text: #1a1a2e;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --danger: #ef4444;
  --success: #22c55e;
  --radius: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }

/* Layout */
.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }
.header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  position: sticky; top: 0; z-index: 100;
}
.header .container { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.4rem; font-weight: 700; color: var(--primary); text-decoration: none; }
.logo-img { height: 32px; width: auto; display: block; }
.header nav { display: flex; gap: 16px; align-items: center; }
.header nav a { color: var(--text-light); font-size: 0.9rem; font-weight: 500; }
.header nav a:hover { color: var(--primary); }

/* Buttons */
.btn {
  display: inline-block; padding: 10px 20px; border-radius: var(--radius);
  font-size: 0.9rem; font-weight: 600; cursor: pointer; border: none;
  transition: all 0.15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.9; }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 4px; font-weight: 500; font-size: 0.9rem; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 0.9rem; font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,105,255,0.1);
}

/* Cards */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.card + .card { margin-top: 16px; }

/* Auth pages */
.auth-page {
  display: flex; justify-content: center; align-items: center;
  min-height: 80vh;
}
.auth-box { width: 100%; max-width: 400px; }
.auth-box h2 { margin-bottom: 24px; text-align: center; }

/* Dashboard */
.page-title {
  display: flex; justify-content: space-between; align-items: center;
  margin: 32px 0 20px;
}
.page-title h2 { font-size: 1.5rem; }

/* Event type cards */
.event-card {
  display: flex; align-items: center; gap: 16px;
  padding: 20px; cursor: pointer; transition: box-shadow 0.15s;
}
.event-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.event-color { width: 4px; height: 48px; border-radius: 4px; flex-shrink: 0; }
.event-info { flex: 1; }
.event-info h3 { font-size: 1rem; margin-bottom: 2px; }
.event-info p { font-size: 0.85rem; color: var(--text-light); }
.event-actions { display: flex; gap: 8px; }
.copy-link { font-size: 0.8rem; color: var(--primary); cursor: pointer; background: none; border: none; font-weight: 500; }
.copy-link:hover { text-decoration: underline; }

/* Booking page */
.booking-page { max-width: 720px; margin: 40px auto; }
.booking-page .user-header { text-align: center; margin-bottom: 32px; }
.booking-page .user-header h2 { font-size: 1.3rem; color: var(--text-light); font-weight: 400; }
.booking-page .user-header h1 { font-size: 1.1rem; margin-top: 4px; }

.event-list { display: grid; gap: 12px; }
.event-pick {
  display: block; padding: 20px; border-left: 4px solid var(--primary);
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border); cursor: pointer; transition: box-shadow 0.15s;
}
.event-pick:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.event-pick h3 { color: var(--primary); margin-bottom: 4px; }
.event-pick p { font-size: 0.85rem; color: var(--text-light); }

/* Calendar */
.scheduler { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 600px) { .scheduler { grid-template-columns: 1fr; } }

.calendar { user-select: none; }
.cal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.cal-header h3 { font-size: 1rem; }
.cal-nav { background: none; border: none; font-size: 1.2rem; cursor: pointer; padding: 4px 8px; color: var(--text); }
.cal-nav:hover { color: var(--primary); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal-grid .day-label { font-size: 0.75rem; color: var(--text-light); padding: 4px; font-weight: 600; }
.cal-grid .day {
  padding: 8px 4px; border-radius: 50%; font-size: 0.85rem; cursor: pointer;
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
}
.cal-grid .day:hover { background: #e8f0fe; }
.cal-grid .day.disabled { color: #ccc; cursor: default; }
.cal-grid .day.disabled:hover { background: transparent; }
.cal-grid .day.selected { background: var(--primary); color: #fff; }
.cal-grid .day.today { border: 1px solid var(--primary); }

.time-slots { }
.time-slot {
  display: block; width: 100%; padding: 10px; margin-bottom: 6px;
  border: 1px solid var(--primary); border-radius: var(--radius);
  background: #fff; color: var(--primary); font-weight: 600;
  cursor: pointer; text-align: center; font-size: 0.9rem;
}
.time-slot:hover { background: var(--primary); color: #fff; }
.time-slot.selected { background: var(--primary); color: #fff; }

.no-slots { text-align: center; color: var(--text-light); padding: 40px 0; font-size: 0.9rem; }

/* Booking confirmation */
.confirm-box { margin-top: 20px; }
.confirm-box .summary { background: #f0f7ff; padding: 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 0.9rem; }

.host-quote { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); }
.host-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; margin-bottom: 12px; }
.host-quote blockquote { font-style: italic; color: var(--text-light); font-size: 0.95rem; margin-bottom: 8px; }
.host-name { font-weight: 600; font-size: 0.9rem; }

/* Bookings list */
.booking-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px;
}
.booking-item .meta { font-size: 0.85rem; color: var(--text-light); }
.booking-item .time { font-weight: 600; }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 12px;
  font-size: 0.75rem; font-weight: 600;
}
.badge-confirmed { background: #dcfce7; color: #166534; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }

/* Availability */
.avail-card { padding: 0; overflow: hidden; }
.avail-grid { }
.avail-row {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.avail-row:last-child { border-bottom: none; }
.avail-row:not(.active) { opacity: 0.55; }
.avail-row.active { background: #f8fffe; }
.avail-day { font-weight: 600; width: 110px; font-size: 0.95rem; }
.avail-times { display: flex; align-items: center; gap: 8px; flex: 1; }
.avail-times.disabled input { opacity: 0.4; }
.avail-times input[type="time"] {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 0.9rem; background: var(--card); color: var(--text);
  transition: border-color 0.15s;
}
.avail-times input[type="time"]:focus { border-color: var(--primary); outline: none; }
.avail-sep { color: var(--text-light); font-size: 0.9rem; }
.avail-status {
  font-size: 0.8rem; font-weight: 500; min-width: 80px; text-align: right;
  color: var(--text-light);
}
.avail-row.active .avail-status { color: var(--success); }

/* Toggle switch */
.avail-toggle { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.avail-toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #d1d5db; border-radius: 24px; transition: background 0.2s;
}
.toggle-slider::before {
  content: ''; position: absolute; height: 18px; width: 18px;
  left: 3px; bottom: 3px; background: white; border-radius: 50%;
  transition: transform 0.2s;
}
.avail-toggle input:checked + .toggle-slider { background: var(--primary); }
.avail-toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

@media (max-width: 600px) {
  .avail-row { flex-wrap: wrap; gap: 10px; padding: 14px 16px; }
  .avail-day { width: 80px; }
  .avail-status { display: none; }
}

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; justify-content: center; align-items: center; z-index: 200;
}
.modal { background: var(--card); border-radius: var(--radius); padding: 32px; width: 100%; max-width: 440px; }
.modal h3 { margin-bottom: 20px; }

/* Toast */
.toast {
  position: fixed; bottom: 20px; right: 20px; background: #333; color: #fff;
  padding: 12px 20px; border-radius: var(--radius); font-size: 0.9rem;
  z-index: 300; animation: slideIn 0.3s;
}
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } }

/* Validation */
.field-error { display: block; color: var(--danger); font-size: 0.8rem; margin-top: 4px; min-height: 1.1em; }
.input-error { border-color: var(--danger) !important; }
.input-error:focus { box-shadow: 0 0 0 3px rgba(239,68,68,0.15) !important; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Pricing */
.pricing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 600px) { .pricing-grid { grid-template-columns: 1fr; } }
.pricing-card { text-align: center; padding: 32px 24px; position: relative; transition: box-shadow 0.15s; }
.pricing-card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.pricing-price { font-size: 2.5rem; font-weight: 700; margin-bottom: 24px; }
.pricing-price span { font-size: 1rem; font-weight: 400; color: var(--text-light); }
.pricing-features { list-style: none; text-align: left; margin-bottom: 24px; }
.pricing-features li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.pricing-features li::before { content: '\2713'; color: var(--success); font-weight: 700; margin-right: 8px; }
.pricing-footer { margin-top: auto; }
.pricing-highlight { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.pricing-current { background: #f8fffe; }
.usage-bar { height: 6px; background: var(--border); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.usage-fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width 0.3s; }

/* Utility */
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.text-center { text-align: center; }
.text-light { color: var(--text-light); }
.hidden { display: none !important; }
