@import url("https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;500;600;700&display=swap");

:root {
  --green: #39bb6e;
  --green-dark: #277f4b;
  --green-light: #e7f7ee;
  --blue: #1974b4;
  --blue-light: #eaf4fb;
  --yellow: #fcbf00;
  --sand: #f6f4ee;
  --sand-dark: #cfcabb;
  --text: #21261f;
  --text-muted: #6b7268;
  --danger: #c0392b;
  --danger-light: #fdecea;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(20, 30, 20, 0.06);
  --shadow-md: 0 8px 24px -8px rgba(20, 40, 20, 0.18);
  --shadow-lg: 0 24px 60px -20px rgba(20, 40, 20, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #eef7f0 0%, var(--sand) 320px, var(--sand) 100%);
}

.page {
  max-width: 520px;
  margin: 0 auto;
  padding: 20px 16px 56px;
}

.header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 4px 24px;
}

.logo {
  width: 76px;
  height: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.08));
}

.header-text h1 {
  font-size: 1.3rem;
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.header-text p {
  margin: 3px 0 0;
  color: var(--green-dark);
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.banner {
  background: linear-gradient(135deg, #fff9e6, #fff3d1);
  border: 1px solid rgba(252, 191, 0, 0.55);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 20px;
  font-size: 0.94rem;
  box-shadow: var(--shadow-sm);
  animation: pop-in 0.25s ease;
}

.banner strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8a6d00;
}

.banner button {
  margin-top: 10px;
}

.hidden {
  display: none !important;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
  background: #fff;
  padding: 5px;
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.tab {
  flex: 1;
  padding: 11px 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  font-weight: 600;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.tab.active {
  background: var(--green);
  color: #fff;
  box-shadow: 0 4px 12px -2px rgba(57, 187, 110, 0.55);
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 2px 12px;
  gap: 12px;
}

.section-heading h2 {
  font-size: 1.02rem;
  margin: 0;
  font-weight: 700;
}

.legend {
  display: flex;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

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

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

.dot-booked {
  background: #b7bcb3;
}

.slots {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.slot {
  position: relative;
  padding: 16px 14px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 84px;
}

.slot .time {
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.slot .time .dash {
  color: var(--text-muted);
  font-weight: 400;
  margin: 0 2px;
  font-size: 0.9rem;
}

.slot-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.slot .status {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.01em;
}

.slot-arrow {
  width: 18px;
  height: 18px;
  color: var(--green);
  opacity: 0.7;
  transition: transform 0.15s ease;
}

.slot.free {
  cursor: pointer;
  border-color: rgba(57, 187, 110, 0.35);
}

.slot.free .status {
  background: var(--green-light);
  color: var(--green-dark);
}

.slot.free:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--green);
}

.slot.free:hover .slot-arrow {
  transform: translateX(3px);
}

.slot.free:active {
  transform: translateY(0);
}

.slot.booked {
  background: #fbfaf7;
}

.slot.booked .status {
  background: #f0efe9;
  color: var(--text-muted);
}

.slot.yours {
  border-color: var(--blue);
  background: var(--blue-light);
  box-shadow: 0 6px 18px -8px rgba(25, 116, 180, 0.4);
}

.slot.yours .status {
  background: var(--blue);
  color: #fff;
}

.slot.past {
  opacity: 0.5;
  background: #f5f4f0;
}

.slot.past .status {
  background: #eceae4;
  color: #9a988f;
}

.hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.83rem;
  margin-top: 24px;
  line-height: 1.5;
  padding: 0 12px;
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 30, 20, 0.5);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 10;
  animation: fade-in 0.18s ease;
}

.modal {
  position: relative;
  background: #fff;
  width: 100%;
  max-width: 480px;
  border-radius: 22px 22px 0 0;
  padding: 28px 24px 28px;
  box-shadow: var(--shadow-lg);
  animation: sheet-in 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (min-width: 520px) {
  .modal-backdrop {
    align-items: center;
  }
  .modal {
    border-radius: 22px;
  }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f2f1ec;
  color: var(--text-muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.modal-close:hover {
  background: #e6e4dc;
}

.modal-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--green-light);
  color: var(--green-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.modal-icon svg {
  width: 24px;
  height: 24px;
}

.modal h2 {
  margin: 0 0 4px;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.modal-subtitle {
  margin: 0 0 20px;
  color: var(--green-dark);
  font-weight: 600;
  font-size: 0.95rem;
}

.field {
  position: relative;
  margin-bottom: 14px;
}

.field input {
  width: 100%;
  padding: 20px 14px 8px;
  border-radius: 12px;
  border: 1.5px solid var(--sand-dark);
  font-size: 1rem;
  font-family: inherit;
  background: #fbfaf7;
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.field input:focus {
  outline: none;
  border-color: var(--green);
  background: #fff;
}

.field label {
  position: absolute;
  left: 15px;
  top: 15px;
  font-size: 1rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: top 0.15s ease, font-size 0.15s ease, color 0.15s ease;
}

.field input:focus + label,
.field input:not(:placeholder-shown) + label {
  top: 7px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--green-dark);
}

.form-error {
  color: var(--danger);
  background: var(--danger-light);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.85rem;
  margin: 4px 0 0;
  animation: pop-in 0.2s ease;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.btn {
  flex: 1;
  padding: 13px 14px;
  border-radius: 12px;
  border: none;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: var(--green);
  color: #fff;
  box-shadow: 0 6px 16px -4px rgba(57, 187, 110, 0.55);
}

.btn-primary:hover {
  background: var(--green-dark);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: #f2f1ec;
  color: var(--text);
}

.btn-secondary:hover {
  background: #e6e4dc;
}

@media (max-width: 380px) {
  .slots {
    grid-template-columns: 1fr;
  }
}

.footer {
  text-align: center;
  margin-top: 32px;
  padding-top: 16px;
}

.footer a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.72rem;
  opacity: 0.55;
  transition: opacity 0.15s ease;
}

.footer a:hover {
  opacity: 0.9;
}

.footer img {
  height: 11px;
  width: auto;
  vertical-align: middle;
}
