:root {
  --bg: #0b0d12;
  --panel: #141821;
  --panel-2: #1b2130;
  --line: #2a3244;
  --text: #f4f6fb;
  --muted: #9ba7bd;
  --accent: #7c9cff;
  --accent-2: #9b7cff;
  --danger: #ff6b76;
  --success: #4bd69a;
  --shadow: 0 24px 80px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 0%, rgba(124, 156, 255, .14), transparent 32rem),
    radial-gradient(circle at 90% 20%, rgba(155, 124, 255, .10), transparent 30rem),
    var(--bg);
}
a { color: #b9c8ff; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.shell { width: min(1120px, calc(100% - 28px)); margin: 0 auto; }
.site-header {
  min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: white; font-weight: 900;
  box-shadow: 0 12px 30px rgba(124, 156, 255, .25);
}
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); font-size: 12px; margin-top: 2px; }
nav { display: flex; gap: 18px; }
nav a { color: var(--muted); text-decoration: none; font-size: 14px; }
nav a:hover { color: var(--text); }
.panel {
  background: linear-gradient(180deg, rgba(255,255,255,.025), transparent 30%), var(--panel);
  border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); overflow: hidden;
}
.hero { min-height: 600px; display: grid; grid-template-columns: 1.05fr .95fr; }
.hero-copy { padding: clamp(34px, 6vw, 76px); display: flex; flex-direction: column; justify-content: center; }
.eyebrow { color: #b7c5f8; letter-spacing: .08em; text-transform: uppercase; font-size: 12px; font-weight: 800; }
h1 { margin: 18px 0; font-size: clamp(40px, 6vw, 68px); line-height: .98; letter-spacing: -.045em; }
.hero-copy > p { color: var(--muted); font-size: 18px; line-height: 1.65; max-width: 620px; }
.safety-note { margin-top: 28px; padding: 16px 18px; border: 1px solid #394158; border-radius: 15px; color: #cbd3e5; background: rgba(255,255,255,.025); line-height: 1.5; }
.match-form { padding: clamp(28px, 4vw, 54px); background: rgba(255,255,255,.022); border-left: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
label, .age-range > span { color: #cdd4e4; font-size: 14px; font-weight: 650; }
input, select, textarea {
  width: 100%; margin-top: 8px; color: var(--text); background: #0f131b; border: 1px solid #343d52;
  border-radius: 12px; padding: 13px 14px; outline: none; transition: .2s border-color, .2s box-shadow;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,156,255,.13); }
.age-range { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.age-range > span { grid-column: 1 / -1; }
.age-range label { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px; }
.age-range input { margin-top: 0; }
.check-line { display: flex; gap: 11px; align-items: flex-start; font-weight: 450; line-height: 1.45; color: var(--muted); }
.check-line input { width: 18px; height: 18px; margin: 2px 0 0; flex: 0 0 auto; }
.primary, .secondary, .danger, .danger-ghost {
  border: 0; border-radius: 12px; min-height: 45px; padding: 0 18px; font-weight: 800;
}
.primary { color: #0b1020; background: linear-gradient(135deg, #9fb4ff, #b39cff); }
.primary:hover { filter: brightness(1.07); }
.secondary { color: var(--text); background: #242b3a; border: 1px solid #3a4459; }
.danger { color: white; background: #b93e4a; }
.danger-ghost { color: #ffabb1; background: transparent; border: 1px solid #6f3740; }
.form-error { min-height: 20px; margin: 0; color: #ff9aa3; font-size: 14px; }
.hidden { display: none !important; }
.state-panel { min-height: 560px; display: grid; place-content: center; justify-items: center; text-align: center; padding: 30px; }
.state-panel h2 { margin: 26px 0 8px; font-size: clamp(28px, 5vw, 42px); }
.state-panel p { color: var(--muted); max-width: 580px; line-height: 1.6; }
.state-actions { display: flex; gap: 12px; margin-top: 22px; }
.pulse { display: flex; gap: 9px; }
.pulse span { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); animation: pulse 1.1s infinite ease-in-out; }
.pulse span:nth-child(2) { animation-delay: .14s; }
.pulse span:nth-child(3) { animation-delay: .28s; }
@keyframes pulse { 0%, 70%, 100% { transform: scale(.65); opacity: .45; } 35% { transform: scale(1); opacity: 1; } }
.chat-panel { height: min(760px, calc(100vh - 128px)); min-height: 560px; display: grid; grid-template-rows: auto 1fr auto auto auto; }
.chat-header { padding: 17px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.chat-header > div:first-child { display: grid; grid-template-columns: auto 1fr; column-gap: 9px; align-items: center; }
.chat-header small { color: var(--muted); grid-column: 2; margin-top: 3px; }
.online-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 5px rgba(75,214,154,.09); }
.chat-actions { display: flex; gap: 8px; }
.messages { padding: 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; background: rgba(6,8,12,.22); }
.message { max-width: min(78%, 700px); padding: 11px 14px 8px; border-radius: 15px; line-height: 1.48; overflow-wrap: anywhere; white-space: pre-wrap; }
.message.mine { align-self: flex-end; background: #334b88; border-bottom-right-radius: 5px; }
.message.theirs { align-self: flex-start; background: var(--panel-2); border: 1px solid #30394d; border-bottom-left-radius: 5px; }
.message time { display: block; margin-top: 5px; font-size: 10px; opacity: .62; text-align: right; }
.chat-notice { min-height: 18px; margin: 0; padding: 0 20px; color: #ff9aa3; font-size: 13px; }
.composer { padding: 12px 16px 8px; display: grid; grid-template-columns: 1fr auto; gap: 10px; border-top: 1px solid var(--line); }
.composer textarea { margin: 0; min-height: 54px; max-height: 150px; resize: vertical; }
.composer button { align-self: stretch; }
.composer-help { padding: 0 18px 13px; color: #7f8aa0; font-size: 11px; }
footer { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 18px; color: #768197; font-size: 12px; }
dialog { width: min(560px, calc(100% - 24px)); color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 0; }
dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(5px); }
dialog form { position: relative; display: grid; gap: 16px; padding: 28px; }
dialog h2 { margin: 0; }
dialog p { margin: 0; color: var(--muted); }
.dialog-close { position: absolute; right: 15px; top: 12px; color: var(--muted); background: transparent; border: 0; font-size: 28px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.legal { max-width: 850px; margin: 0 auto; padding: 38px; }
.legal h1 { font-size: clamp(36px, 6vw, 56px); }
.legal h2 { margin-top: 34px; }
.legal p, .legal li { color: #b8c1d3; line-height: 1.75; }
@media (max-width: 820px) {
  nav { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding-bottom: 30px; }
  .match-form { border-left: 0; border-top: 1px solid var(--line); }
  .chat-panel { height: calc(100vh - 100px); }
}
@media (max-width: 560px) {
  .shell { width: min(100% - 16px, 1120px); }
  .site-header { min-height: 68px; }
  .hero-copy, .match-form { padding: 25px 20px; }
  h1 { font-size: 41px; }
  .form-grid { grid-template-columns: 1fr; }
  .age-range { grid-column: auto; }
  .chat-header { align-items: flex-start; }
  .chat-actions { flex-direction: column; }
  .chat-actions button { min-height: 36px; padding: 0 11px; font-size: 12px; }
  .messages { padding: 15px; }
  .message { max-width: 88%; }
  .composer { grid-template-columns: 1fr; }
  .composer button { min-height: 46px; }
  footer { flex-direction: column; justify-content: center; align-items: flex-start; }
}
