/* ============================================================
   Proto P button + Connect modal — sauna palette (amber on black)
   Ported from globalproto.com/porzana with venue-ranking adapters.
   ============================================================ */

/* ===== Overlay + modal shell ===== */
.proto-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.22s ease;
  font-family: Inter, system-ui, -apple-system, sans-serif;
}
.proto-overlay.is-open { display: flex; opacity: 1; }

.proto-modal {
  width: 100%;
  max-width: 540px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: #0a0a0a;
  border: 1px solid rgba(245, 158, 11, 0.18);
  border-radius: 16px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.04);
  padding: 32px;
  color: #ece7dd;
  position: relative;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.proto-overlay.is-open .proto-modal { transform: translateY(0) scale(1); }

@media (max-width: 540px) {
  .proto-modal { padding: 24px 20px; border-radius: 12px; }
}

.proto-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.4);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}
.proto-modal__close:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }

.proto-modal__header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.proto-modal__icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.30);
  color: #f59e0b;
  font-weight: 700;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', system-ui, sans-serif;
  letter-spacing: -0.02em;
}
.proto-modal__title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 2px;
  letter-spacing: -0.015em;
  color: #ece7dd;
}
.proto-modal__subtitle {
  font-size: 12px;
  color: rgba(236, 231, 221, 0.48);
  letter-spacing: 0.01em;
}

/* ===== Body / checklist / privacy ===== */
.proto-body {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(236, 231, 221, 0.78);
  margin-bottom: 18px;
}
.proto-body p { margin: 0 0 10px; }
.proto-body p:last-child { margin-bottom: 0; }

.proto-checklist {
  background: rgba(245, 158, 11, 0.04);
  border: 1px solid rgba(245, 158, 11, 0.12);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.proto-checklist__label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(253, 230, 138, 0.7);
  font-weight: 600;
  margin-bottom: 8px;
}
.proto-checklist ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: rgba(236, 231, 221, 0.72);
}
.proto-checklist li {
  position: relative;
  padding-left: 18px;
}
.proto-checklist li::before {
  content: "·";
  position: absolute;
  left: 6px;
  color: rgba(245, 158, 11, 0.6);
  font-weight: 700;
}

.proto-privacy {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 18px;
  line-height: 1.5;
}

