/* Server setup + My Servers. Ported from mockups/server-onboarding.css; builds on styles.css,
   auth.css (cards, stepper, Discord bits) and send.css (server icons, pills, confirm boxes). */

/* the stepper here has five steps, so labels stay short */
.stepper li { white-space: nowrap; }

/* signed-in chip in the card corner */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.who {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(11, 31, 75, 0.08);
  font-size: 14px; font-weight: 700;
}
.who img, .who .initial { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.who .initial { display: grid; place-items: center; color: #fff; font-size: 12px; background: linear-gradient(140deg, #38bdf8, #6366f1 60%, #0b1f4b); }
.who .pill { margin-left: 2px; }

.card.wide-ish { max-width: 540px; }
.card.agree-card, .card.roles-card { max-width: 860px; }
.check.confirm a { color: var(--accent); }

/* ---------- Pick server ---------- */
.server-pick { list-style: none; display: grid; gap: 8px; margin-bottom: 8px; }
.server-pick li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(11, 31, 75, 0.1);
  background: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  outline: none;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.server-pick li:hover { border-color: rgba(31, 111, 224, 0.35); }
.server-pick li:focus-visible { box-shadow: 0 0 0 4px rgba(31, 111, 224, 0.18); }
.server-pick li[aria-checked="true"] { border-color: var(--accent); background: #fff; box-shadow: 0 6px 16px rgba(20, 70, 150, 0.12); }
.server-pick li.taken { cursor: default; opacity: .55; background: rgba(255, 255, 255, 0.45); }
.server-pick li.taken:hover { border-color: rgba(11, 31, 75, 0.1); }
.server-pick div { display: grid; line-height: 1.3; min-width: 0; flex: 1; }
.server-pick strong { font-size: 15px; }
.server-pick div span { font-size: 12.5px; color: var(--navy-soft); }
.server-pick .pill { margin-left: 0; background: rgba(11, 31, 75, 0.07); color: var(--navy-soft); }
.server-pick .pill.own { background: rgba(245, 158, 11, 0.16); color: #b45309; }
.radio {
  width: 20px; height: 20px; flex: none;
  border-radius: 50%;
  border: 2px solid rgba(11, 31, 75, 0.25);
  transition: border .15s ease;
}
.server-pick li[aria-checked="true"] .radio { border: 6px solid var(--accent); }
#server-next, #finish-btn { position: relative; gap: 10px; }
#server-next:disabled, #agree-next:disabled, #finish-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- Agree ---------- */
.agree-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; margin-bottom: 8px; }
.agree-list { display: grid; gap: 10px; }
.agree-list .check > span { display: grid; gap: 2px; }
.agree-list b { font-weight: 700; }
.agree-list small { font-size: 13px; font-weight: 500; color: var(--navy-soft); line-height: 1.45; }
.preview {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px dashed rgba(11, 31, 75, 0.16);
}
.preview-pick {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(20, 70, 150, 0.12);
}
.preview-note { font-size: 13px; color: var(--navy-soft); line-height: 1.45; }

/* ---------- Roles ---------- */
.roles-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; margin-bottom: 8px; }
/* Servers can have dozens of roles: search on top, list scrolls inside the box */
.roles-box {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(11, 31, 75, 0.08);
  overflow: hidden;
}
.role-search {
  display: flex; align-items: center; gap: 8px;
  margin: 6px 6px 0;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(11, 31, 75, 0.05);
}
.role-search svg { width: 16px; height: 16px; color: var(--navy-soft); flex: none; }
.role-search input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 14px; color: var(--navy); outline: none; }
.roles {
  list-style: none;
  display: grid;
  gap: 2px;
  padding: 6px;
  max-height: 262px;
  overflow-y: auto;
  overscroll-behavior: contain;
  /* fade the bottom edge so it's clear there's more to scroll */
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 28px), transparent);
          mask-image: linear-gradient(180deg, #000 calc(100% - 28px), transparent);
}
.roles.at-end { -webkit-mask-image: none; mask-image: none; }
.roles .no-roles { padding: 18px; text-align: center; font-size: 14px; color: var(--navy-soft); }
.roles label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: background .15s ease;
}
.roles label:hover { background: rgba(31, 111, 224, 0.06); }
.roles label:has(input:checked) { background: rgba(31, 111, 224, 0.08); }
.roles label:has(input:disabled) { cursor: default; background: rgba(245, 158, 11, 0.08); }
.roles input { width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.role-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--r); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--r) 20%, transparent); }
.role-name { font-weight: 700; font-size: 15px; }
.role-count { margin-left: auto; font-size: 13px; color: var(--navy-soft); }
.lock {
  font-size: 11px; font-weight: 800; letter-spacing: .04em;
  padding: 3px 8px; border-radius: 999px;
  background: rgba(245, 158, 11, 0.16); color: #b45309;
}

