/* =========================================================
   MAY.AZ — Design tokens
   Palette: white / light-grey / ultramarine blue (per brief)
   Display: Space Grotesk · Body: Inter · Address/mono: JetBrains Mono
   Signature: the live "@may.az" address builder in the hero
   ========================================================= */

:root {
  --bg: #ffffff;
  --bg-alt: #f4f6fb;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --border: #e5e9f2;
  --text: #0f1727;
  --text-muted: #5b6472;
  --text-faint: #8a93a3;

  --primary: #2a52f5;
  --primary-dark: #1a3bd1;
  --primary-tint: #eaefff;

  --accent: #14b8a6;      /* "reserved / available" teal — signature accent */
  --accent-tint: #e4f9f6;

  --danger: #e5484d;
  --danger-tint: #fdeceb;
  --warning: #c98a12;
  --warning-tint: #fbf1de;
  --success: #17a56a;
  --success-tint: #e7f8f0;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 39, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 39, 0.08);
  --shadow-lg: 0 24px 60px rgba(15, 23, 39, 0.12);

  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

html[data-theme='dark'] {
  --bg: #0a0f1c;
  --bg-alt: #0e1526;
  --surface: #121a2c;
  --surface-raised: #161f34;
  --border: #22304a;
  --text: #eef1f8;
  --text-muted: #a0aabd;
  --text-faint: #6b7690;

  --primary: #5c7dff;
  --primary-dark: #7c98ff;
  --primary-tint: #16204a;

  --accent: #2dd4c2;
  --accent-tint: #0f2c2a;

  --danger: #ff6b6f;
  --danger-tint: #2c1516;
  --warning: #e2ab4f;
  --warning-tint: #2a2110;
  --success: #34d399;
  --success-tint: #0f2a20;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}

h1, h2, h3, h4, .font-display {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
}

a { color: inherit; text-decoration: none; }

.font-mono { font-family: var(--font-mono); }

.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.logo { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.logo .dot { color: var(--accent); }
.nav-actions { display: flex; align-items: center; gap: 10px; }

.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); display: grid; place-items: center; cursor: pointer;
  color: var(--text-muted);
}
.theme-toggle:hover { color: var(--primary); border-color: var(--primary); }
.notif-dot {
  position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  line-height: 1; border: 2px solid var(--bg);
}

@media (max-width: 640px) {
  .nav-actions { overflow-x: auto; scrollbar-width: none; }
  .nav-actions::-webkit-scrollbar { display: none; }
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius-sm); font-weight: 600; font-size: 15px;
  border: 1px solid transparent; cursor: pointer; transition: all .18s ease;
  font-family: var(--font-body);
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-lg { padding: 16px 32px; font-size: 17px; border-radius: var(--radius-md); }
.btn-block { width: 100%; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 8px; }

/* ---------------- Hero ---------------- */
.announcement-bar { background: var(--primary); color: #fff; }
.announcement-inner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 24px; font-size: 13.5px; }
.announcement-inner a { text-decoration: underline; font-weight: 600; }

.hero { padding: 88px 0 64px; position: relative; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset: -20% -10% auto -10%; height: 480px;
  background: radial-gradient(60% 60% at 50% 0%, var(--primary-tint), transparent 70%);
  z-index: -1;
}
.hero-bg-visual {
  position: absolute; top: -30px; right: -70px; left: auto; transform: none;
  width: 78vw; max-width: 420px; height: auto; opacity: 0.28; z-index: 0;
  pointer-events: none; animation: heroFloat 7s ease-in-out infinite;
  -webkit-mask-image: linear-gradient(to bottom left, black 25%, transparent 78%);
  mask-image: linear-gradient(to bottom left, black 25%, transparent 78%);
}
.hero-content { position: relative; z-index: 1; }
@keyframes heroFloat { 0%, 100% { margin-top: 0; } 50% { margin-top: -14px; } }

@media (min-width: 980px) {
  .hero-bg-visual {
    top: 50%; right: -60px; transform: translateY(-50%);
    width: 620px; max-width: 55vw; opacity: 0.5;
    -webkit-mask-image: linear-gradient(to left, black 55%, transparent 92%);
    mask-image: linear-gradient(to left, black 55%, transparent 92%);
  }
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600;
  color: var(--primary); background: var(--primary-tint); padding: 6px 14px; border-radius: 999px;
  margin-bottom: 22px;
}
.eyebrow .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 1.8s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

.hero h1 { font-size: clamp(34px, 5.4vw, 60px); max-width: 820px; }
.hero .lead { font-size: 18px; color: var(--text-muted); max-width: 560px; margin-top: 20px; line-height: 1.6; }
.hero-actions { display: flex; gap: 14px; margin-top: 34px; flex-wrap: wrap; }

/* --- Signature element: live address builder --- */
.address-builder {
  margin-top: 56px; max-width: 620px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 28px;
}
.address-builder label { font-size: 13px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.address-row { display: flex; align-items: center; margin-top: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--bg-alt); }
.address-row input {
  flex: 1; border: none; background: transparent; padding: 18px 18px; font-family: var(--font-mono);
  font-size: 19px; color: var(--text); outline: none; min-width: 0;
}
.address-suffix {
  font-family: var(--font-mono); font-size: 19px; color: var(--text-faint); padding: 18px 18px 18px 0;
  white-space: nowrap;
}
.address-status { margin-top: 14px; font-size: 14px; min-height: 22px; display: flex; align-items: center; gap: 8px; }
.address-status.ok { color: var(--success); }
.address-status.taken { color: var(--danger); }
.address-status.checking { color: var(--text-faint); }
.suggestion-chip {
  display: inline-flex; align-items: center; font-family: var(--font-mono); font-size: 13px;
  background: var(--accent-tint); color: var(--accent); border: 1px solid transparent; padding: 6px 12px;
  border-radius: 999px; cursor: pointer; margin: 4px 6px 0 0; transition: all .15s ease;
}
.suggestion-chip:hover { border-color: var(--accent); transform: translateY(-1px); }

/* ---------------- Stats block ---------------- */
.stats-block { padding: 40px 0 90px; }
.stats-lead { text-align: center; font-size: 15px; color: var(--text-muted); margin: 0 0 22px; }
.stats-lead strong { color: var(--primary); font-size: 17px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 30px 26px; box-shadow: var(--shadow-sm);
}
.stat-number { font-family: var(--font-display); font-size: 40px; font-weight: 700; color: var(--text); }
.stat-label { color: var(--text-muted); font-size: 14px; margin-top: 6px; }
.stat-card.accent .stat-number { color: var(--primary); }

/* ---------------- Milestone progress ---------------- */
.milestone-section { padding: 0 0 90px; }
.milestone-card { max-width: 620px; margin: 0 auto; }
.milestone-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.milestone-count { font-family: var(--font-mono); font-size: 13px; color: var(--text-faint); }
.progress-track { height: 10px; border-radius: 999px; background: var(--bg-alt); border: 1px solid var(--border); margin-top: 18px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .6s ease; }

/* ---------------- Why-reserve section ---------------- */
.why-section { padding: 0 0 90px; }
.why-item { display: flex; align-items: flex-start; gap: 12px; padding: 22px; }
.why-check {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-tint); color: var(--accent);
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.why-item p { margin: 0; color: var(--text); font-size: 15px; line-height: 1.5; padding-top: 3px; }

/* ---------------- Activity section (recent users / popular usernames) ---------------- */
.activity-section { padding: 0 0 90px; }
.activity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.activity-list { display: flex; flex-direction: column; gap: 4px; }
.activity-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 4px; border-bottom: 1px solid var(--border); font-size: 14px; }
.activity-row:last-child { border-bottom: none; }
.activity-time { color: var(--text-faint); font-size: 12.5px; }

