/* ── Create Event — Overlay UI: Date Picker, Time Picker, Description Modal */

/* ── Picker panels (shared base) ── */
.picker-panel {
  position: fixed;
  z-index: 1200;
  background: var(--bg-raised);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(255,255,255,0.14), 0 2px 8px rgba(255,255,255,0.09);
  display: none;
  transform-origin: top center;
}
.picker-panel.open {
  display: block;
  animation: pickerIn 0.15s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes pickerIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

/* ── Date Picker ── */
#datePicker { width: 272px; }
.dp-header {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px;
}
.dp-month-label {
  font: 600 13px/1 'DM Sans', sans-serif;
  color: var(--text-primary); letter-spacing: 0.2px;
}
.dp-nav {
  width: 28px; height: 28px;
  border: 1px solid rgba(255,255,255,0.12); border-radius: 8px;
  background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.62);
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.dp-nav:hover { border-color: rgba(255,255,255,0.22); background: rgba(255,255,255,0.06); color: var(--text-primary); }
.dp-weekdays {
  display: grid; grid-template-columns: repeat(7,1fr);
  padding: 0 10px;
}
.dp-wd {
  font: 600 9px/1 'DM Sans', sans-serif;
  color: rgba(255,255,255,0.42); text-align: center;
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 2px 0 7px;
}
.dp-days {
  display: grid; grid-template-columns: repeat(7,1fr);
  gap: 0; padding: 0 10px 12px;
}
.dp-day {
  height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font: 400 12px/1 'DM Sans', sans-serif;
  color: var(--text-primary);
  cursor: pointer; border: none; background: transparent;
  transition: background 0.1s, color 0.1s;
  position: relative;
}
.dp-day:hover:not(.dp-day-empty) { background: rgba(255,255,255,0.09); }
.dp-day.dp-day-empty { cursor: default; pointer-events: none; }
.dp-day.dp-past { opacity: 0.22; cursor: default; pointer-events: none; }
.dp-day.dp-today { color: var(--accent); font-weight: 600; }
.dp-day.dp-selected { background: #FFFFFF !important; color: #0C0C12 !important; font-weight: 600; }

/* ── Date Picker — Range styles ── */

/* Wrapper inside each day cell */
.dp-day-inner {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; position: relative; z-index: 1;
  width: 100%; height: 100%;
  justify-content: center;
}

/* Day number */
.dp-day-num { line-height: 1; }

/* Event dot */
.dp-event-dot {
  width: 3px; height: 3px; border-radius: 50%;
  background: rgba(255,255,255,0.55);
  flex-shrink: 0;
}

/* In-range strip — flat background, no circle */
.dp-day.dp-in-range {
  border-radius: 0;
  background: rgba(255,255,255,0.08) !important;
}
.dp-day.dp-in-range:hover { background: rgba(255,255,255,0.13) !important; }

/* Range endpoints — white circle on top of half-strip */
.dp-day.dp-range-start,
.dp-day.dp-range-end {
  position: relative;
  background: transparent !important;
  border-radius: 0;
  color: #0C0C12 !important;
  font-weight: 600;
}

/* Half-strip for start (fills right half) — only when range is complete */
.dp-day.dp-range-start.dp-has-range::before {
  content: '';
  position: absolute; inset: 0;
  left: 50%; right: 0;
  background: rgba(255,255,255,0.08);
  z-index: 0;
}

/* Half-strip for end (fills left half) — only when range is complete */
.dp-day.dp-range-end.dp-has-range::before {
  content: '';
  position: absolute; inset: 0;
  left: 0; right: 50%;
  background: rgba(255,255,255,0.08);
  z-index: 0;
}

/* Single day (start == end): no half strip */
.dp-day.dp-range-start.dp-range-end::before { display: none; }

/* White circle overlaid on top of strip */
.dp-day.dp-range-start .dp-day-inner,
.dp-day.dp-range-end .dp-day-inner {
  background: #FFFFFF;
  border-radius: 50%;
  width: 28px; height: 28px;
  margin: auto;
}

/* Text on selected endpoint should be dark */
.dp-day.dp-range-start .dp-day-num,
.dp-day.dp-range-end .dp-day-num {
  color: #0C0C12;
}

/* ── Time Picker ── */
#timePicker { width: 204px; padding: 16px; }
.tp-row { display: flex; align-items: flex-start; gap: 6px; }
.tp-unit { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tp-arrow {
  width: 100%; height: 28px;
  border: 1px solid rgba(255,255,255,0.12); border-radius: 8px;
  background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.62);
  transition: border-color 0.12s, background 0.12s, color 0.12s;
  user-select: none;
}
.tp-arrow:hover { border-color: rgba(255,255,255,0.22); background: rgba(255,255,255,0.06); color: var(--text-primary); }
.tp-arrow:active { background: rgba(255,255,255,0.10); }
.tp-value {
  font: 600 24px/1 'Space Grotesk', sans-serif;
  color: var(--text-primary); min-width: 44px;
  text-align: center; letter-spacing: -0.5px;
  pointer-events: none; cursor: default; user-select: none;
}
.tp-unit-label {
  font: 500 9px/1 'DM Sans', sans-serif;
  color: rgba(255,255,255,0.50);
  text-transform: uppercase; letter-spacing: 0.8px;
}
.tp-sep-col {
  font: 600 22px/1 'Space Grotesk', sans-serif;
  color: rgba(255,255,255,0.20); padding-top: 40px;
}
.tp-ampm-col { display: flex; flex-direction: column; gap: 4px; padding-top: 34px; }
.tp-ampm-btn {
  width: 38px; height: 26px;
  border: 1px solid rgba(255,255,255,0.12); border-radius: 7px;
  background: transparent; cursor: pointer;
  font: 600 10px/1 'DM Sans', sans-serif;
  color: rgba(255,255,255,0.62);
  transition: all 0.12s; letter-spacing: 0.3px;
}
.tp-ampm-btn.active { background: #FFFFFF; border-color: #FFFFFF; color: #0C0C12; }
.tp-footer { display: flex; justify-content: flex-end; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.09); margin-top: 12px; }
.tp-done {
  height: 30px; padding: 0 16px;
  border: none; border-radius: 8px;
  background: #FFFFFF; color: #0C0C12;
  font: 500 12px/1 'DM Sans', sans-serif;
  cursor: pointer; transition: opacity 0.15s;
}
.tp-done:hover { opacity: 0.80; }

/* ── Description Inline Editor Panel ── */
.desc-inline-card {
  margin-top: 8px;
  border: 1px solid var(--border-input);
  border-radius: 12px;
  background: var(--bg-input);
}
.desc-inline-editor {
  min-height: 160px;
  padding: 14px 16px 10px;
  font: 400 15px/1.65 'DM Sans', sans-serif; color: var(--text-primary);
  outline: none; word-break: break-word;
}
.desc-inline-editor:empty::before {
  content: attr(data-placeholder); color: rgba(237,238,245,0.38); pointer-events: none;
}
.desc-inline-editor ul { padding-left: 22px; }
.desc-inline-editor a { color: var(--text-primary); text-decoration: underline; }

.desc-inline-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 6px 4px 2px; border-top: 1px solid var(--border);
  gap: 6px;
}
.desc-toolbar { display: flex; align-items: center; gap: 1px; flex: 1; min-width: 0; }
.desc-tool-wrap { position: relative; display: flex; align-items: center; }

.desc-toolbar-btn {
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; cursor: pointer; border-radius: 7px;
  color: rgba(237,238,245,0.60); flex-shrink: 0; position: relative;
  transition: background 0.12s, color 0.12s;
}
.desc-toolbar-btn:hover { background: var(--bg-hover-md); color: var(--text-primary); }
.desc-toolbar-btn.active { background: var(--bg-active); color: var(--text-primary); }
.desc-toolbar-sep { width: 1px; height: 14px; background: rgba(255,255,255,0.10); flex-shrink: 0; margin: 0 2px; }

.desc-font-btn { display: flex; align-items: center; gap: 2px; padding: 0 6px; width: auto; }
.desc-font-btn .font-a { font: 700 13px/1 'DM Sans', sans-serif; }
.desc-font-btn .font-chevron { opacity: 0.55; }

.desc-fontsize-dropdown {
  position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 2100;
  background: var(--bg-raised); border: 1px solid rgba(255,255,255,0.13);
  border-radius: 12px; padding: 6px; display: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6); min-width: 130px;
}
.desc-fontsize-dropdown.open { display: block; }
.fs-option {
  display: block; width: 100%; padding: 9px 12px;
  border: none; background: transparent; cursor: pointer; border-radius: 8px;
  color: var(--text-sec); text-align: left; font: 400 14px/1 'DM Sans', sans-serif;
  transition: background 0.1s, color 0.1s; white-space: nowrap;
}
.fs-option:hover { background: var(--bg-hover-md); color: var(--text-primary); }
.fs-option.selected { color: var(--text-primary); font-weight: 600; }

