/* SPDX-License-Identifier: AGPL-3.0-only */

:root {
  --color-text: #1a1a1a;
  --color-bg: #ffffff;
  --color-primary: #1a73e8;
  --color-primary-light: #e8f0fe;
  --color-surface: #f8f9fa;
  --color-border: #e0e0e0;
  --color-secondary: #5f6368;
  --color-error: #c5221f;
  --color-success: #137333;
  --shadow-soft: 0 10px 30px rgba(26, 26, 26, 0.06);
  --shadow-focus: 0 0 0 3px rgba(26, 115, 232, 0.2);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

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

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

a:hover {
  text-decoration: underline;
}

button,
input,
textarea,
select {
  font: inherit;
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.header {
  margin-bottom: 28px;
}

.header h1 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header p {
  margin: 6px 0 0;
  font-size: 2rem;
  line-height: 1.15;
  font-weight: 600;
}

.intro,
.confirmation,
.error-card,
.fallback-message {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.intro,
.error-card,
.fallback-message {
  padding: 24px;
}

.layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.calendar-panel,
.detail-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.calendar-panel {
  flex: 1 1 54%;
  padding: 20px;
}

.detail-panel {
  flex: 1 1 46%;
  padding: 20px;
}

.calendar {
  display: block;
}

.calendar-nav {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.calendar-nav h2 {
  margin: 0;
  font-size: 1.1rem;
  text-align: center;
}

.calendar-nav a,
.calendar-nav button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  text-decoration: none;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-header {
  min-height: 32px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-empty {
  min-height: 44px;
}

.calendar-day,
.slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
  font-weight: 500;
  text-decoration: none;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.calendar-day.available:hover,
.slot:hover,
.btn:hover {
  text-decoration: none;
}

.calendar-day.available:hover,
.slot:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.calendar-day.today {
  box-shadow: inset 0 0 0 2px rgba(26, 115, 232, 0.3);
}

.calendar-day.selected,
.slot.selected {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-bg);
}

.calendar-day.disabled {
  background: #f1f3f4;
  border-color: #ededed;
  color: #9aa0a6;
  cursor: default;
}

.calendar-day.available {
  cursor: pointer;
}

.detail-panel h2,
.detail-panel h3,
.confirmation h2,
.error-card h2,
.fallback-message h2 {
  margin-top: 0;
}

.slots {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.slots[hidden],
.booking-form[hidden],
.tz-selector[hidden],
.error-message[hidden],
.loading[hidden] {
  display: none;
}

.slot {
  cursor: pointer;
}

.booking-form {
  margin-top: 18px;
}

.booking-form .turnstile-wrap {
  margin: 18px 0 0;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.form-group input,
.form-group textarea,
.tz-selector {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
}

.form-group textarea {
  min-height: 110px;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus,
.tz-selector:focus,
.btn:focus,
.calendar-day:focus,
.slot:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
}

.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--color-primary);
  color: var(--color-bg);
  font-weight: 600;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.btn.secondary {
  background: var(--color-bg);
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}

.muted,
.summary,
.tz-display,
.timezone-note,
.field-note {
  color: var(--color-secondary);
}

.tz-display {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 18px;
}

.tz-selector {
  margin-bottom: 18px;
}

.loading {
  margin: 14px 0;
  color: var(--color-secondary);
}

.loading::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  border: 2px solid var(--color-primary-light);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  vertical-align: -2px;
  animation: spin 0.8s linear infinite;
}

.error-message {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid rgba(217, 48, 37, 0.2);
  border-radius: var(--radius-sm);
  background: rgba(217, 48, 37, 0.08);
  color: var(--color-error);
}

.fallback-message {
  padding: 28px;
}

.confirmation {
  padding: 28px;
}

.confirmation .meeting-details {
  margin: 18px 0;
  padding: 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
}

.confirmation .meeting-details dl {
  margin: 0;
}

.confirmation .meeting-details dt {
  font-weight: 600;
}

.confirmation .meeting-details dd {
  margin: 0 0 12px;
  color: var(--color-secondary);
}

.confirmation .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.success-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(30, 142, 62, 0.12);
  color: var(--color-success);
  font-weight: 600;
}

.confirmation .actions a {
  text-decoration: none;
}

.confirmation .actions a.btn.secondary {
  background: var(--color-bg);
}

.error-card p:last-child,
.fallback-message p:last-child,
.intro p:last-child {
  margin-bottom: 0;
}

.panel-title {
  margin: 0 0 10px;
  font-size: 1.125rem;
}

.slot-group-title {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: var(--color-secondary);
}

.summary {
  margin: 0 0 18px;
}

.empty-state {
  padding: 14px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-secondary);
  background: var(--color-bg);
}

.detail-stack > * + * {
  margin-top: 18px;
}

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

@media (max-width: 768px) {
  .page {
    padding: 24px 16px 40px;
  }

  .header p {
    font-size: 1.7rem;
  }

  .layout {
    flex-direction: column;
  }

  .calendar-panel,
  .detail-panel {
    width: 100%;
  }

  .calendar-grid {
    gap: 6px;
  }

  .calendar-day,
  .slot,
  .calendar-nav a,
  .calendar-nav button,
  .btn {
    min-height: 46px;
  }

  .confirmation .actions {
    flex-direction: column;
  }

  .confirmation .actions .btn {
    width: 100%;
  }
}

.trust-strip {
  font-size: 0.8125rem;
  color: #666;
  text-align: center;
  margin-top: 1rem;
  line-height: 1.5;
}

.trust-strip a {
  color: #555;
  text-decoration: underline;
}

/* Landing page */
.landing {
  max-width: 640px;
  margin: 0 auto;
}

.landing-intro {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--text-secondary, #555);
}

.type-cards {
  display: grid;
  gap: 1rem;
}

.type-card {
  display: block;
  padding: 1.5rem;
  border: 1px solid var(--border, #ddd);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.type-card:hover {
  border-color: var(--accent, #2563eb);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.type-card h2 {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
}

.type-duration {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary, #555);
  font-weight: 500;
}

.type-description {
  margin: 0;
  color: var(--text-secondary, #555);
}
