/* Global reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #f4f6ff;
  --card-bg: #ffffff;
  --accent: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.12);
  --accent-strong: rgba(37, 99, 235, 0.18);
  --border-subtle: rgba(148, 163, 184, 0.5);
  --text-main: #0b1f4b;
  --text-muted: #64748b;
  --danger: #dc2626;
  --success: #15803d;
}

/* Scope to plugin wrapper so it doesn't affect theme */
.abc-page {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #e0e7ff 0, #eef2ff 40%, #ffffff 100%);
  color: var(--text-main);
  padding: 24px 16px;
}

/* Main card */
.abc-page .app-card {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  background: linear-gradient(145deg, #ffffff, #f9fbff);
  border-radius: 24px;
  border: 1px solid var(--border-subtle);
  box-shadow:
    0 18px 35px rgba(15, 23, 42, 0.08),
    0 0 0 1px rgba(148, 163, 184, 0.25);
  padding: 22px 26px 26px;
}

/* Header */
.abc-page .app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.abc-page .app-title-block {
  display: flex;
  gap: 14px;
  align-items: center;
}

.abc-page .logo-circle {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #facc15, #f97316);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.abc-page h1 {
  font-size: 1.6rem;
  margin: 0;
  color: var(--text-main);
}

.abc-page .subtitle {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Layout */
.abc-page .layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 22px;
  align-items: flex-start;
}

@media (max-width: 900px) {
  .abc-page .layout {
    grid-template-columns: 1fr;
  }
}

.abc-page .section-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--text-main);
}

/* Cards */
.abc-page .calendar-card,
.abc-page .panel,
.abc-page .form {
  background: var(--card-bg);
  border-radius: 18px;
  border: 1px solid var(--border-subtle);
  padding: 14px 14px 16px;
}

/* Calendar */
.abc-page .calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.abc-page .month-label {
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-main);
}

.abc-page .icon-btn {
  border: none;
  background: #eef2ff;
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--text-main);
  border: 1px solid rgba(148, 163, 184, 0.7);
  font-size: 1rem;
}

.abc-page .icon-btn:hover {
  background: #e0e7ff;
}

.abc-page .calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  font-size: 0.75rem;
  text-align: center;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.abc-page .calendar-weekdays span {
  padding: 4px 0;
}

.abc-page .calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 6px;
}

.abc-page .calendar-day {
  position: relative;
  border-radius: 10px;
  padding: 6px 0;
  text-align: center;
  font-size: 0.8rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, transform 0.08s;
  min-height: 34px;
  background: #f8fafc;
  color: var(--text-main);
}

.abc-page .calendar-day span {
  position: relative;
  z-index: 1;
}

.abc-page .calendar-day.empty {
  cursor: default;
  background: transparent;
}

/* 🔴 Disabled dates: past, non-working or fully booked */
.abc-page .calendar-day.disabled {
  cursor: not-allowed;
  color: var(--danger);
  background: #fee2e2;
  border-color: #fecaca;
}

/* Working selectable days */
.abc-page .calendar-day.working {
  background: #eff6ff;
  border-color: #dbeafe;
}

.abc-page .calendar-day.working:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* Selected date */
.abc-page .calendar-day.selected {
  background: var(--accent-strong);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft),
              0 8px 18px rgba(15, 23, 42, 0.15);
}

/* Today marker */
.abc-page .calendar-day.today::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--success);
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
}

.abc-page .calendar-hint {
  margin: 4px 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Slots panel */
.abc-page .panel {
  margin-top: 12px;
}

.abc-page .panel-title {
  font-size: 0.95rem;
  margin: 0 0 6px;
  color: var(--text-main);
}

.abc-page #slots fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

.abc-page .slot-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.abc-page .slot-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.08s;
  color: var(--text-main);
}

.abc-page .slot-badge input {
  display: none;
}

.abc-page .slot-badge span.time {
  font-variant-numeric: tabular-nums;
}

.abc-page .slot-badge span.duration {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.abc-page .slot-badge:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.abc-page .slot-badge.selected {
  background: var(--accent-strong);
  border-color: var(--accent);
}

.abc-page .hint,
.abc-page .no-slots {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===== Form & inputs (including PHONE + ADDRESS) ===== */

.abc-page .form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.abc-page .form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Labels */
.abc-page label,
.abc-page .label-block {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main);
}

/* TEXT, EMAIL, TEL share same style */
.abc-page input[type="text"],
.abc-page input[type="email"],
.abc-page input[type="tel"] {
  width: 100%;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.8);
  background: #f9fafb;
  color: var(--text-main);
  font-size: 0.9rem;
  transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
}

.abc-page input[type="text"]::placeholder,
.abc-page input[type="email"]::placeholder,
.abc-page input[type="tel"]::placeholder {
  color: #94a3b8;
}

/* Address textarea styled to match inputs */
.abc-page textarea {
  width: 100%;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.8);
  background: #f9fafb;
  color: var(--text-main);
  font-size: 0.9rem;
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
}

.abc-page textarea::placeholder {
  color: #94a3b8;
}

/* Focus state for all inputs & textarea */
.abc-page input[type="text"]:focus,
.abc-page input[type="email"]:focus,
.abc-page input[type="tel"]:focus,
.abc-page textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #ffffff;
  box-shadow: 0 0 0 1px var(--accent-soft);
}

/* Chips for services */
.abc-page .chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.abc-page .chip {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  background: #f8fafc;
  color: var(--text-main);
}

.abc-page .chip input {
  accent-color: var(--accent);
}

.abc-page .chip:hover {
  border-color: var(--accent);
}

/* Note */
.abc-page .form-note {
  font-size: 0.78rem;
  background: #eff6ff;
  border-radius: 12px;
  border: 1px dashed rgba(148, 163, 184, 0.9);
  padding: 8px 10px;
  color: var(--text-muted);
}

/* Button */
.abc-page .btn-primary {
  margin-top: 4px;
  border: none;
  padding: 10px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #f9fafb;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow:
    0 10px 25px rgba(37, 99, 235, 0.35),
    0 0 0 1px rgba(148, 163, 184, 0.3);
  align-self: flex-start;
  transition: transform 0.1s, box-shadow 0.1s, filter 0.1s;
}

.abc-page .btn-primary:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

/* Status messages */
.abc-page .status {
  margin-top: 8px;
  min-height: 20px;
  font-size: 0.85rem;
}

.abc-page .status.success {
  color: var(--success);
}

.abc-page .status.error {
  color: var(--danger);
}