.desc-emoji-picker {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 2100;
  background: var(--bg-raised); border: 1px solid rgba(255,255,255,0.13);
  border-radius: 16px; padding: 12px; display: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6); width: 288px;
}
.desc-emoji-picker.open { display: block; }
.emoji-search {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border-input);
  border-radius: 8px; padding: 8px 12px; font: 400 13px/1 'DM Sans', sans-serif;
  color: var(--text-primary); outline: none; margin-bottom: 10px;
}
.emoji-search::placeholder { color: var(--text-muted); }
.emoji-search:focus { border-color: var(--border-focus); }
.emoji-cats { display: flex; gap: 4px; margin-bottom: 8px; flex-wrap: wrap; }
.emoji-cat-btn {
  padding: 4px 8px; border: 1px solid transparent; border-radius: 6px;
  background: transparent; cursor: pointer; font-size: 13px; color: var(--text-sec);
  transition: background 0.1s, color 0.1s;
}
.emoji-cat-btn.active { background: var(--bg-active); color: var(--text-primary); border-color: var(--border-hover); }
.emoji-cat-btn:hover:not(.active) { background: var(--bg-hover-md); }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; max-height: 168px; overflow-y: auto; }
.emoji-btn {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; cursor: pointer; border-radius: 6px;
  font-size: 18px; transition: background 0.1s; line-height: 1;
}
.emoji-btn:hover { background: var(--bg-hover-md); }

