:root {
  --bg: #F4F4F4;
  --surface: #FFFFFF;
  --gold: #B8960C;
  --gold-light: #F5E9C0;
  --gold-dark: #8B6F09;
  --text-primary: #1A1A1A;
  --text-secondary: #6B6B6B;
  --success: #2D7A4F;
  --success-light: #E8F5E9;
  --danger: #C0392B;
  --danger-light: #FDECEA;
  --amber: #E6A817;
  --border: #E0E0E0;
  --radius: 10px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --gold: #B8960C;     
  --text-primary: #1A1A1A;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

/* Header */
.header {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: var(--shadow);
}
.header-left { display: flex; align-items: center; gap: 0.5rem; }
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 1rem; border-radius: var(--radius);
  font-family: inherit; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; border: 2px solid transparent;
  transition: all 150ms ease; text-decoration: none;
}
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: var(--gold-dark); }
.btn-outline { background: transparent; border-color: var(--gold); color: var(--gold); }
.btn-outline:hover { background: var(--gold-light); }
.btn-small { padding: 0.35rem 0.7rem; font-size: 0.8rem; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #A93226; }

.logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  text-decoration: none;
}
.logo span { color: var(--gold); }

/* Main */
.main { max-width: 720px; margin: 0 auto; padding: 1.5rem 1rem; }
/* Read-only banner */
.readonly-banner {
  background: var(--gold-light); border: 2px solid var(--gold);
  border-radius: var(--radius); padding: 1rem 1.25rem;
  margin-bottom: 1.5rem; display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
}
.readonly-banner p { font-size: 0.9rem; font-weight: 600; color: var(--gold-dark); }
.readonly-banner a { font-size: 0.85rem; }
/* Entry gate */
.entry-gate {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 2.5rem 2rem;
  text-align: center; max-width: 440px; margin: 3rem auto;
}
.entry-gate h1 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.entry-gate p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 1.5rem; }
.entry-gate .gate-fields {
  display: flex; flex-direction: column; gap: 0.5rem;
  align-items: center; margin-bottom: 1rem;
}
.entry-gate input {
  padding: 0.65rem 1rem; border: 2px solid var(--border); border-radius: var(--radius);
  font-family: inherit; font-size: 1.1rem; font-weight: 600;
  text-align: center; width: 200px; letter-spacing: 0.1em;
}
.entry-gate input:focus { border-color: var(--gold); outline: none; }
.gate-btn { width: 200px; }
.gate-hint {
  font-size: 0.8rem; color: var(--text-secondary);
  margin-top: 0.75rem; min-height: 1.2em;
}
/* PIN modal */
.pin-modal {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.5); display: flex;
  align-items: center; justify-content: center;
}
.pin-modal.hidden { display: none; }
.pin-modal-content {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 2.5rem 2rem;
  text-align: center; max-width: 380px; width: 90%;
}
.pin-modal-content h2 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.pin-modal-content p { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 1rem; }
.pin-modal-content input {
  display: block; margin: 0.5rem auto;
  padding: 0.65rem 1rem; border: 2px solid var(--border); border-radius: var(--radius);
  font-family: inherit; font-size: 1.1rem; font-weight: 600;
  text-align: center; width: 180px; letter-spacing: 0.2em;
}
.pin-modal-content input:focus { border-color: var(--gold); outline: none; }
.pin-error { color: #e74c3c; font-size: 0.85rem; margin: 0.5rem 0; }
.pin-error.hidden { display: none; }
/* Form sections */
.form-section {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.5rem; margin-bottom: 1.25rem;
}
.form-section-title {
  font-size: 1rem; font-weight: 700; margin-bottom: 0.25rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.form-section-subtitle {
  font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 1rem;
}
.form-group { margin-bottom: 1rem; }
.form-label {
  display: block; font-size: 0.8rem; font-weight: 600;
  margin-bottom: 0.35rem; color: var(--text-secondary);
}
.form-input {
  width: 100%; padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  font-family: inherit; font-size: 0.9rem;
  transition: border-color 150ms;
}
.form-input:focus { border-color: var(--gold); outline: none; }
.form-input[readonly] { background: #F8F8F8; color: var(--text-secondary); }
.form-textarea {
  width: 100%; padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  font-family: inherit; font-size: 0.85rem; resize: vertical; min-height: 70px;
}
.form-textarea:focus { border-color: var(--gold); outline: none; }
/* Toggle button groups */
.toggle-group { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.toggle-btn {
  padding: 0.4rem 0.85rem; border: 1.5px solid var(--border);
  border-radius: 50px; background: var(--surface);
  font-family: inherit; font-size: 0.82rem; font-weight: 500;
  color: var(--text-secondary); cursor: pointer;
  transition: all 150ms; user-select: none;
}
.toggle-btn:hover { border-color: var(--gold); color: var(--gold); }
.toggle-btn.active {
  background: var(--gold); color: #fff; border-color: var(--gold);
}/* OLD
.toggle-btn.active-want {
  background: var(--success); color: #fff; border-color: var(--success);
}
.toggle-btn.active-avoid {
  background: var(--danger); color: #fff; border-color: var(--danger);
}*/
.toggle-btn.active-want {
  background: rgba(34, 197, 94, 0.25);
  border-color: #22c55e;
  color: #22c55e;
}

.toggle-btn.active-avoid {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #ef4444;
}
.toggle-btn[disabled] {
  opacity: 0.5; cursor: not-allowed; pointer-events: none;
}
/* Dest chip input */
.dest-input-row { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.dest-input-row input { flex: 1; min-width: 80px; }
.dest-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.dest-tag {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.25rem 0.55rem; border-radius: 50px;
  font-size: 0.78rem; font-weight: 500;
}
.dest-tag-want { background: var(--success-light); color: var(--success); border: 1px solid #C8E6C9; }
.dest-tag-avoid { background: var(--danger-light); color: var(--danger); border: 1px solid #F5C6CB; }
.dest-tag button {
  background: none; border: none; cursor: pointer; font-weight: 700;
  font-size: 0.85rem; line-height: 1; padding: 0; color: inherit;
}
/* Submit bar */
.submit-bar {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.25rem 1.5rem;
  display: flex; gap: 0.75rem; align-items: center;
  justify-content: space-between; flex-wrap: wrap;
  position: sticky; bottom: 0; z-index: 50;
  border-top: 2px solid var(--gold-light);
}
.submit-bar .submit-msg { font-size: 0.8rem; color: var(--text-secondary); }
/* Toast */
.toast-container {
  position: fixed; top: 1rem; right: 1rem; z-index: 500;
  display: flex; flex-direction: column; gap: 0.5rem;
}
@media(max-width:767px) { .toast-container { left: 1rem; right: 1rem; align-items: center; } }
.toast {
  padding: 0.75rem 1.25rem; border-radius: var(--radius);
  font-size: 0.85rem; font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: toastIn 200ms ease;
}
.toast-success { background: var(--success); color: #fff; }
.toast-error { background: var(--danger); color: #fff; }
.toast-info { background: var(--gold); color: #fff; }
@keyframes toastIn { from { opacity:0; transform: translateY(-10px); } to { opacity:1; transform: translateY(0); } }
/* Tooltip */
[data-tooltip] { position: relative; }
[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  background: var(--text-primary); color: #fff; padding: 0.25rem 0.5rem;
  border-radius: 4px; font-size: 0.7rem; white-space: nowrap;
  z-index: 10; font-style: normal; font-weight: 400;
}
/* Hidden */
.hidden { display: none !important; }

.swapdesk-intro-tooltip .introjs-tooltip-title { color: var(--gold); font-weight: 700; }
.introjs-button {
  font-family: 'Inter', sans-serif !important;
  border-radius: 8px !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
}
.introjs-nextbutton, .introjs-donebutton {
  background: var(--gold) !important;
  border-color: var(--gold-dark) !important;
  color: #fff !important;
  text-shadow: none !important;
}
.introjs-nextbutton:hover, .introjs-donebutton:hover { background: var(--gold-dark) !important; }
.introjs-prevbutton { color: var(--text-primary) !important; text-shadow: none !important; }
.introjs-progressbar { background: var(--gold) !important; }
.introjs-helperLayer { border-radius: 10px !important; }