@media (max-width: 860px) {
  .activity-grid { grid-template-columns: 1fr; }
}

/* ---------------- How it works ---------------- */
.steps { padding: 20px 0 100px; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 40px; }
.step-card { position: relative; padding: 30px 24px; }
.step-num { font-family: var(--font-mono); font-size: 13px; color: var(--primary); font-weight: 700; }
.step-card h3 { margin-top: 14px; font-size: 20px; }
.step-card p { color: var(--text-muted); margin-top: 10px; line-height: 1.6; font-size: 15px; }

.section-heading { text-align: center; max-width: 560px; margin: 0 auto; }
.section-heading h2 { font-size: clamp(26px, 3.4vw, 36px); }
.section-heading p { color: var(--text-muted); margin-top: 14px; }

/* ---------------- Ecosystem strip (homepage, deliberately quiet) ---------------- */
.ecosystem-strip { padding: 8px 0 64px; }
.ecosystem-strip-inner {
  display: flex; align-items: center; justify-content: center; gap: 8px 20px; flex-wrap: wrap;
  padding: 20px 24px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.ecosystem-strip-label { font-size: 12.5px; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: .05em; }
.ecosystem-strip-links { display: flex; gap: 18px; flex-wrap: wrap; }
.ecosystem-strip-links a { font-size: 13.5px; color: var(--text-muted); }
.ecosystem-strip-links a:hover { color: var(--primary); }

/* ---------------- Cards / forms (auth, profile) ---------------- */
.auth-wrap { min-height: calc(100vh - 72px); display: flex; align-items: center; justify-content: center; padding: 60px 20px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); padding: 40px;
}
.card-narrow { width: 100%; max-width: 440px; }
.card-wide { width: 100%; max-width: 620px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-alt); color: var(--text); font-size: 15px; font-family: var(--font-body); outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-tint);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-help { font-size: 12.5px; color: var(--text-faint); margin-top: 6px; }
.field-error { font-size: 12.5px; color: var(--danger); margin-top: 6px; }