.desc-link-dialog {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  z-index: 2100; background: var(--bg-raised); border: 1px solid rgba(255,255,255,0.13);
  border-radius: 10px; padding: 8px; display: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6); width: 240px;
}
.desc-link-dialog.open { display: block; }
.link-input {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border-input);
  border-radius: 6px; padding: 8px 10px; font: 400 13px/1 'DM Sans', sans-serif;
  color: var(--text-primary); outline: none; display: block;
}
.link-input:focus { border-color: var(--border-focus); }
.link-input::placeholder { color: var(--text-muted); }

.desc-save-btn {
  height: 30px; padding: 0 14px; background: #FFFFFF; color: #0C0C12;
  font: 600 12px/1 'DM Sans', sans-serif; border: none; border-radius: 15px;
  cursor: pointer; flex-shrink: 0; transition: opacity 0.12s, transform 0.1s;
}
.desc-save-btn:hover { opacity: 0.88; }
.desc-save-btn:active { transform: scale(0.97); }

/* ══════════════════════════════════════════════════════════════════════
   Auth Modal — Login / Sign Up
   ══════════════════════════════════════════════════════════════════════ */

/* Backdrop */
.auth-backdrop {
  position: fixed; inset: 0;
  background: rgba(8,8,16,0.86);
  backdrop-filter: blur(6px) saturate(0.6);
  -webkit-backdrop-filter: blur(6px) saturate(0.6);
  z-index: 3000;
  display: none;
}
.auth-backdrop.open {
  display: block;
  animation: authFadeIn 0.2s ease forwards;
}

/* Modal card */
.auth-modal {
  position: fixed;
  top: 50%; left: 50%;
  width: min(360px, calc(100vw - 32px));
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 22px;
  padding: 32px 28px 26px;
  z-index: 3001;
  display: none;
  box-shadow: 0 32px 80px rgba(0,0,0,0.72), 0 0 0 0.5px rgba(255,255,255,0.06) inset;
}
.auth-modal.open {
  display: block;
  animation: authSlideIn 0.24s cubic-bezier(0.16,1,0.3,1) forwards;
}

@keyframes authFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes authSlideIn {
  from { opacity: 0; transform: translate(-50%,-52%) scale(0.94); }
  to   { opacity: 1; transform: translate(-50%,-50%) scale(1); }
}

/* Close button */
.auth-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: rgba(237,238,245,0.40);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.auth-close:hover  { color: var(--text-primary); background: var(--bg-hover-md); }
.auth-close:active { background: var(--bg-active); }

