/* ========================================
   OVO Talent Booking Page
   Premium dark theme with cyan accent
   ======================================== */

:root {
  --page-bg: #141414;
  --card-bg: #212121;
  --input-bg: #303030;
  --border: #424242;
  --text-primary: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.733);
  --text-button: #111928;
  --accent: #00D4FF;
  --error: #ef4444;
  --valid: #22c55e;
  --placeholder: rgba(255, 255, 255, 0.4);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---- Reset ---- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--page-bg);
  color: var(--text-primary);
  min-height: 100vh;
}

a {
  color: inherit;
}

button {
  font-family: var(--font);
  cursor: pointer;
  border: none;
  background: none;
}

input {
  font-family: var(--font);
  outline: none;
  border: none;
  background: none;
}

/* ---- Page layout ---- */
.page {
  display: flex;
  justify-content: center;
  padding: 56px 20px 40px;
  min-height: 100vh;
}

/* ---- Card ---- */
.card {
  width: 100%;
  max-width: 811px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-self: flex-start;
}

/* ---- Progress bar ---- */
.progress-bar {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-step .dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: var(--border);
  flex-shrink: 0;
  transition: background 0.3s ease;
}

.progress-step.active .dot {
  background: var(--accent);
}

.progress-step .step-label {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-primary);
  white-space: nowrap;
}

/* ---- Content area ---- */
.content {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* ---- Form panel ---- */
.form-panel {
  flex: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  min-width: 0;
}

.form-title {
  font-size: 20px;
  font-weight: 600;
  line-height: 24px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.form-subtitle {
  font-size: 14px;
  font-weight: 400;
  line-height: 17.5px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

/* ---- Social proof ---- */
.social-proof {
  height: 20px;
  margin-bottom: 16px;
  overflow: hidden;
  position: relative;
}

.social-proof-text {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  display: block;
  animation: fadeInOut 0.5s ease;
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ---- Form ---- */
#bookingForm {
  display: flex;
  flex-direction: column;
  flex: 1;
}

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

.stage.hidden {
  display: none;
}

/* Stage 2 reveal animation */
.stage-2.revealing {
  display: flex;
  animation: slideDown 0.35s ease forwards;
}

@keyframes slideDown {
  0% {
    opacity: 0;
    transform: translateY(-12px);
    max-height: 0;
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    max-height: 500px;
  }
}

/* ---- Field group ---- */
.field-group {
  display: flex;
  flex-direction: column;
  position: relative;
}

.field-label {
  display: none; /* Labels removed - using placeholder text only (matches iClosed) */
}

.field-label-inline {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.field-group input,
.field-group .iti {
  width: 100%;
}

.field-group input {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  height: 40px;
  padding: 0 36px 0 12px;
  font-size: 14px;
  color: var(--text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field-group input::placeholder {
  color: var(--placeholder);
}

.field-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.4);
  outline: none;
}

/* ---- Phone highlight pulse on load (draws attention to first field) ---- */
@keyframes highlight-pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 212, 255, 0); border-color: var(--border); }
  30% { box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.35); border-color: var(--accent); }
  70% { box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.35); border-color: var(--accent); }
  100% { box-shadow: 0 0 0 0 rgba(0, 212, 255, 0); border-color: var(--border); }
}

.phone-highlight .iti input,
.phone-highlight input[type="tel"] {
  animation: highlight-pulse 2s ease-in-out 1s 2; /* 2 pulses, starts after 1s delay */
}

.field-group input.invalid {
  border-color: var(--error);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
}

.field-group input.valid {
  border-color: var(--valid);
}

/* Field error */
.field-error {
  font-size: 12px;
  color: var(--error);
  margin-top: 4px;
  min-height: 0;
  overflow: hidden;
  transition: all 0.2s ease;
}

.field-error.show {
  min-height: 16px;
}