/* ===== Actions row ===== */
.proto-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.proto-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 0;
  text-decoration: none;
  text-align: center;
  transition: background 0.16s, border-color 0.16s, color 0.16s, transform 0.06s;
}
.proto-btn:active { transform: scale(0.98); }
.proto-btn--primary {
  background: #f59e0b;
  color: #0a0a0a;
}
.proto-btn--primary:hover { background: #fbbf24; }
.proto-btn--ghost {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.proto-btn--ghost:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.proto-btn--google {
  background: #fff;
  color: #1f1f1f;
}
.proto-btn--google:hover { background: #f5f5f5; }

/* ===== Loading state ===== */
.proto-loading {
  text-align: center;
  padding: 24px 0 8px;
}
.proto-loading__spinner {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #f59e0b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  margin: 0 auto 18px;
  animation: protoSpin 1.6s ease-in-out infinite;
}
@keyframes protoSpin {
  0%, 100% { transform: scale(1); border-color: rgba(245, 158, 11, 0.25); }
  50% { transform: scale(1.08); border-color: rgba(245, 158, 11, 0.55); }
}
.proto-loading__title {
  font-size: 14px;
  font-weight: 600;
  color: #ece7dd;
  margin-bottom: 4px;
}
.proto-loading__text {
  font-size: 12px;
  color: rgba(236, 231, 221, 0.5);
}

/* ===== Error / auth-error ===== */
.proto-error {
  background: rgba(248, 113, 113, 0.06);
  border: 1px solid rgba(248, 113, 113, 0.20);
  color: rgba(254, 202, 202, 0.95);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 16px;
}
.proto-error strong { color: #fecaca; font-weight: 600; }

/* ===== OAuth (Google) section ===== */
.proto-oauth-row {
  margin-bottom: 14px;
}
.proto-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 12px;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.32);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.proto-or::before, .proto-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

/* ===== Email form ===== */
.proto-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.proto-form input {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 12px;
  color: #fff;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.proto-form input:focus { border-color: rgba(245, 158, 11, 0.5); }
.proto-form input::placeholder { color: rgba(255, 255, 255, 0.3); }
.proto-form-error {
  font-size: 12px;
  color: #fecaca;
  margin-top: 6px;
}

/* ===== Connected / summary state ===== */
.proto-summary__panel {
  background: rgba(245, 158, 11, 0.04);
  border: 1px solid rgba(245, 158, 11, 0.14);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.proto-summary__label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(253, 230, 138, 0.7);
  font-weight: 600;
  margin-bottom: 8px;
}
.proto-summary__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.proto-summary__chip {
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 999px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.proto-summary__chip--high {
  background: rgba(248, 113, 113, 0.10);
  border: 1px solid rgba(248, 113, 113, 0.30);
  color: #fecaca;
}
.proto-summary__chip--low {
  background: rgba(96, 165, 250, 0.10);
  border: 1px solid rgba(96, 165, 250, 0.30);
  color: #bfdbfe;
}

/* ===== Venue recommendation list ===== */
.proto-recs {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  counter-reset: proto-rec;
}
.proto-recs__item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  align-items: flex-start;
}
.proto-recs__item:first-child { border-top: 0; padding-top: 8px; }
.proto-recs__rank {
  font-size: 11px;
  font-weight: 600;
  color: rgba(245, 158, 11, 0.55);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  padding-top: 1px;
}
.proto-recs__body { min-width: 0; }
.proto-recs__pill {
  display: inline-block;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  padding: 2.5px 7px;
  border-radius: 999px;
  font-weight: 600;
  margin-bottom: 5px;
}
.proto-recs__pill--rec {
  background: rgba(52, 211, 153, 0.10);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #86efac;
}
.proto-recs__pill--ease {
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.22);
  color: rgba(253, 230, 138, 0.75);
}
.proto-recs__name {
  font-size: 13.5px;
  font-weight: 600;
  color: #ece7dd;
  letter-spacing: -0.005em;
  line-height: 1.3;
}
.proto-recs__city {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.42);
  margin-top: 1px;
}
.proto-recs__why {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 5px;
  line-height: 1.5;
}

/* ===== "Signed in as ..." badge ===== */
.proto-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 16px;
  padding: 8px 12px;
  background: rgba(52, 211, 153, 0.06);
  border: 1px solid rgba(52, 211, 153, 0.18);
  border-radius: 8px;
}
.proto-user b { color: #86efac; font-weight: 600; }
.proto-user-out {
  margin-left: auto;
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.42);
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
}
.proto-user-out:hover { color: rgba(255, 255, 255, 0.85); text-decoration: underline; }

/* ===== OAuth button (Google) ===== */
.proto-btn--oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: #fff;
  color: #1f1f1f;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: 0;
  margin-bottom: 8px;
  transition: background 0.16s, transform 0.06s;
  font-family: inherit;
  cursor: pointer;
}
.proto-btn--oauth:hover { background: #f5f5f5; }
.proto-btn--oauth:active { transform: scale(0.99); }

/* ===== Inline sign-in form (auth-error state) ===== */
.proto-signin {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.proto-signin input {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 12px;
  color: #fff;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.proto-signin input:focus { border-color: rgba(245, 158, 11, 0.5); }
.proto-signin input::placeholder { color: rgba(255, 255, 255, 0.3); }
.proto-signin__error {
  font-size: 12px;
  color: #fecaca;
  margin-top: 4px;
}

/* ===== Rx summary line ===== */
.proto-rx-line {
  background: rgba(245, 158, 11, 0.05);
  border: 1px solid rgba(245, 158, 11, 0.16);
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 12px;
  color: rgba(253, 230, 138, 0.85);
  line-height: 1.55;
  margin-bottom: 6px;
}
.proto-rx-line b { color: #fde68a; font-weight: 600; text-transform: capitalize; }

/* ===== Manual tune (presets + sliders) ===== */
.proto-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 16px;
}
.proto-preset {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.78);
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.16s;
}
.proto-preset:hover {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.06);
  color: #fde68a;
}
.proto-field {
  margin-bottom: 14px;
}
.proto-field__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.proto-field__label {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.proto-field__value {
  font-size: 13px;
  color: #fde68a;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.proto-field__hint {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.32);
  margin-top: 4px;
}
.proto-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}
.proto-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: #f59e0b;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.18);
  transition: transform 0.12s;
}
.proto-range::-webkit-slider-thumb:hover { transform: scale(1.1); }
.proto-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #f59e0b;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.18);
}

/* ===== P button connected glow ===== */
[data-proto-p].is-connected {
  border-color: rgba(245, 158, 11, 0.55) !important;
  background: rgba(245, 158, 11, 0.12) !important;
}
[data-proto-p].is-connected span { color: #fde68a !important; }