/* Logo block */
.auth-logo-wrap {
  display: flex; flex-direction: column; align-items: center;
  margin-bottom: 12px;
}
.auth-logo-img {
  width: 70px; height: auto; display: block;
  filter: brightness(0) invert(1); opacity: 0.92;
  pointer-events: none; user-select: none;
}

/* Heading + sub */
.auth-heading {
  font: 600 20px/1.2 'Space Grotesk', sans-serif;
  color: var(--text-primary); text-align: center; margin: 0 0 6px;
}
.auth-subtext {
  font: 400 13px/1.55 'DM Sans', sans-serif;
  color: var(--text-muted); text-align: center; margin: 0 0 20px;
}

/* Mode toggle pill */
.auth-toggle {
  display: flex; background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: 11px; padding: 3px; gap: 2px; margin-bottom: 16px;
}
.auth-toggle-btn {
  flex: 1; height: 33px; border: none; border-radius: 8px;
  font: 500 13px/1 'DM Sans', sans-serif; cursor: pointer;
  background: transparent; color: var(--text-muted);
  transition: background 0.16s, color 0.16s;
}
.auth-toggle-btn.active { background: #FFFFFF; color: #0B0B13; }

/* Input wrap */
.auth-input-wrap { margin-bottom: 12px; }

/* Phone row */
.auth-phone-row {
  display: flex; align-items: stretch;
  background: var(--bg-input); border: 1.5px solid var(--border-input);
  border-radius: 13px; overflow: hidden;
  transition: border-color 0.14s;
}
.auth-phone-row:focus-within { border-color: var(--border-focus); }

/* Country trigger */
.auth-country-wrap { position: relative; flex-shrink: 0; }
.auth-country-trigger {
  display: flex; align-items: center; gap: 6px;
  height: 50px; padding: 0 11px 0 13px;
  border: none; background: transparent; cursor: pointer;
  border-right: 1px solid var(--border-input); color: var(--text-primary);
  transition: background 0.12s;
}
.auth-country-trigger:hover { background: var(--bg-hover-md); }
.auth-country-flag { font-size: 18px; line-height: 1; flex-shrink: 0; }
.auth-country-dial {
  font: 500 14px/1 'DM Sans', sans-serif; color: var(--text-primary);
  letter-spacing: -0.2px; flex-shrink: 0;
}
.auth-chevron { color: var(--text-muted); transition: transform 0.15s; flex-shrink: 0; }
.auth-country-wrap.open .auth-chevron { transform: rotate(180deg); }

/* ── Country picker overlay ────────────────────────────────────────────── */
.cpicker-backdrop {
  position: fixed; inset: 0; z-index: 3200;
  background: rgba(8,8,16,0.68); backdrop-filter: blur(5px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.cpicker-backdrop.open { opacity: 1; pointer-events: auto; }

.cpicker-panel {
  position: fixed; z-index: 3201;
  left: 50%; top: 50%;
  transform: translate(-50%, calc(-50% + 12px));
  width: min(400px, calc(100vw - 32px));
  max-height: min(540px, calc(100dvh - 80px));
  background: var(--bg-raised); border: 1px solid rgba(255,255,255,0.10);
  border-radius: 20px; box-shadow: 0 24px 80px rgba(0,0,0,0.85);
  display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; pointer-events: none;
  will-change: transform, opacity;
  transition: opacity 0.2s ease, transform 0.22s cubic-bezier(.22,.68,0,1.08);
}
.cpicker-panel.open {
  opacity: 1; pointer-events: auto;
  transform: translate(-50%, -50%);
}

.cpicker-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 18px 14px; flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.cpicker-title {
  font: 600 15px/1 'DM Sans', sans-serif; color: var(--text-primary); margin: 0;
}
.cpicker-close {
  width: 28px; height: 28px; border: none; background: var(--bg-active);
  border-radius: 50%; cursor: pointer; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s, color 0.12s; flex-shrink: 0;
}
.cpicker-close:hover { background: rgba(255,255,255,0.14); color: var(--text-primary); }

.cpicker-search-wrap { padding: 12px 14px 8px; flex-shrink: 0; }
.cpicker-search {
  width: 100%; box-sizing: border-box;
  background: var(--bg-input); border: 1.5px solid var(--border-input);
  border-radius: 11px; padding: 10px 14px;
  font: 400 14px/1 'DM Sans', sans-serif; color: var(--text-primary); outline: none;
  transition: border-color 0.14s;
}
.cpicker-search::placeholder { color: var(--text-muted); }
.cpicker-search:focus { border-color: var(--border-focus); }

.cpicker-list { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 10px 12px; }
.cpicker-list::-webkit-scrollbar { width: 4px; }
.cpicker-list::-webkit-scrollbar-track { background: transparent; }
.cpicker-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }

.cpicker-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 10px; border-radius: 10px; cursor: pointer;
  transition: background 0.1s;
}
.cpicker-item:hover { background: var(--bg-hover-md); }
.cpicker-item.selected { background: var(--bg-active); }
.cpicker-item-flag { font-size: 20px; line-height: 1; flex-shrink: 0; }
.cpicker-item-name {
  font: 400 14px/1.2 'DM Sans', sans-serif; color: var(--text-primary); flex: 1;
}
.cpicker-item-dial {
  font: 400 13px/1 'DM Sans', sans-serif; color: var(--text-muted); flex-shrink: 0;
}
.cpicker-no-results {
  text-align: center; padding: 32px 0;
  font: 400 13px/1.5 'DM Sans', sans-serif; color: var(--text-muted);
}

/* Phone number input */
.auth-phone-input {
  flex: 1; height: 50px; padding: 0 14px;
  border: none; background: transparent; outline: none;
  font: 400 15px/1 'DM Sans', sans-serif; color: var(--text-primary);
}
.auth-phone-input::placeholder { color: var(--text-muted); }

/* Email text input */
.auth-text-input {
  width: 100%; height: 50px; padding: 0 16px; box-sizing: border-box;
  background: var(--bg-input); border: 1.5px solid var(--border-input);
  border-radius: 13px; outline: none;
  font: 400 15px/1 'DM Sans', sans-serif; color: var(--text-primary);
  transition: border-color 0.14s;
}
.auth-text-input::placeholder { color: var(--text-muted); }
.auth-text-input:focus { border-color: var(--border-focus); }
/* Readonly / pre-filled verified field */
.auth-input-readonly,
.auth-phone-input.auth-input-readonly { opacity: 0.5; cursor: default; }
.auth-country-trigger:disabled { opacity: 0.5; cursor: default; pointer-events: none; }

/* CTA button */
.auth-cta {
  width: 100%; height: 50px; border: none; border-radius: 13px;
  background: #FFFFFF; color: #0B0B13;
  font: 600 15px/1 'DM Sans', sans-serif; cursor: pointer;
  margin-top: 6px; margin-bottom: 18px;
  transition: opacity 0.15s, transform 0.12s;
}
.auth-cta:hover:not(:disabled) { opacity: 0.86; }
.auth-cta:active:not(:disabled) { transform: scale(0.98); }
.auth-cta:disabled { opacity: 0.28; cursor: default; }

/* Google OAuth button */
.auth-google-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--text-primary);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 0; margin-bottom: 0;
}
.auth-google-btn:hover:not(:disabled) { background: rgba(255,255,255,0.06); opacity: 1; }