.radio-group { display: flex; gap: 10px; }
.radio-pill {
  flex: 1; text-align: center; padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text-muted); background: var(--bg-alt);
}
.radio-pill input { display: none; }
.radio-pill.active { border-color: var(--primary); color: var(--primary); background: var(--primary-tint); }

.strength-meter { display: flex; gap: 5px; margin-top: 10px; }
.strength-meter span { height: 5px; flex: 1; border-radius: 3px; background: var(--border); transition: background .2s ease; }
.strength-label { font-size: 12.5px; margin-top: 6px; font-weight: 600; }

.alert { padding: 14px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 18px; border: 1px solid transparent; }
.alert-error { background: var(--danger-tint); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.alert-success { background: var(--success-tint); color: var(--success); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.alert ul { margin: 6px 0 0; padding-left: 18px; }

.divider-text { display: flex; align-items: center; gap: 12px; color: var(--text-faint); font-size: 13px; margin: 22px 0; }
.divider-text::before, .divider-text::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { background: var(--bg-alt); color: var(--text-muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-alt); }

.badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-active { background: var(--success-tint); color: var(--success); }
.badge-banned { background: var(--danger-tint); color: var(--danger); }
.badge-admin { background: var(--primary-tint); color: var(--primary); }

/* ---------------- Footer ---------------- */
.site-footer { border-top: 1px solid var(--border); padding: 50px 0; margin-top: 60px; color: var(--text-muted); }
.footer-grid { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; font-size: 14px; }
.footer-links a:hover { color: var(--primary); }

.footer-badge {
  display: inline-flex; align-items: center; padding: 8px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); opacity: 0.75; transition: opacity .15s ease, border-color .15s ease;
}
.footer-badge:hover { opacity: 1; border-color: var(--primary); }
.footer-badge img { display: block; height: 31px; width: auto; }

/* ---------------- Avatar ---------------- */
.avatar { border-radius: 50%; object-fit: cover; background: var(--primary-tint); display: inline-flex; align-items: center; justify-content: center; color: var(--primary); font-weight: 700; font-family: var(--font-display); }

/* ---------------- Share buttons / status banner ---------------- */
.share-card { text-align: center; }
.share-buttons { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 20px; }
.share-btn {
  display: inline-flex; align-items: center; justify-content: center; padding: 10px 18px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600; border: 1px solid var(--border); background: var(--bg-alt); color: var(--text); cursor: pointer;
  transition: all .15s ease;
}
.share-btn:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }

