/* Consolidated stylesheet for the Align app
   Merged from inline styles across public/*.html for easier editing
   Keep the Google Fonts <link> in HTML files — add 'Playfair Display' or
   'Cormorant Garamond' alongside Inter for the serif accents below.
*/
:root {
  /* Core palette — deep wine, warm gold accent */
  --bg: #1a0e14;
  --bg-alt: #12080d;
  --surface: #2a1620;
  --surface-hover: #3a1f2c;
  --primary: #c9955a;        /* warm gold */
  --primary-hover: #e0ab6e;
  --primary-muted: rgba(201, 149, 90, 0.12);
  --accent: #8b2942;         /* deep rose/wine, for secondary emphasis */
  --text: #f5e9e4;
  --text-muted: #b39a9c;
  --border: #4a2c38;
  --danger: #e0475a;
  --success: #4caf82;

  /* Shared design tokens */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-pill: 99px;
  --shadow-glow: 0 0 24px rgba(201, 149, 90, 0.15);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.35);
  --font-body: 'Inter', sans-serif;
  --font-display: 'Playfair Display', serif;
}

/* Reset & base */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: var(--font-body); }
html, body { height: 100%; }
body {
  background: radial-gradient(circle at top, var(--bg) 0%, var(--bg-alt) 100%);
  color: var(--text);
}

a { color: inherit; }

h1, h2, h3, .logo, .chat-header { font-family: var(--font-display); letter-spacing: 0.02em; }

/* Generic layout */
.container { max-width: 900px; margin: 2rem auto; padding: 0 1rem; }
.card {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.85rem 1.35rem;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: var(--bg-alt);
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  transition: transform 0.18s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}
button:hover, .button:hover { box-shadow: var(--shadow-glow); transform: translateY(-1px); }
.button.secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  box-shadow: none;
}
.button.secondary:hover { background: rgba(255, 255, 255, 0.1); }
.button.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
}
.button.accent {
  background: linear-gradient(135deg, #ec4899, #be185d);
  color: #fff;
}
.button.accent:hover { box-shadow: 0 18px 40px rgba(236, 72, 153, 0.24); }

select, input, textarea {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
}
select:focus, input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-muted);
}

.input-hero {
  flex-grow: 1;
  border-radius: var(--radius);
  background: rgba(15, 10, 14, 0.92);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.dashboard-grid { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .dashboard-grid { grid-template-columns: 1.5fr 1fr; } }

.module { border: 1px solid rgba(255, 255, 255, 0.06); background: rgba(22, 11, 18, 0.88); position: relative; overflow: hidden; }
.module--glow::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at top right, rgba(201, 149, 90, 0.2), transparent 32%);
}
.module--accent { background: linear-gradient(180deg, rgba(58, 27, 44, 0.95), rgba(38, 12, 24, 0.96)); border-color: rgba(236, 72, 153, 0.18); }

.module-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.module-label { font-size: 0.76rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.18em; margin-bottom: 0.35rem; }
.module-copy { color: var(--text-muted); margin-top: 0.5rem; line-height: 1.75; }

.preference-toolbar {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  align-items: center;
}
.preference-toolbar .input-hero {
  width: 100%;
}
.preference-summary {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
}
.preference-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-top: 1.5rem;
}
.preference-footer .text-muted {
  margin-left: auto;
  color: var(--text-muted);
}
.preference-empty {
  padding: 1.5rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  text-align: center;
}
.kink-item {
  display: grid;
  grid-template-columns: 1fr 150px;
  align-items: center;
  gap: 0.95rem;
  padding: 1rem 1.1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  transition: background 0.2s ease, transform 0.18s ease, border-color 0.2s ease;
}
.kink-item:hover { background: rgba(255, 255, 255, 0.06); transform: translateY(-1px); }
.kink-item.selected {
  background: linear-gradient(135deg, rgba(201, 149, 90, 0.15), rgba(255, 255, 255, 0.05));
  border-color: rgba(201, 149, 90, 0.3);
}
.kink-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-weight: 600;
  position: relative;
}
.kink-checkbox input {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 1.2rem;
  height: 1.2rem;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.9rem;
  background: rgba(15, 10, 14, 0.95);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.18s ease;
}
.kink-checkbox input:checked {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  border-color: rgba(224, 171, 110, 0.9);
  animation: toggle-pulse 0.32s ease-out;
}
.kink-checkbox input:checked::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.34rem;
  height: 0.7rem;
  border: solid #0f172a;
  border-width: 0 0.18rem 0.18rem 0;
  transform: translate(-50%, -50%) rotate(45deg);
}