/* "or" divider */
.auth-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 10px;
  color: rgba(255,255,255,0.36);
  font: 400 12px/1 'DM Sans', sans-serif;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.1);
}

/* Terms / small text */
.auth-terms {
  font: 400 11.5px/1.65 'DM Sans', sans-serif;
  color: var(--text-muted); text-align: center; margin: 0;
}
.auth-link {
  color: var(--text-sec); text-decoration: underline;
  text-underline-offset: 2px; text-decoration-color: rgba(237,238,245,0.28);
  background: none; border: none; cursor: pointer; padding: 0; font: inherit;
  transition: color 0.12s;
}
.auth-link:hover { color: var(--text-primary); }

/* ── Step transitions (crossfade) ── */
.auth-step { animation: authStepIn 0.22s cubic-bezier(0.16,1,0.3,1) both; }
.auth-step-out {
  animation: authStepOut 0.14s ease-in forwards;
  pointer-events: none;
}
@keyframes authStepIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes authStepOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-6px); }
}

/* ── Error message ── */
.auth-error {
  font: 400 12.5px/1.5 'DM Sans', sans-serif;
  color: var(--red); text-align: center;
  margin: -6px 0 10px; display: none;
}
.auth-error.visible { display: block; animation: authStepIn 0.18s ease both; }