.access-sum {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px dashed rgba(11, 31, 75, 0.16);
}
.big-num { font-size: 40px; letter-spacing: -0.03em; line-height: 1; }
.big-num small { font-size: 16px; font-weight: 600; color: var(--navy-soft); letter-spacing: 0; }
.access-sum p { font-size: 13.5px; color: var(--navy-soft); line-height: 1.5; }
.warn {
  font-size: 13px; font-weight: 600; line-height: 1.45;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.14);
  color: #92400e;
}

/* ---------- Done ---------- */
.done-card { text-align: center; }
.done-card .done-badge { background: linear-gradient(135deg, var(--sky-top), #5aa6f2); box-shadow: 0 14px 30px rgba(31, 111, 224, 0.35); }
.done-card .done-badge svg { animation: none; }
.done-list { list-style: none; display: grid; gap: 8px; justify-content: center; margin: 4px 0 18px; text-align: left; }
.done-list li { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.done-list .tick {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 12px; font-weight: 800;
  background: rgba(31, 111, 224, 0.12); color: var(--accent);
}


.server-pick .empty-pick { cursor: default; justify-content: center; color: var(--navy-soft); font-size: 14px; background: rgba(255, 255, 255, 0.5); }
.server-pick .empty-pick:hover { border-color: rgba(11, 31, 75, 0.1); }

/* ---------- Add the bot ---------- */
.bubble.bot { background: linear-gradient(135deg, var(--navy), #2b4f9e); }
.bubble.bot img { width: 38px; filter: brightness(0) invert(1); }
.bot-status {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 14px 0 0;
  font-size: 14px; font-weight: 600; color: var(--navy-soft);
}
.bot-status .dot-live { width: 9px; height: 9px; border-radius: 50%; background: #f59e0b; animation: pulse 1.4s ease-in-out infinite; }
.bot-status.ok { color: var(--accent); }
.bot-status.ok .dot-live { background: var(--accent); animation: none; }
@keyframes pulse { 50% { opacity: .35; } }
.btn-row { display: grid; gap: 8px; }

/* roles list: colour from Discord, no member counts on big servers */
.role-count:empty { display: none; }

/* ---------- My Servers ---------- */
.srv-page { max-width: 1120px; margin: 0 auto; }
.srv-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.srv-page-head h1 { margin-top: 6px; font-size: clamp(28px, 4vw, 38px); letter-spacing: -0.03em; line-height: 1.1; }
.srv-cards { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.srv-card {
  display: flex; flex-direction: column; gap: 14px;   /* footer sits at the bottom, no empty band */
  height: 100%;
  min-height: 150px;
  padding: 20px;
  border-radius: 24px;
  color: var(--navy);
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
a.srv-card:hover { transform: translateY(-2px); box-shadow: 0 28px 60px rgba(20, 70, 150, 0.2); }
.srv-card .srv-top { display: flex; align-items: center; gap: 12px; }
.srv-card .srv-icon { width: 52px; height: 52px; border-radius: 16px; font-size: 16px; }
.srv-card strong { font-size: 17px; letter-spacing: -0.01em; }
.srv-card .srv-sub { font-size: 13px; color: var(--navy-soft); }
.srv-card .srv-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; font-size: 13px; color: var(--navy-soft); }
.srv-card .pill { margin-left: 0; }
.pill.grey { background: rgba(11, 31, 75, 0.07); color: var(--navy-soft); }
/* last card: add another server */
.srv-card.add {
  align-items: center; justify-content: center; gap: 8px; text-align: center;
  border: 2px dashed rgba(31, 111, 224, 0.35);
  background: rgba(255, 255, 255, 0.35);
  box-shadow: none;
  color: var(--accent);
}
.srv-card.add .plus {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(31, 111, 224, 0.12);
  font-size: 26px; font-weight: 600; line-height: 1;
}
.srv-card.add strong { color: var(--accent); }
.srv-empty { max-width: 460px; margin: 30px auto 0; text-align: center; }

@media (max-width: 760px) {
  .agree-grid, .roles-grid { grid-template-columns: 1fr; }
  .stepper li:not(.active) .lbl { display: none; }
  .stepper li:not(.active) { padding: 7px; }
}

/* My Servers: Refresh Servers button (asks Discord for your moderator roles again) */
.srv-refresh { gap: 8px; font-family: inherit; color: var(--navy); cursor: pointer; flex: none; }
.srv-refresh svg { width: 16px; height: 16px; }
.srv-refresh.spinning svg { animation: srv-spin .8s linear infinite; }
.srv-refresh:disabled { cursor: progress; opacity: .7; transform: none; }
@keyframes srv-spin { to { transform: rotate(360deg); } }
.srv-empty .srv-refresh { margin-top: 12px; }