/* Field valid checkmark */
.field-valid {
  position: absolute;
  right: 10px;
  top: 33px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.field-valid.show {
  opacity: 1;
}

/* ---- Name row ---- */
.name-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ---- Phone: intl-tel-input overrides ---- */
.phone-wrap {
  position: relative;
}

.phone-wrap .iti {
  width: 100%;
}

.phone-wrap .iti__selected-flag {
  background: transparent;
  border-right: 1px solid var(--border);
  padding: 0 8px;
}

.phone-wrap .iti__selected-flag:hover,
.phone-wrap .iti__selected-flag:focus {
  background: rgba(255, 255, 255, 0.05);
}

.phone-wrap .iti__arrow {
  border-top-color: rgba(255, 255, 255, 0.6);
}

.phone-wrap .iti__arrow--up {
  border-bottom-color: rgba(255, 255, 255, 0.6);
}

/* Style the intl-tel-input phone field specifically */
.phone-wrap input.iti__tel-input,
.phone-wrap .iti input {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  height: 40px;
  font-size: 14px;
  color: var(--text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}

.phone-wrap input.iti__tel-input::placeholder,
.phone-wrap .iti input::placeholder {
  color: var(--placeholder);
}

.phone-wrap input.iti__tel-input:focus,
.phone-wrap .iti input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.4);
}

/* Dropdown styling */
.iti__dropdown-content {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 220px;
}

.iti__search-input {
  background: var(--input-bg) !important;
  color: var(--text-primary) !important;
  border-color: var(--border) !important;
}

.iti__country-list {
  background: var(--card-bg);
}

.iti__country {
  padding: 6px 12px;
  color: var(--text-primary);
}

.iti__country:hover,
.iti__country--highlight {
  background: rgba(255, 255, 255, 0.08);
}

.iti__divider {
  border-color: var(--border);
}

.iti__dial-code {
  color: var(--text-secondary);
}

/* Phone valid checkmark needs different positioning because of intl-tel-input wrapper */
.phone-wrap ~ .field-valid {
  right: 10px;
  top: 13px;
}

/* Fix valid/error icon positions - no labels so shift up */
.field-valid {
  top: 13px !important;
}
.field-error {
  margin-top: 2px;
}

/* ---- Continue button ---- */
.btn-continue {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 44px;
  background: var(--accent);
  color: var(--text-button);
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  margin-top: 4px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

/* Shimmer sweep on hover */
.btn-continue::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transition: left 0.5s ease;
}

.btn-continue:hover:not(:disabled)::after {
  left: 100%;
}

.btn-continue:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 212, 255, 0.4);
  filter: brightness(1.08);
}

.btn-continue:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 212, 255, 0.3);
}

.btn-continue:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Chevron nudge on hover */
.btn-continue svg {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.btn-continue:hover:not(:disabled) svg {
  transform: translateX(3px);
}

/* Subtle glow pulse when button is enabled (draws eye) */
@keyframes btn-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 212, 255, 0); }
  50% { box-shadow: 0 0 12px 2px rgba(0, 212, 255, 0.3); }
}

.btn-continue:not(:disabled) {
  animation: btn-glow 2.5s ease-in-out infinite;
}

.btn-continue:hover:not(:disabled) {
  animation: none;
}

/* ---- Consent text ---- */
.consent-text {
  font-size: 12px;
  color: var(--text-primary);
  line-height: 1.5;
  margin-top: 12px;
}

.consent-link {
  text-decoration: underline;
  font-weight: 600;
}

.consent-link:hover {
  color: var(--accent);
}

/* ---- Calendar panel ---- */
.calendar-panel {
  flex: 1;
  padding: 24px;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Gate overlay */
.calendar-gate {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(33, 33, 33, 0.85);
  border-radius: 0 8px 8px 0;
  backdrop-filter: blur(2px);
  transition: opacity 0.3s ease;
}

.calendar-gate.hidden {
  opacity: 0;
  pointer-events: none;
}

.gate-tooltip {
  background: var(--input-bg);
  color: var(--text-secondary);
  font-size: 13px;
  padding: 12px 18px;
  border-radius: 8px;
  text-align: center;
  max-width: 240px;
  line-height: 1.4;
  border: 1px solid var(--border);
}

/* Calendar header */
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.cal-month-label {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
}

.cal-nav {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.cal-nav:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Day headers */
.cal-day-headers {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 4px;
}

.cal-day-headers span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 4px 0;
}

/* Day grid */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  justify-items: center;
}

.cal-day {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 400;
  color: var(--text-primary);
  cursor: default;
  transition: background 0.15s ease;
  user-select: none;
}

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

.cal-day.available:hover {
  background: rgba(255, 255, 255, 0.1);
}

.cal-day.selected {
  background: var(--accent);
  color: var(--text-button);
  font-weight: 500;
}

.cal-day.unavailable {
  opacity: 0.3;
}

.cal-day.other-month {
  opacity: 0;
  pointer-events: none;
}