/* ── CTA loading spinner ── */
.auth-cta { position: relative; overflow: hidden; }
.auth-cta.loading { color: transparent; pointer-events: none; }
.auth-cta.loading::after {
  content: '';
  position: absolute; top: 50%; left: 50%;
  width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border: 2px solid rgba(11,11,19,0.25);
  border-top-color: #0B0B13;
  border-radius: 50%;
  animation: authSpin 0.65s linear infinite;
}
@keyframes authSpin {
  to { transform: rotate(360deg); }
}

/* ── Step 2: Verify ── */

/* Step 2 header — back button inline with centred heading */
.auth-step2-header {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  margin: -6px -6px 8px;
}
.auth-step2-header .auth-heading {
  margin: 0;
  text-align: center;
}

/* Back button — 44×44 touch target */
.auth-back {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin: 0;
  border: none; border-radius: 11px;
  background: transparent; cursor: pointer; color: var(--text-sec);
  transition: color 0.12s, background 0.12s;
  touch-action: manipulation;
}
.auth-back:hover {
  color: var(--text-primary);
  background: var(--bg-hover-md);
}
.auth-back:active { background: var(--bg-active); }

/* OTP row */
.auth-otp-row {
  display: flex; gap: 7px; justify-content: center; margin: 6px 0 8px;
}
.auth-otp-box {
  width: 44px; height: 54px;
  background: var(--bg-input); border: 1.5px solid var(--border-input);
  border-radius: 12px; outline: none;
  font: 600 22px/1 'Space Grotesk', sans-serif; color: var(--text-primary);
  text-align: center; caret-color: transparent;
  transition: border-color 0.14s, background 0.14s;
  touch-action: manipulation;
}
.auth-otp-box:focus { border-color: var(--border-focus); background: var(--bg-raised); }
.auth-otp-box.filled { border-color: var(--border-hover); }
/* Error shake on wrong code */
.auth-otp-box.error {
  border-color: var(--red);
  animation: authShake 0.38s cubic-bezier(0.36,0.07,0.19,0.97);
}
@keyframes authShake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-3px); }
  40%, 60% { transform: translateX(3px); }
}

/* Resend timer text */
#authResendTimer { color: var(--text-dim); font: 400 11.5px/1 'DM Sans', sans-serif; }

/* Topbar: logged-in indicator */
.topbar-user-btn.auth-logged-in { position: relative; }
.topbar-user-btn.auth-logged-in::after {
  content: '';
  position: absolute; bottom: 2px; right: 2px;
  width: 6px; height: 6px; border-radius: 50%;
  background: #EDEEF5;
  border: 1.5px solid var(--bg-page);
}

/* User dropdown menu */
.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  padding: 5px;
  min-width: 140px;
  z-index: 200;
  box-shadow: 0 12px 32px rgba(0,0,0,.55);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px) scale(0.97);
  transform-origin: top right;
  transition: opacity .14s ease, transform .14s ease;
}
.user-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  background: none;
  border: none;
  color: rgba(255,255,255,.75);
  font: 400 13px/1.4 'DM Sans', sans-serif;
  cursor: pointer;
  text-align: left;
  border-radius: 6px;
  transition: background .12s, color .12s;
}
.user-menu-item:hover { background: var(--bg-raised); color: var(--text-primary); }

/* Mobile */
@media (max-width: 480px) {
  .auth-modal { padding: 28px 20px 22px; }
  .auth-otp-box { width: 40px; height: 50px; font-size: 20px; }
  .auth-otp-row { gap: 5px; }
  .cpicker-panel { border-radius: 16px; }
}

/* ── Step 3: Profile — first + last name side by side ── */
.auth-name-row {
  display: flex; gap: 10px;
}
.auth-name-row .auth-input-wrap {
  flex: 1; min-width: 0;
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  .auth-step, .auth-step-out, .auth-modal.open, .auth-backdrop.open,
  .auth-otp-box.error { animation: none; }
}

/* ── OTP fill flash ── */
@keyframes otpFill {
  0%   { transform: scale(1.1); background: rgba(255,255,255,0.12); }
  100% { transform: scale(1);   background: var(--bg-input); }
}
.otp-fill-flash { animation: otpFill 150ms cubic-bezier(0.16,1,0.3,1); }



/* ═══════════════════════════════════════════════════════════════════════════
   ENHANCED ANIMATIONS & MICROINTERACTIONS
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 1. Toast Notification System ── */

