/* ===== afinka — Apple-inspired graphite / black / white ===== */
:root {
  --bg: #0a0a0a;
  --bg-elevated: #1d1d1f;
  --bg-card: #161618;
  --text: #f5f5f7;
  --text-secondary: #86868b;
  --accent: #f5f5f7;
  --border: rgba(255, 255, 255, .15);
  --border-active: rgba(255, 255, 255, .8);
  --cat-fur: #cc683d;
  --cat-deep: #783b24;
  --cat-light: #eda97b;
  --cat-shadow: #ad502e;
  --cat-keyboard: #66715b;
  --radius: 980px;
  --radius-card: 18px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body { min-height: 100vh; line-height: 1.6; }

/* ---- typography ---- */
h1, h2, h3, .hero-title { font-weight: 600; letter-spacing: -.02em; }
.accent { color: var(--cat-fur); }
.wordmark { font-size: 1.15rem; font-weight: 600; letter-spacing: -.01em; color: var(--text); text-decoration: none; }
.wordmark.center { display: block; text-align: center; font-size: 1.4rem; margin-bottom: 1.5rem; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .7rem 1.8rem; font-size: .9rem; font-weight: 500; font-family: inherit;
  border-radius: var(--radius); cursor: pointer; text-decoration: none;
  transition: background .2s, border-color .2s, color .2s, opacity .2s;
  border: 1px solid transparent;
  color: var(--text); background: transparent;
}
.btn-outline { border-color: rgba(255,255,255,.75); color: var(--text); }
.btn-outline:hover, .btn-outline:focus-visible { background: rgba(255,255,255,.08); border-color: var(--border-active); }
.btn-ghost { border-color: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text); }
.btn-sm { padding: .4rem 1rem; font-size: .82rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .35; pointer-events: none; }

/* ---- nav ---- */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem; max-width: 1200px; margin: 0 auto;
  position: sticky; top: 0; z-index: 10;
  background: rgba(10,10,10,.7); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-links { display: flex; align-items: center; gap: .75rem; }
.nav-user { font-size: .85rem; color: var(--text-secondary); }

/* ---- landing hero ---- */
.hero {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 80vh; padding: 4rem 1.5rem; text-align: center;
}
.cat-wrap { margin-bottom: 1.5rem; }
.cat-wrap svg { width: 140px; height: auto; display: block; }
.hero-title { font-size: clamp(3rem, 8vw, 5rem); margin-bottom: .5rem; }
.hero-sub { font-size: 1.15rem; color: var(--text-secondary); max-width: 480px; margin-bottom: 2rem; }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; justify-content: center; }

/* ---- cat typing animation ---- */
.afina-cat-typing { animation: catBob 4s ease-in-out infinite; }
.cat-cursor { animation: blink 1.2s steps(2, start) infinite; }
@keyframes blink { to { opacity: 0; } }
@keyframes catBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.cat-paw-left  rect { animation: pawTap 0.6s ease-in-out infinite alternate; }
.cat-paw-right rect { animation: pawTap 0.6s ease-in-out infinite alternate .3s; }
@keyframes pawTap { to { transform: translateY(1px); } }

/* ---- grid ---- */
.grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem; max-width: 1000px; margin: 0 auto; padding: 3rem 1.5rem 5rem;
}
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 2rem 1.5rem;
  transition: border-color .2s, transform .2s;
}
.card:hover { border-color: var(--border-active); transform: translateY(-2px); }
.card-icon { font-size: 1.4rem; display: block; margin-bottom: .75rem; opacity: .6; }
.card h2 { font-size: 1.1rem; margin-bottom: .4rem; }
.card p { font-size: .88rem; color: var(--text-secondary); line-height: 1.5; }

/* ---- footer ---- */
.footer { text-align: center; padding: 2rem; font-size: .8rem; color: var(--text-secondary); }

/* ---- auth (login) ---- */
.auth-body { display: flex; align-items: center; justify-content: center; }
.auth-card {
  width: 100%; max-width: 400px; margin: 2rem 1rem;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 2.25rem 1.75rem;
}
.alert {
  background: rgba(255,69,58,.12); border: 1px solid rgba(255,69,58,.35);
  border-radius: 10px; padding: .65rem 1rem; font-size: .85rem;
  margin-bottom: 1.25rem; color: #ff6961;
}
.auth-form label { display: block; font-size: .8rem; color: var(--text-secondary); margin-bottom: 1rem; }
.auth-form input[type="text"],
.auth-form input[type="password"] {
  display: block; width: 100%; margin-top: .3rem;
  padding: .65rem .85rem; font-size: .92rem; font-family: inherit;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); outline: none;
  transition: border-color .2s;
}
.auth-form input:focus { border-color: var(--border-active); }
.captcha-box {
  display: flex; align-items: center; gap: .5rem; margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.captcha-box img { border-radius: 10px; border: 1px solid var(--border); height: auto; }
.captcha-box .btn { white-space: nowrap; }
.back { display: inline-block; margin-top: 1rem; font-size: .82rem; color: var(--text-secondary); text-decoration: none; }
.back:hover { color: var(--text); }

/* ---- dashboard ---- */
.dash-body { background: var(--bg); }
.dash { max-width: 800px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.dash-title { font-size: 1.6rem; margin-bottom: 1.25rem; }
.panel {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.metric {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 1.15rem 1.25rem;
}
.metric-wide { grid-column: 1 / -1; }
.metric-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-secondary); display: block; margin-bottom: .3rem; }
.metric-value { font-size: 1.05rem; font-weight: 500; display: block; }
.bar {
  margin-top: .5rem; height: 4px; border-radius: 2px;
  background: rgba(255,255,255,.1); overflow: hidden;
}
.bar-fill { height: 100%; border-radius: 2px; background: var(--cat-fur); width: 0; transition: width .5s ease; }