/* ---- Time slots ---- */
.time-slots {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.time-slots.hidden {
  display: none;
}

.time-slots-header {
  margin-bottom: 4px;
}

.time-slots-date {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.time-slots-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 160px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Custom scrollbar */
.time-slots-list::-webkit-scrollbar {
  width: 4px;
}

.time-slots-list::-webkit-scrollbar-track {
  background: transparent;
}

.time-slots-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.time-slot {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 400;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
  cursor: pointer;
  white-space: nowrap;
}

.time-slot:hover {
  border-color: var(--accent);
}

.time-slot.selected {
  background: var(--accent);
  color: var(--text-button);
  border-color: var(--accent);
  font-weight: 500;
}

.timezone-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.btn-book {
  margin-top: 8px;
}

.btn-book.hidden {
  display: none;
}

/* ---- Footer ---- */
.card-footer {
  padding: 12px 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  color: var(--text-primary);
}

.card-footer strong {
  font-weight: 600;
}

/* ---- Confirmation card ---- */
.confirmation-card {
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 400px;
}

.confirmation-card.hidden {
  display: none;
}

.confirmation-inner {
  padding: 48px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Checkmark animation */
.check-anim {
  margin-bottom: 24px;
}

.check-circle {
  stroke-dasharray: 214;
  stroke-dashoffset: 214;
  animation: drawCircle 0.6s ease forwards;
}

.check-path {
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  animation: drawCheck 0.4s ease 0.4s forwards;
}

@keyframes drawCircle {
  to { stroke-dashoffset: 0; }
}

@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}

.confirm-heading {
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.confirm-detail {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.5;
}

.confirm-sub {
  font-size: 14px;
  color: var(--placeholder);
}

/* ========================================
   RESPONSIVE
   ======================================== */

/* Tablet: stack form/calendar vertically */
@media (max-width: 900px) {
  .content {
    flex-direction: column;
  }

  .form-panel {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .calendar-panel {
    padding-top: 20px;
  }

  .calendar-gate {
    border-radius: 0 0 8px 8px;
  }
}

/* Mobile: full-width, no card border */
@media (max-width: 520px) {
  .page {
    padding: 0;
  }

  .card {
    border: none;
    border-radius: 0;
    max-width: 100%;
    min-height: 100vh;
  }

  .calendar-gate {
    border-radius: 0;
  }

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

  .progress-bar {
    gap: 16px;
    padding: 14px 16px;
  }

  .form-panel,
  .calendar-panel {
    padding: 20px 16px;
  }

  .cal-day {
    width: 38px;
    height: 38px;
    font-size: 14px;
  }

  .exit-popup-card {
    width: 90vw !important;
    padding: 28px 20px !important;
  }
}

/* ========================================
   CONVERSION BOOSTERS
   ======================================== */

/* ---- Phone microcopy ---- */
.phone-microcopy {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 4px;
  padding-left: 2px;
}

/* ---- Spots remaining badge ---- */
.spots-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

.spots-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  animation: spots-pulse 1.5s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes spots-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.spots-badge strong {
  color: var(--accent);
  font-weight: 600;
}

/* ---- Exit intent popup ---- */
.exit-popup {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.exit-popup.hidden {
  display: none;
}

.exit-popup-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.exit-popup-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px 36px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  animation: popup-enter 0.3s ease-out;
}

@keyframes popup-enter {
  from { opacity: 0; transform: scale(0.9) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.exit-popup-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 24px;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s;
}

.exit-popup-close:hover {
  color: var(--text-primary);
}

.exit-popup-icon {
  margin-bottom: 16px;
}

.exit-popup-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.exit-popup-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.5;
}

.exit-popup-btn {
  max-width: 280px;
  margin: 0 auto;
}

/* ---- Return visitor badge ---- */
.return-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 6px;
  font-size: 11px;
  color: #22c55e;
  margin-bottom: 8px;
}

/* ---- Continue button loading state ---- */
.btn-continue.loading span {
  opacity: 0;
}

.btn-continue.loading svg {
  opacity: 0;
}

.btn-continue.loading::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(17, 25, 40, 0.3);
  border-top-color: var(--text-button);
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
}

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

/* ---- Loading shimmer for calendar ---- */
.cal-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--text-secondary);
  font-size: 14px;
}

.cal-loading::after {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin-left: 8px;
  animation: spin 0.7s linear infinite;
}

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