.toast-stack {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  z-index: 9000;
  pointer-events: none;
  width: min(360px, calc(100vw - 32px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-raised);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.55), 0 1px 0 rgba(255,255,255,0.04) inset;
  font: 400 13px/1.5 'DM Sans', sans-serif;
  color: var(--text-primary);
  pointer-events: auto;
  animation: toastIn 0.32s cubic-bezier(0.16,1,0.3,1) both;
}
.toast.toast-dismissing {
  animation: toastOut 0.22s ease-in forwards;
}

.toast-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  opacity: 0.85;
}
.toast-message { flex: 1; min-width: 0; }
.toast-close {
  flex-shrink: 0;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; cursor: pointer;
  color: rgba(255,255,255,0.38); border-radius: 5px;
  transition: color 0.12s, background 0.12s;
  padding: 0; margin-top: -1px;
}
.toast-close:hover { color: var(--text-primary); background: rgba(255,255,255,0.07); }

.toast.toast-success { border-left: 3px solid var(--green); }
.toast.toast-error   { border-left: 3px solid var(--red); }
.toast.toast-info    { border-left: 3px solid rgba(255,255,255,0.30); }
.toast.toast-warning { border-left: 3px solid var(--amber); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(6px) scale(0.96); }
}


/* ── 2. Button Press / Ripple Microinteraction ── */

.btn-ripple {
  position: relative;
  overflow: hidden;
}
.btn-ripple::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.14);
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  pointer-events: none;
}
.btn-ripple:active::after {
  animation: ripplePulse 0.45s cubic-bezier(0.16,1,0.3,1) forwards;
}

@keyframes ripplePulse {
  0%   { width: 0; height: 0; opacity: 0.6; transform: translate(-50%, -50%) scale(0); }
  60%  { opacity: 0.25; }
  100% { width: 200%; height: 200%; opacity: 0; transform: translate(-50%, -50%) scale(1); }
}


/* ── 3. Input Focus Glow ── */

.input-glow:focus {
  box-shadow:
    0 0 0 3px rgba(255,255,255,0.05),
    0 0 12px rgba(255,255,255,0.04);
  outline: none;
}


/* ── 4. Chip Selection Pop ── */

@keyframes chipSelect {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.06); }
  75%  { transform: scale(0.98); }
  100% { transform: scale(1); }
}
.chip-selected-pop {
  animation: chipSelect 200ms cubic-bezier(0.16,1,0.3,1);
}


/* ── 5. Success Checkmark Animation ── */

@keyframes checkCircle {
  from { transform: scale(0.6); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
@keyframes checkDraw {
  from { stroke-dashoffset: 48; opacity: 0.4; }
  to   { stroke-dashoffset: 0;  opacity: 1; }
}

.success-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px; height: 52px;
  animation: checkCircle 0.30s cubic-bezier(0.16,1,0.3,1) both;
}
.success-check svg circle {
  animation: checkCircle 0.30s cubic-bezier(0.16,1,0.3,1) both;
}
.success-check svg path,
.success-check svg polyline {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: checkDraw 0.38s cubic-bezier(0.16,1,0.3,1) 0.18s both;
}


/* ── 6. Skeleton Loading Shimmer ── */

@keyframes shimmerPortal {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-card) 25%,
    var(--bg-raised) 50%,
    var(--bg-card) 75%
  );
  background-size: 200% 100%;
  animation: shimmerPortal 1.5s ease-in-out infinite;
  border-radius: 6px;
}
.skeleton-text  { height: 14px; width: 60%; }
.skeleton-title { height: 20px; width: 40%; }
.skeleton-card  { height: 80px; width: 100%; }


/* ── 7. Section Collapse Smoothing ── */

.section-body {
  overflow: hidden;
  transition:
    max-height 320ms cubic-bezier(0.16,1,0.3,1),
    opacity    220ms ease;
}
.section-body.collapsed {
  opacity: 0.4;
}


/* ── 8. Autosave Saved Pulse ── */

@keyframes savedPulse {
  0%,100% { opacity: 1; }
  50%     { opacity: 0.6; }
}
.autosave-indicator.saved {
  animation: savedPulse 1.2s ease 2;
}


/* ── 9. Error Field Shake (enhanced) ── */

