:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-soft: #fafcff;
  --ink: #12233d;
  --muted: #4a5b75;
  --muted-2: #5a6a82;
  --line: #dce4f0;
  --line-strong: #c5d2e6;
  --blue: #2b5797;
  --blue-dark: #1c3f73;
  --blue-soft: #e1eaf7;
  --focus: #9dbbe6;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Manrope, system-ui, sans-serif; line-height: 1.5; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: var(--blue); }
a:hover { color: var(--blue-dark); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.muted { color: var(--muted); }
.ink { color: var(--ink); }
.small { font-size: 13px; }
.right { text-align: right; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stack-6 { display: flex; flex-direction: column; gap: 6px; }
.stack-14 { display: flex; flex-direction: column; gap: 14px; }

label { font-size: 14px; font-weight: 600; }
input, select {
  height: 48px; border: 1px solid var(--line-strong); border-radius: 12px; padding: 0 14px;
  font: inherit; font-size: 16px; color: var(--ink); background: var(--surface-soft); width: 100%;
}
input:focus, select:focus { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--blue); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px;
  border-radius: 12px; border: 0; font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); }
.btn-secondary:hover { background: var(--bg); }
.btn-link { background: none; color: var(--blue); padding: 0 8px; }
.btn-lg { height: 50px; font-size: 16px; width: 100%; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; font-weight: 600; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; background: var(--blue); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px;
}
.brand-name { font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }

/* Public pages */
.public { min-height: 100vh; display: flex; flex-direction: column; }
.public-header, .public-footer, .hero { width: 100%; max-width: 1120px; margin: 0 auto; padding-inline: 24px; }
.public-header { padding-block: 28px; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 14px; }
.public-footer { padding-block: 24px; font-size: 13px; color: var(--muted-2); border-top: 1px solid var(--line); }
.hero { flex: 1; padding-block: 48px 64px; display: flex; flex-wrap: wrap; gap: 56px; align-items: center; }
.hero-copy { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.hero h1 { font-size: clamp(36px, 5vw, 52px); line-height: 1.08; letter-spacing: -0.03em; font-weight: 800; }
.lead { font-size: 18px; line-height: 1.6; color: var(--muted); max-width: 500px; }
.pill { align-self: flex-start; font-size: 13px; font-weight: 600; color: var(--blue); background: var(--blue-soft); padding: 6px 12px; border-radius: 999px; }
.chips { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.chip {
  display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 16px; font-size: 15px; font-weight: 600;
}
.chip svg { color: var(--blue); }
.chip-plain { background: none; border-color: transparent; color: var(--muted); padding-inline: 6px; }
.login-card {
  flex: 0 1 420px; min-width: 0; padding: 36px; border-radius: 20px; display: flex; flex-direction: column; gap: 20px;
  box-shadow: 0 18px 40px -24px rgba(18, 35, 61, 0.35);
}
.login-card h2 { font-size: 24px; font-weight: 800; }

.center { flex: 1; display: flex; align-items: center; justify-content: center; padding: 48px 24px 80px; }
.center-card {
  width: 100%; max-width: 480px; padding: 44px 36px; border-radius: 20px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 18px; box-shadow: 0 18px 40px -24px rgba(18, 35, 61, 0.35);
}
.center-card h1 { font-size: 28px; font-weight: 800; }
.center-card form { width: 100%; }
.icon-circle { width: 64px; height: 64px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); display: flex; align-items: center; justify-content: center; }
.row-center { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 6px; }
.row-center form { width: auto; }

/* App */
.app { position: relative; min-height: 100vh; overflow: hidden; background: #eef3fa; }
.app-blob { position: absolute; border-radius: 50%; pointer-events: none; animation: drift 14s ease-in-out infinite; }
.app-blob-1 { top: -120px; right: -80px; width: 420px; height: 420px; background: #dce7f5; }
.app-blob-2 { bottom: -160px; left: -120px; width: 380px; height: 380px; background: #e3ecf8; animation-delay: -7s; }
.app-header {
  position: relative; max-width: 1160px; margin: 0 auto; padding: 28px 32px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.app-user { display: flex; align-items: center; gap: 12px; }
.user-meta { display: flex; flex-direction: column; align-items: flex-end; font-size: 14px; line-height: 1.3; }
.avatar {
  width: 38px; height: 38px; flex: none; border-radius: 50%; background: #fff; color: var(--blue-dark);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px;
}
.avatar-lg { width: 52px; height: 52px; font-size: 20px; background: #dce7f5; }
.content {
  position: relative; max-width: 1160px; margin: 0 auto; padding: 40px 32px 160px;
  display: flex; flex-direction: column; gap: 24px; animation: fade-in .4s ease both;
}
.page-head { display: flex; flex-direction: column; gap: 6px; }
.page-head h1 { font-size: 32px; font-weight: 800; }

.dock {
  position: fixed; left: 50%; bottom: 28px; z-index: 10; display: flex; gap: 6px; padding: 10px;
  background: #fff; border-radius: 24px; box-shadow: 0 20px 40px -20px rgba(18, 35, 61, 0.45);
  transform: translateX(-50%); animation: dock-in .7s .15s cubic-bezier(.2, .8, .2, 1) both;
}
.dock-item {
  position: relative; width: 52px; height: 52px; border-radius: 16px; color: var(--muted); text-decoration: none;
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s cubic-bezier(.2, .8, .2, 1), background .2s ease, color .2s ease;
}
.dock-item svg { width: 22px; height: 22px; }
.dock-item:hover, .dock-item:focus-visible { transform: translateY(-6px) scale(1.12); background: #eef3fa; color: var(--ink); }
.dock-item.is-active { background: var(--blue); color: #fff; }
.dock-item.is-active:hover, .dock-item.is-active:focus-visible { background: var(--blue-dark); color: #fff; }
.dock-label {
  position: absolute; bottom: calc(100% + 12px); left: 50%; padding: 7px 12px; border-radius: 10px;
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 700; white-space: nowrap; pointer-events: none;
  opacity: 0; transform: translate(-50%, 8px) scale(.85); transform-origin: bottom center;
  transition: opacity .18s ease, transform .25s cubic-bezier(.3, 1.5, .5, 1);
}
.dock-label::after {
  content: ""; position: absolute; top: 100%; left: 50%; margin-left: -6px;
  border: 6px solid transparent; border-top-color: var(--ink);
}
.dock-item:hover .dock-label, .dock-item:focus-visible .dock-label { opacity: 1; transform: translate(-50%, 0) scale(1); }

.view-switch { position: fixed; left: 28px; bottom: 36px; z-index: 10; animation: dock-in-left .7s .25s cubic-bezier(.2, .8, .2, 1) both; }
.view-switch-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border: 0; border-radius: 14px;
  background: #fff; color: var(--ink); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  box-shadow: 0 14px 30px -18px rgba(18, 35, 61, 0.45); transition: transform .2s ease, background .2s ease;
}
.view-switch-btn:hover { transform: translateY(-3px); }
.view-switch-btn { white-space: nowrap; }
.vs-short { display: none; }
.view-switch-btn.is-previewing { background: #f7ebd3; color: #6b4a0e; }

.bento { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 260px; gap: 20px; }
.bento-box {
  border-radius: 28px; padding: 32px; background: #fff; color: var(--ink); text-decoration: none;
  display: flex; flex-direction: column; justify-content: space-between; gap: 16px;
  animation: box-in .6s cubic-bezier(.2, .8, .2, 1) both; transition: transform .3s ease, box-shadow .3s ease;
}
a.bento-box:hover { color: var(--ink); transform: scale(1.015); box-shadow: 0 26px 44px -28px rgba(18, 35, 61, 0.45); }
.bento-text { display: flex; flex-direction: column; gap: 6px; }
.bento-text strong { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.bento-text span { font-size: 15px; color: var(--muted); }
.bento-notes { grid-row: span 2; padding: 36px; }
.bento-notes .bento-text strong { font-size: 38px; letter-spacing: -0.03em; }
.bento-lines { display: flex; flex-direction: column; gap: 10px; }
.bento-lines span { height: 12px; border-radius: 6px; background: #eef3fa; transform-origin: left; animation: line-in .6s cubic-bezier(.2, .8, .2, 1) both; }
.bento-lines span:nth-child(1) { width: 100%; background: var(--blue-soft); animation-delay: .3s; }
.bento-lines span:nth-child(2) { width: 82%; animation-delay: .4s; }
.bento-lines span:nth-child(3) { width: 90%; animation-delay: .5s; }
.bento-lines span:nth-child(4) { width: 64%; animation-delay: .6s; }
.bento-tasks { grid-column: span 2; flex-direction: row; align-items: center; background: var(--blue); color: #fff; animation-delay: .1s; }
a.bento-tasks:hover { color: #fff; }
.bento-tasks .bento-text span { color: #d9e5f5; }
.bento-tick { width: 120px; height: 120px; flex: none; border-radius: 30px; background: #3e6bad; display: flex; align-items: center; justify-content: center; }
.bento-tick path { stroke-dasharray: 24; animation: tick 3s ease-in-out infinite; }
.bento-people { animation-delay: .2s; }
.bento-avatars { display: flex; }
.bento-avatars .avatar { width: 44px; height: 44px; background: var(--blue-soft); border: 3px solid #fff; }
.bento-avatars .avatar + .avatar { margin-left: -14px; }
.bento-soon { background: none; border: 2px dashed var(--line-strong); color: var(--muted); align-items: center; justify-content: center; font-size: 15px; font-weight: 600; animation-delay: .3s; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.empty { padding: 32px; color: var(--muted); }

.member-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.member-card { padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }

@keyframes drift { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(30px, -20px); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes box-in { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes line-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes dock-in { from { opacity: 0; transform: translate(-50%, 40px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes dock-in-left { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
@keyframes tick { 0%, 60% { stroke-dashoffset: 24; } 80%, 100% { stroke-dashoffset: 0; } }

.badge { display: inline-block; font-size: 13px; font-weight: 700; padding: 5px 10px; border-radius: 999px; }
.badge-blue { color: var(--blue-dark); background: var(--blue-soft); }
.badge-green { color: #1e5a3a; background: #ddf1e5; }
.badge-amber { color: #6b4a0e; background: #f7ebd3; }

.alert { padding: 12px 16px; border-radius: 12px; background: #fbe3e3; color: #7a1f1f; font-weight: 600; }
.add-form { padding: 24px; display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.field { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.field-wide { flex: 2 1 260px; }
.field-narrow { flex: 0 1 140px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 15px; }
th { text-align: left; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; padding: 16px 20px; border-bottom: 1px solid var(--line); }
td { padding: 14px 20px; border-bottom: 1px solid #eef2f8; }
tbody tr:last-child td { border-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (hover: none) {
  .dock { gap: 2px; padding: 8px; }
  .dock-item { width: 62px; height: 58px; flex-direction: column; gap: 3px; }
  .dock-item:hover, .dock-item:focus-visible { transform: none; }
  .dock-item:not(.is-active):hover { background: none; color: var(--muted); }
  .dock-label, .dock-item:hover .dock-label, .dock-item:focus-visible .dock-label {
    position: static; padding: 0; background: none; color: inherit; font-size: 10.5px; font-weight: 700;
    opacity: 1; transform: none; transition: none;
  }
  .dock-label::after { content: none; }
}

@media (max-width: 860px) {
  .bento { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; }
  .bento-box { min-height: 180px; }
  .bento-notes, .bento-tasks { grid-row: auto; grid-column: auto; }
  .bento-tick { width: 88px; height: 88px; }
}

@media (max-width: 720px) {
  .app-header, .content { padding-inline: 16px; }
  .user-meta { display: none; }
  .content { padding-bottom: 190px; }
  .view-switch { position: static; animation: none; }
  .vs-long { display: none; }
  .vs-short { display: inline; }
  .view-switch-btn { height: 38px; padding: 0 12px; font-size: 13px; box-shadow: none; }
  .login-card, .center-card { padding: 28px 20px; }
}