@keyframes toggle-pulse {
  0% { transform: scale(0.95); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.kink-checkbox span {
  display: inline-block;
}
.kink-mode {
  min-width: 130px;
  padding: 0.75rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 10, 14, 0.92);
  color: var(--text);
}
.kink-mode:disabled { opacity: 0.55; }

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.status-chip--live { background: rgba(72, 187, 120, 0.14); color: #bef264; border: 1px solid rgba(72, 187, 120, 0.22); }
.status-chip--pending { background: rgba(251, 191, 36, 0.14); color: #fef08a; border: 1px solid rgba(251, 191, 36, 0.24); }
.status-chip--locked { background: rgba(236, 72, 153, 0.16); color: #f9a8d4; border: 1px solid rgba(236, 72, 153, 0.24); }
.status-chip--success { background: rgba(74, 222, 128, 0.16); color: #bbf7d0; border: 1px solid rgba(74, 222, 128, 0.24); }

.hero-panel { display: flex; flex-direction: column; gap: 1.5rem; padding: 2rem; background: rgba(12, 7, 11, 0.72); border-radius: var(--radius); border: 1px solid rgba(255, 255, 255, 0.06); margin-bottom: 1.5rem; box-shadow: 0 18px 60px rgba(0, 0, 0, 0.24); }
.hero-panel h1 { font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.02; margin-bottom: 0.35rem; color: #fff; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.18em; color: var(--primary); font-size: 0.75rem; margin-bottom: 0.25rem; }
.hero-copy { color: var(--text-muted); max-width: 640px; line-height: 1.8; }
.hero-stat-panel { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; }
.stat-card { background: rgba(255, 255, 255, 0.04); padding: 1.15rem 1.2rem; border-radius: var(--radius-sm); border: 1px solid rgba(255, 255, 255, 0.06); }
.stat-value { font-size: 2rem; font-weight: 700; color: #fff; display: block; }
.stat-label { color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.78rem; margin-top: 0.35rem; }

.result-list { margin-top: 1rem; display: grid; gap: 0.9rem; }
.result-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; padding: 1rem; border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.06); transition: transform 0.18s ease, background 0.18s ease; }
.result-item:hover { transform: translateY(-1px); background: rgba(255, 255, 255, 0.06); }
.result-meta { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.result-name { font-weight: 700; }
.result-status { color: var(--text-muted); font-size: 0.85rem; max-width: 34rem; word-break: break-word; overflow-wrap: anywhere; }
.result-status.copyable { cursor: pointer; border-bottom: 1px dashed rgba(255,255,255,0.35); padding-bottom: 0.1rem; }
.result-status.copyable:hover { color: #fff; border-color: rgba(255,255,255,0.65); }
.result-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }
.pending-list { display: flex; flex-direction: column; gap: 0.85rem; margin-top: 1rem; }
.pending-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem; border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.06); }
.compatibility-panel { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid rgba(255, 255, 255, 0.08); display: none; opacity: 0; transition: opacity 0.25s ease; }
.compatibility-panel.visible { display: block; opacity: 1; }
.invite-result { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.85rem; }
.action-row { margin-top: 1rem; display: flex; gap: 0.75rem; flex-wrap: wrap; }
.input-select { width: 100%; border-radius: var(--radius); background: rgba(15, 10, 14, 0.92); color: var(--text); border: 1px solid rgba(255, 255, 255, 0.1); }
@media (min-width: 660px) { .search-row { flex-wrap: wrap; } .search-row .input-select { flex: 1; min-width: 0; } .action-row { justify-content: flex-start; } }

#toast-container { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 0.75rem; z-index: 9999; pointer-events: none; }
.toast { min-width: 260px; padding: 1rem 1.2rem; border-radius: var(--radius); background: rgba(23, 18, 24, 0.96); backdrop-filter: blur(10px); color: #f8fafc; border: 1px solid rgba(255, 255, 255, 0.08); box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22); opacity: 0; transform: translateY(10px); transition: opacity 0.22s ease, transform 0.22s ease; pointer-events: auto; }
.toast--visible { opacity: 1; transform: translateY(0); }
.toast--error { border-color: rgba(248, 113, 113, 0.35); background: rgba(135, 24, 24, 0.92); }
.toast--success { border-color: rgba(34, 197, 94, 0.35); background: rgba(22, 101, 52, 0.95); }
.toast--info { border-color: rgba(59, 130, 246, 0.35); background: rgba(30, 64, 175, 0.95); }

.page-shell { position: relative; min-height: 100vh; padding-bottom: 2rem; }
.auth-card { max-width: 460px; margin: 4rem auto; padding: 2rem; text-align: center; }
.auth-card .logo { font-size: 2.5rem; margin-bottom: 0.75rem; color: var(--primary); }
.auth-form { display: grid; gap: 1rem; margin-top: 1.5rem; }
.auth-meta { color: var(--text-muted); margin-top: 1.25rem; }
.auth-meta a { color: var(--primary); text-decoration: none; }
.auth-meta a:hover { text-decoration: underline; }

nav, header {
  background: rgba(17, 9, 15, 0.88);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
}
.nav-links { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-weight: 500; transition: color 0.2s ease; }
.nav-links a.active, .nav-links a:hover { color: var(--primary); }

.brand-logo {
  font-size: 2.35rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: transparent;
  background: linear-gradient(135deg, #f8e4c4 0%, #c9955a 48%, #e0ab6e 100%);
  background-clip: text;
  -webkit-background-clip: text;
  text-shadow: 0 0 20px rgba(201, 149, 90, 0.18);
  position: relative;
  transition: transform 0.3s ease, text-shadow 0.3s ease;
}
.brand-logo::before {
  content: 'A';
  position: absolute;
  left: 0.1rem;
  top: 0.08rem;
  color: rgba(255, 255, 255, 0.12);
  opacity: 0.25;
  filter: blur(0.5px);
  transform: scale(1.03);
}
.brand-logo::after {
  content: '';
  position: absolute;
  right: -0.6rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 999px;
  background: radial-gradient(circle, #f8e4c4 0%, rgba(201, 149, 90, 0.9) 35%, transparent 70%);
  box-shadow: 0 0 20px rgba(201, 149, 90, 0.35);
  opacity: 0.85;
  animation: logo-accent-pulse 1.8s ease-in-out infinite;
}
.brand-logo:hover {
  transform: translateY(-2px) scale(1.03);
  text-shadow: 0 0 28px rgba(201, 149, 90, 0.28);
}
.brand-logo.logo-animate {
  animation: logo-flicker 1s ease forwards;
}

@keyframes logo-flicker {
  0% { transform: scale(1) translateY(0); filter: brightness(1); }
  30% { transform: scale(1.04) translateY(-2px); filter: brightness(1.2); }
  60% { transform: scale(1.02) translateY(-1px); filter: brightness(1.1); }
  100% { transform: scale(1) translateY(0); filter: brightness(1); }
}

@keyframes logo-accent-pulse {
  0%, 100% { transform: translateY(-50%) scale(1); opacity: 0.85; }
  50% { transform: translateY(-50%) scale(1.18); opacity: 1; }
}

@media (max-width: 840px) {
  .nav-links { justify-content: flex-end; }
}
.badge {
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  display: inline-block;
  margin: 0.2rem;
  opacity: 0;
  transform: translateY(10px) scale(0.92);
  animation: badge-pop 0.35s ease forwards;
}
.badge:nth-child(1) { animation-delay: 0s; }
.badge:nth-child(2) { animation-delay: 0.06s; }
.badge:nth-child(3) { animation-delay: 0.12s; }
.badge:nth-child(4) { animation-delay: 0.18s; }
.badge:nth-child(5) { animation-delay: 0.24s; }
@keyframes badge-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.badge-green {
  background: #16a34a;
  color: #f8fafc;
}
.badge-red {
  background: #dc2626;
  color: #f8fafc;
}
.badge-yellow {
  background: #f59e0b;
  color: #0f172a;
}
.badge-purple {
  background: #7c3aed;
  color: #f8fafc;
}

.compatibility-key {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
  transition: box-shadow 0.35s ease, transform 0.35s ease;
}
.compatibility-key.legend-highlight {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 0 24px rgba(201, 149, 90, 0.18);
  transform: translateY(-1px);
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}
.legend-swatch {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.legend-green { background: #16a34a; }
.legend-purple { background: #7c3aed; }
.legend-yellow { background: #f59e0b; }
.legend-red { background: #dc2626; }

/* Dashboard-specific helpers */
.search-row { display: flex; gap: 0.5rem; margin-top: 1rem; }
.search-row input[type=text] {
  flex-grow: 1;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
}

/* Preferences / index views */
.grid { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .grid { grid-template-columns: 1fr 1fr; } }

.kink-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; margin-bottom: 1.5rem; }
.kink-label {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  font-size: 0.9rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.kink-label input { display: none; }
.kink-label.selected {
  background: var(--primary-muted);
  border-color: var(--primary);
  color: var(--primary);
}

.kink-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.kink-item.selected {
  border-color: var(--primary);
  background: var(--primary-muted);
  color: var(--primary);
}
.kink-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  flex-grow: 1;
  margin-right: 0.5rem;
}
.kink-checkbox input {
  accent-color: var(--primary);
}
.kink-mode {
  min-width: 120px;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.badge-container { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }

/* Toasts */
/* Messages layout */
.main-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  flex-grow: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem;
  gap: 1.5rem;
}
.sidebar {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 140px);
}
.sidebar h3 { font-size: 1rem; margin-bottom: 1rem; color: var(--text-muted); font-family: var(--font-body); }
.connection-list { overflow-y: auto; flex-grow: 1; display: flex; flex-direction: column; gap: 0.5rem; }
.connection-item {
  padding: 0.75rem 1rem;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  border: 1px solid transparent;
}
.connection-item:hover { background: var(--surface-hover); }
.connection-item.active { border-color: var(--primary); background: var(--surface-hover); }

.chat-container {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 140px);
}
.chat-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 1.15rem; }
.chat-messages { flex-grow: 1; padding: 1.5rem; overflow-y: auto; display: flex; flex-direction: column; gap: 1rem; }

.message { max-width: 70%; padding: 0.75rem 1rem; border-radius: var(--radius-sm); font-size: 0.9rem; line-height: 1.4; word-break: break-word; }
.message.sent {
  background: linear-gradient(135deg, var(--accent), #6e1f34);
  color: var(--text);
  align-self: flex-end;
}
.message.received { background: var(--bg-alt); color: var(--text); align-self: flex-start; border: 1px solid var(--border); }

.chat-input-area { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; gap: 0.75rem; }
.chat-input-area input { background: var(--bg-alt); border: 1px solid var(--border); color: var(--text); flex-grow: 1; }
.chat-input-area input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-muted); }

/* Small utilities */
.text-muted { color: var(--text-muted); }
.center { text-align: center; }

/* Forms and misc */
.tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.card .logo { font-size: 2.1rem; text-align: center; margin-bottom: 0.5rem; }