@keyframes fieldShake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-4px); }
  40%     { transform: translateX(4px); }
  60%     { transform: translateX(-3px); }
  80%     { transform: translateX(2px); }
}
.error-field {
  animation: fieldShake 350ms cubic-bezier(0.36,0.07,0.19,0.97);
}


/* ── 10. Page Entry Fade-in ── */

@keyframes pageEntry {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-entry {
  animation: pageEntry 400ms cubic-bezier(0.16,1,0.3,1) both;
}


/* ── Reduced-motion: disable all enhanced animations ── */
@media (prefers-reduced-motion: reduce) {
  .toast, .toast.toast-dismissing,
  .btn-ripple:active::after,
  .chip-selected-pop,
  .success-check, .success-check svg circle,
  .success-check svg path, .success-check svg polyline,
  .skeleton,
  .autosave-indicator.saved,
  .error-field,
  .page-entry {
    animation: none;
  }
  .section-body {
    transition: none;
  }
}

/* ── 11. Venue suggestion stagger ── */
@keyframes suggestionIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.venue-suggestions.open .venue-suggestion {
  animation: suggestionIn 200ms cubic-bezier(0.16,1,0.3,1) both;
}
.venue-suggestions.open .venue-suggestion:nth-child(2) { animation-delay: 35ms; }
.venue-suggestions.open .venue-suggestion:nth-child(3) { animation-delay: 70ms; }
.venue-suggestions.open .venue-suggestion:nth-child(4) { animation-delay: 105ms; }
.venue-suggestions.open .venue-suggestion:nth-child(5) { animation-delay: 140ms; }

/* ── 12. Chip deselect pop ── */
@keyframes chipDeselect {
  0%   { transform: scale(1); }
  35%  { transform: scale(0.92); }
  100% { transform: scale(1); }
}
.chip-deselect-pop {
  animation: chipDeselect 160ms cubic-bezier(0.16,1,0.3,1);
}

/* ── 13. Cover zone hover lift + mobile active press ── */
@media (hover: hover) {
  .panel-cover-zone:not(.has-image):hover {
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.28);
    box-shadow: 0 8px 24px rgba(0,0,0,0.30);
    transition: transform 0.2s ease, border-color 0.15s, box-shadow 0.25s ease;
  }
}
.panel-cover-zone:not(.has-image):active {
  transform: scale(0.985) !important;
  transition: transform 80ms ease !important;
}

/* ── 14. Map placeholder reveal ── */
@keyframes mapReveal {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}
.map-reveal {
  animation: mapReveal 350ms cubic-bezier(0.16,1,0.3,1) both;
}

/* ── 15. Publish button loading pulse ── */
@keyframes publishPulse {
  0%, 100% { opacity: 0.55; }
  50%       { opacity: 0.80; }
}
.publish-btn:disabled {
  animation: publishPulse 1.5s ease-in-out infinite;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .venue-suggestions.open .venue-suggestion,
  .chip-deselect-pop,
  .map-reveal,
  .publish-btn:disabled { animation: none; }
  .panel-cover-zone:not(.has-image):hover { transform: none; }
}

/* === TOAST STACK === */
#toast-stack {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: max-content;
  max-width: min(360px, calc(100vw - 32px));
}
#toast-stack .toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  background: var(--bg-overlay);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45), 0 2px 8px rgba(0,0,0,0.3);
  pointer-events: auto;
  animation: toastIn 280ms cubic-bezier(0.16,1,0.3,1) both;
  max-width: 100%;
}
#toast-stack .toast.toast-exit { animation: toastOut 240ms ease forwards; }
#toast-stack .toast-icon {
  font-size: 14px;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
}
#toast-stack .toast-msg { flex: 1; line-height: 1.4; }
#toast-stack .toast.toast-success .toast-icon { color: var(--green); }
#toast-stack .toast.toast-error .toast-icon { color: var(--red); }
#toast-stack .toast.toast-warning .toast-icon { color: var(--amber); }
#toast-stack .toast.toast-info .toast-icon { color: var(--text-sec); }
#toast-stack .toast.toast-success { border-left: 2.5px solid var(--green); }
#toast-stack .toast.toast-error { border-left: 2.5px solid var(--red); }
#toast-stack .toast.toast-warning { border-left: 2.5px solid var(--amber); }
@media (max-width: 767px) {
  #toast-stack { bottom: 90px; }
}
