/* ===========================================================
   Co-Working Forms / Schedule Forms — Front-end styles
   =========================================================== */

/* ---- Inline form wrapper (replaces modal — form renders directly on page) ---- */
.cwf-inline-form-wrap {
  border-radius: 20px;
  max-width: 760px;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 600px) {
  .cwf-inline-form-wrap {
    /* padding: 28px 20px 24px; */
  }
}

.cwf-trigger-btn {
  background: #e8521e;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s ease,
    transform 0.1s ease;
}
.cwf-trigger-btn:hover {
  background: #cf4716;
}
.cwf-trigger-btn:active {
  transform: scale(0.98);
}

/* ---- Modal overlay ---- */
.cwf-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 20, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  padding: 20px;
}
.cwf-modal-overlay.is-open {
  display: flex;
}

.cwf-modal {
  background: #eceae3;
  border-radius: 20px;
  max-width: 760px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding: 40px 44px 32px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
}

.cwf-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: rgba(0, 0, 0, 0.08);
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: #2b2b2b;
}
.cwf-modal-close:hover {
  background: rgba(0, 0, 0, 0.15);
}

.cwf-form-heading {
  font-family: "NeutraText", sans-serif !important;
  font-size: 27px;
  font-weight: 500 !important;
  line-height: 33px;
  color: #281d18;
  margin: 0px;
  margin-bottom: 20px;
}

/* ---- Field grid (2 columns like the mockup) ---- */
.cwf-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 24px;
}

.cwf-field {
  display: flex;
  flex-direction: column;
  position: relative;
}
.cwf-field label {
  font-size: 14px;
  font-weight: 600;
  color: #1f1f1f;
  margin-bottom: 8px;
}

.cwf-field input[type="text"],
.cwf-field input[type="tel"],
.cwf-field input[type="email"],
.cwf-field textarea,
.cwf-select-wrap select {
  background: #fff;
  border: 1px solid #d8d5cc;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 15px;
  color: #1f1f1f;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
}
.cwf-field input:focus,
.cwf-field textarea:focus,
.cwf-select-wrap select:focus {
  outline: none;
  border-color: #e8521e;
  box-shadow: 0 0 0 3px rgba(232, 82, 30, 0.12);
}

.cwf-select-wrap {
  position: relative;
}
.cwf-select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 40px;
}
.cwf-select-wrap::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid #1f1f1f;
  transform: translateY(-40%);
  pointer-events: none;
}

/* ---- Date field with calendar icon + popover ---- */
.cwf-date-field {
  position: relative;
}
.cwf-date-field input {
  cursor: pointer;
  background: #fff;
  padding-left: 16px;
  padding-right: 44px;
}
.cwf-date-icon {
  position: absolute;
  left: auto;
  right: 12px;
  top: 25%;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #e8521e;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* =====================================================
   DESKTOP CALENDAR POPOVER (Matches DPBS styling)
   ===================================================== */
.cwf-calendar-popover {
  display: none;
  position: fixed; /* Changed from absolute */
  z-index: 99999999;
  width: 320px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
  padding: 0; /* Reset padding, handle internally */
  overflow: hidden;
  font-family: inherit;
  transform: none;
  -webkit-transform: none;
}
.cwf-calendar-popover.is-open {
  display: block;
}

.cwf-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #f0ede6;
}
.cwf-cal-header .cwf-cal-title {
  font-weight: 700;
  font-size: 15px;
  color: #1f1f1f;
}
.cwf-cal-nav-btn {
  background: #f5f3ed;
  border: none;
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #444;
  transition: background 0.15s ease;
}
.cwf-cal-nav-btn:hover {
  background: #e8e5dc;
}

.cwf-cal-body {
  padding: 12px 16px 16px;
}

/* Separated DOW Row */
.cwf-cal-dow-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
  margin-bottom: 8px;
}
.cwf-cal-dow {
  font-size: 10px;
  font-weight: 800;
  color: #aaa;
  padding: 4px 0;
  text-transform: uppercase;
}
.cwf-cal-dow.is-weekend {
  color: #e8521e;
}

/* Day Grid */
.cwf-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}
.cwf-cal-day {
  position: relative;
  font-size: 13px;
  padding: 8px 0 10px;
  border-radius: 8px;
  cursor: pointer;
  color: #2b2b2b;
  background: none;
  border: none;
  width: 100%;
  transition: background 0.15s ease;
}
.cwf-cal-day:hover:not(.is-disabled):not(.is-empty) {
  background: #f1efe9;
}
.cwf-cal-day.is-empty {
  cursor: default;
  pointer-events: none;
}
.cwf-cal-day.is-weekend {
  color: #e8521e;
}
.cwf-cal-day.is-disabled {
  color: #d4d0c8;
  cursor: not-allowed;
  text-decoration: line-through;
}
.cwf-cal-day.is-selected {
  background: #e8521e;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(232, 82, 30, 0.3);
}
.cwf-cal-day .cwf-dot {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
}
.cwf-cal-day .cwf-dot.cwf-dot-limited {
  background: #3b82f6;
}
.cwf-cal-day .cwf-dot.cwf-dot-full {
  background: #ef4444;
}

/* =====================================================
   MOBILE CALENDAR MODAL (Matches DPBS styling)
   ===================================================== */
.cwf-mobile-modal {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100vh;
  height: 100dvh;
  z-index: 2147483647;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 16px 16px;
  box-sizing: border-box;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu,
    Cantarell, "Helvetica Neue", sans-serif;
}

.cwf-mm-card {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 340px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.cwf-mm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #f0ede6;
}

.cwf-mm-nav {
  background: #f5f3ed;
  border: none;
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #444;
}

.cwf-mm-title {
  font-weight: 700;
  font-size: 15px;
  color: #1f1f1f;
}

.cwf-mm-body {
  padding: 12px 16px 8px;
}

.cwf-mm-dow-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
  margin-bottom: 8px;
}
.cwf-mm-dow {
  font-size: 10px;
  font-weight: 800;
  color: #aaa;
  padding: 4px 0;
}
.cwf-mm-dow.is-weekend {
  color: #e8521e;
}

.cwf-mm-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}

/* Base styles for mobile day divs (JS applies specific colors inline) */
.cwf-mm-day {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  color: #2b2b2b;
}

.cwf-mm-disabled {
  color: #d4d0c8 !important;
  cursor: not-allowed !important;
  text-decoration: line-through;
}

.cwf-mm-selected {
  background: #e8521e !important;
  color: #fff !important;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(232, 82, 30, 0.3);
}

.cwf-mm-footer {
  padding: 8px 16px 16px;
  text-align: center;
}

.cwf-mm-close-btn {
  background: #e8521e;
  color: #fff;
  border: none;
  padding: 12px 32px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.cwf-mm-close-btn:hover {
  background: #cf4716;
}

/* ---- Footer / submit ---- */
.cwf-form-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 30px;
}
.cwf-form-message {
  font-size: 14px;
  flex: 1;
}
.cwf-form-message.is-error {
  color: #c0392b;
}
.cwf-form-message.is-success {
  color: #1c7a3d;
}

.cwf-submit-btn {
  background: #e8521e;
  color: #fff;
  border: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  gap: 6px;
}
.cwf-submit-btn:hover {
  background: #cf4716;
}
.cwf-submit-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

@media (max-width: 768px) {
  .cwf-form-heading {
    font-size: 26px;
  }
}

@media (max-width: 600px) {
  .cwf-form-grid {
    grid-template-columns: 1fr;
  }
  .cwf-modal {
    padding: 28px 20px 24px;
  }
}
