/* Echo Booking Widget — vanilla CSS, scoped zu .ew-* */

.ew-root {
  --ew-primary: #1a1a1a;
  --ew-accent: #c9a86a;
  --ew-accent-hover: #b8975b;
  --ew-free: #3d9970;
  --ew-option: #ffb347;
  --ew-booked: #c74d4d;
  --ew-border: #e5e5e5;
  --ew-bg: #ffffff;
  --ew-muted: #6c6c6c;
  --ew-text: #1a1a1a;
  --ew-error: #c74d4d;
  --ew-success: #3d9970;

  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  color: var(--ew-text);
  background: var(--ew-bg);
  max-width: 720px;
  margin: 0 auto;
  border: 1px solid var(--ew-border);
  border-radius: 12px;
  padding: 24px;
  box-sizing: border-box;
  line-height: 1.4;
}

.ew-root *,
.ew-root *::before,
.ew-root *::after {
  box-sizing: border-box;
}

.ew-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--ew-border);
  padding-bottom: 12px;
}

.ew-title {
  font-size: 20px;
  font-weight: 600;
}

.ew-location-pill {
  background: var(--ew-primary);
  color: #fff;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

.ew-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--ew-border);
  margin-bottom: 20px;
}

.ew-tab {
  padding: 10px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 14px;
  color: var(--ew-muted);
  font-family: inherit;
  transition: color 0.15s, border-color 0.15s;
}

.ew-tab:hover {
  color: var(--ew-text);
}

.ew-tab-active {
  color: var(--ew-text);
  border-bottom-color: var(--ew-accent);
  font-weight: 600;
}

.ew-panel {
  display: none;
}

.ew-panel-active {
  display: block;
}

.ew-hint {
  font-size: 13px;
  color: var(--ew-muted);
  margin-bottom: 16px;
}

/* === Calendar === */

.ew-calendar-container {
  margin-bottom: 20px;
}

.ew-calendar-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.ew-calendar-nav button {
  background: none;
  border: 1px solid var(--ew-border);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.ew-calendar-nav button:hover {
  background: #f5f5f5;
}

.ew-calendar-nav button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

#ew-month-label {
  font-size: 16px;
  font-weight: 600;
}

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

.ew-weekday {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--ew-muted);
  padding: 4px 0;
  text-transform: uppercase;
}

.ew-day {
  aspect-ratio: 1;
  border: 1px solid var(--ew-border);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.ew-day:hover {
  border-color: var(--ew-accent);
}

.ew-day-empty {
  border: none;
  cursor: default;
}

.ew-day-empty:hover {
  border: none;
}

.ew-day-past {
  color: #ccc;
  cursor: not-allowed;
}

.ew-day-past:hover {
  border-color: var(--ew-border);
}

.ew-day-free .ew-day-dot {
  background: var(--ew-free);
}

.ew-day-option .ew-day-dot {
  background: var(--ew-option);
}

.ew-day-booked {
  color: var(--ew-muted);
}

.ew-day-booked .ew-day-dot {
  background: var(--ew-booked);
}

.ew-day-booked {
  opacity: 0.5;
  cursor: not-allowed;
}

.ew-day-weekend {
  color: #aaa;
  cursor: not-allowed;
}

.ew-day-weekend:hover {
  border-color: var(--ew-border);
}

.ew-day-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-top: 3px;
}

.ew-day-selected {
  background: var(--ew-accent);
  color: white;
  border-color: var(--ew-accent);
}

.ew-legend {
  display: flex;
  gap: 16px;
  font-size: 11px;
  color: var(--ew-muted);
  margin-top: 12px;
  justify-content: center;
}

.ew-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ew-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.ew-dot-free { background: var(--ew-free); }
.ew-dot-option { background: var(--ew-option); }
.ew-dot-booked { background: var(--ew-booked); }

/* === Slots === */

.ew-slots-container {
  border: 1px solid var(--ew-border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
  background: #fafafa;
}

.ew-slots-header {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}

.ew-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}

.ew-slot {
  padding: 10px;
  background: #fff;
  border: 1px solid var(--ew-border);
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.15s;
}

.ew-slot:hover:not(:disabled) {
  border-color: var(--ew-accent);
  background: #fff9ee;
}

.ew-slot:disabled {
  color: #ccc;
  cursor: not-allowed;
  text-decoration: line-through;
}

/* === Form === */

.ew-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ew-form-header {
  font-size: 14px;
  font-weight: 600;
  padding: 10px 14px;
  background: #f0f7f4;
  border-radius: 6px;
}

.ew-form label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: var(--ew-muted);
  gap: 4px;
}

.ew-form input[type="text"],
.ew-form input[type="email"],
.ew-form input[type="tel"],
.ew-form input[type="date"],
.ew-form input[type="number"],
.ew-form select,
.ew-form textarea {
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid var(--ew-border);
  border-radius: 6px;
  font-family: inherit;
  color: var(--ew-text);
  background: #fff;
  width: 100%;
}

.ew-form input:focus,
.ew-form select:focus,
.ew-form textarea:focus {
  outline: none;
  border-color: var(--ew-accent);
}

.ew-form textarea {
  resize: vertical;
  min-height: 80px;
}

.ew-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 500px) {
  .ew-row { grid-template-columns: 1fr; }
}

.ew-consent {
  flex-direction: row !important;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--ew-muted);
  line-height: 1.4;
}

.ew-consent input {
  margin-top: 2px;
  flex-shrink: 0;
}

.ew-consent a {
  color: var(--ew-accent);
  text-decoration: underline;
}

/* Honeypot — visually hidden, but available to bots that scan DOM */
.ew-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.ew-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}

.ew-submit,
.ew-back {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.ew-submit {
  background: var(--ew-primary);
  color: #fff;
}

.ew-submit:hover:not(:disabled) {
  background: #000;
}

.ew-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ew-back {
  background: transparent;
  color: var(--ew-muted);
  border: 1px solid var(--ew-border);
}

.ew-back:hover {
  background: #f5f5f5;
}

/* === Status === */

.ew-status {
  margin: 16px 0;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  display: none;
}

.ew-status-success {
  display: block;
  background: #e8f5ee;
  color: var(--ew-success);
  border: 1px solid #c3e4d1;
}

.ew-status-error {
  display: block;
  background: #fbe9e9;
  color: var(--ew-error);
  border: 1px solid #f1c7c7;
}

.ew-status-loading {
  display: block;
  background: #f5f5f5;
  color: var(--ew-muted);
  border: 1px solid var(--ew-border);
}

.ew-footer {
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid var(--ew-border);
  text-align: center;
  font-size: 11px;
  color: var(--ew-muted);
}

.ew-footer a {
  color: var(--ew-muted);
  text-decoration: underline;
}