.status-banner {
  display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px; border-radius: var(--radius-md);
  background: var(--accent-tint); border: 1px solid transparent;
}
.status-icon { font-size: 20px; line-height: 1; }

/* ---------------- Misc ---------------- */
.page-hero { padding: 60px 0 20px; text-align: center; }
.page-hero h1 { font-size: clamp(28px, 4vw, 42px); }
.page-hero p { color: var(--text-muted); margin-top: 12px; }
.content-page { padding: 40px 0 90px; }
.content-page .card { max-width: 820px; margin: 0 auto; }
.content-page h2 { font-size: 20px; margin-top: 28px; margin-bottom: 10px; }
.content-page h2:first-child { margin-top: 0; }
.content-page p, .content-page li { color: var(--text-muted); line-height: 1.75; font-size: 15px; }

.faq-list { display: flex; flex-direction: column; gap: 4px; }
.faq-item { border-bottom: 1px solid var(--border); padding: 16px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-item summary { cursor: pointer; font-weight: 600; font-size: 15px; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 20px; color: var(--text-faint); font-weight: 400; }
.faq-item[open] summary::after { content: '−'; }
.faq-item p { margin-top: 12px; margin-bottom: 0; }

.toggle-tabs { display: flex; gap: 8px; max-width: 1100px; margin: 0 auto 16px; }
.toggle-tab {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); font-size: 13px; font-weight: 600; cursor: pointer;
}
.toggle-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.admin-shell { display: flex; min-height: calc(100vh - 72px); }
.admin-sidebar-toggle {
  display: none; align-items: center; gap: 10px; width: 100%; padding: 14px 20px; background: var(--surface);
  border: none; border-bottom: 1px solid var(--border); color: var(--text); font-weight: 600; font-size: 14px; cursor: pointer;
}
.admin-sidebar { width: 240px; border-right: 1px solid var(--border); padding: 26px 16px; flex-shrink: 0; }
.admin-sidebar a { display: block; padding: 11px 14px; border-radius: 10px; color: var(--text-muted); font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.admin-sidebar a:hover { background: var(--bg-alt); color: var(--text); }
.admin-sidebar a.active { background: var(--primary-tint); color: var(--primary); font-weight: 600; }
.admin-main { flex: 1; padding: 32px; min-width: 0; }
.admin-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 30px; }
.admin-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 22px; }
.admin-card .num { font-family: var(--font-display); font-size: 28px; font-weight: 700; }
.admin-card .lbl { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

.toolbar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; }
.filters select, .filters input { padding: 9px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-alt); color: var(--text); font-size: 13px; }

.modal-overlay { position: fixed; inset: 0; background: rgba(10, 14, 25, .55); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border-radius: var(--radius-lg); padding: 28px; max-width: 440px; width: 100%; box-shadow: var(--shadow-lg); }

@media (max-width: 860px) {
  .stats-grid, .steps-grid { grid-template-columns: 1fr; }
  .admin-cards { grid-template-columns: repeat(2, 1fr); }
  .admin-shell { flex-direction: column; }
  .admin-sidebar-toggle { display: flex; }
  .admin-sidebar {
    width: 100%; border-right: none; border-bottom: 1px solid var(--border);
    max-height: 0; overflow: hidden; padding: 0 16px; transition: max-height .25s ease, padding .25s ease;
  }
  .admin-sidebar.open { max-height: 400px; padding: 12px 16px; }
  .field-row { grid-template-columns: 1fr; }
  .footer-grid { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
