/* Gangplan invites: the "Bring the gang" card. Author: Lee Alderman. */
/* Builds on app.css (tokens, .card, .btn, .field, .line, .tag, .avatar); only what is new lives here. */

.card.inv-card { position: relative; align-items: stretch; gap: 16px; padding: 18px 16px 16px; overflow: hidden; isolation: isolate; }
.inv-card::before {
  content: ""; position: absolute; z-index: -1; right: -70px; top: -90px; width: 250px; height: 250px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--sun) 20%, transparent), transparent 66%);
}
.inv-card [hidden] { display: none; }
.inv-card h4 { margin: 0; }

/* ---------- heading ---------- */
.inv-head { display: flex; align-items: center; gap: 13px; }
.inv-badge {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px; flex: none; font-size: 1.3rem; color: #fff;
  background: linear-gradient(135deg, #0c4b53, #12747f 55%, #1a9aa0);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .28) inset, 0 8px 18px rgba(14, 90, 99, .3);
  transform: rotate(-4deg);
}
.inv-head div { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.card .inv-head h3 { margin: 0; font-size: 1.3rem; letter-spacing: -.015em; font-variation-settings: "SOFT" 60; }
.inv-head p { color: var(--muted); font-size: .92rem; }

.inv-body, .inv-part, .inv-form, .inv-linkbox, .inv-pending { display: flex; flex-direction: column; min-width: 0; }
.inv-body { gap: 16px; }
.inv-part, .inv-form { gap: 10px; }
.inv-linkbox { gap: 8px; }
.inv-status:empty, .inv-pending:empty { display: none; }

/* ---------- the pass: an invite link dressed as a boarding pass ---------- */
.inv-pass { display: flex; flex-direction: column; filter: drop-shadow(0 8px 16px rgba(14, 90, 99, .16)) drop-shadow(0 1px 1px rgba(20, 36, 42, .08)); }
.inv-pass.inv-fresh { animation: inv-in .5s var(--ease) backwards; }
@keyframes inv-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }

.inv-pass-top, .inv-pass-body { --notch: 9px; position: relative; }
.inv-pass-top {
  display: flex; align-items: flex-end; gap: 14px; padding: 15px 18px 16px; color: #fff; overflow: hidden;
  border-radius: 18px 18px 0 0;
  background:
    radial-gradient(180px 150px at 100% 0%, rgba(243, 178, 62, .46), transparent 70%),
    linear-gradient(135deg, #0c4b53, #12747f 58%, #1a9aa0);
  -webkit-mask: radial-gradient(var(--notch) at var(--notch) 100%, #0000 96%, #000) calc(var(--notch) * -1) 0 / 100% 100% repeat-x;
  mask: radial-gradient(var(--notch) at var(--notch) 100%, #0000 96%, #000) calc(var(--notch) * -1) 0 / 100% 100% repeat-x;
}
.inv-pass-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.inv-kicker { display: inline-flex; align-items: center; gap: 7px; font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .82); }
.inv-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #7fe6b0; flex: none; }
.inv-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #7fe6b0; animation: inv-ping 2.4s ease-out infinite; }
@keyframes inv-ping { 0% { opacity: .7; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(3); } }
.inv-trip {
  font: 600 1.32rem/1.12 var(--display); letter-spacing: -.02em; font-variation-settings: "SOFT" 50; text-shadow: 0 2px 12px rgba(0, 0, 0, .22);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere;
}
.inv-until { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; text-align: right; }
.inv-until span { font-size: .64rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .78); }
.inv-until strong { font: 600 1.06rem/1.15 var(--display); white-space: nowrap; }

.inv-pass-body {
  display: flex; flex-direction: column; gap: 10px; padding: 16px 14px 14px;
  border-radius: 0 0 18px 18px;
  background: color-mix(in srgb, var(--accent-soft) 78%, var(--surface));
  -webkit-mask: radial-gradient(var(--notch) at var(--notch) 0, #0000 96%, #000) calc(var(--notch) * -1) 0 / 100% 100% repeat-x;
  mask: radial-gradient(var(--notch) at var(--notch) 0, #0000 96%, #000) calc(var(--notch) * -1) 0 / 100% 100% repeat-x;
}
.inv-pass-body::before { content: ""; position: absolute; top: 0; left: 16px; right: 16px; border-top: 2px dashed color-mix(in srgb, var(--accent) 34%, transparent); }
input.inv-link {
  font: 500 .86rem/1.3 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: -.01em; color: var(--ink);
  background: var(--surface); border-color: color-mix(in srgb, var(--accent) 22%, var(--line)); text-overflow: ellipsis; cursor: text;
}
.inv-go { display: flex; gap: 8px; }
.inv-go .btn { flex: 1 1 0; min-width: 0; padding: 12px 14px; }
.inv-copy.inv-copied { background: var(--good); box-shadow: 0 6px 16px color-mix(in srgb, var(--good) 32%, transparent); color: var(--surface); }
.inv-copied .icon { stroke-width: 3; animation: inv-tick .45s var(--ease); }
@keyframes inv-tick { 0% { transform: scale(.3) rotate(-25deg); opacity: 0; } 65% { transform: scale(1.25); } }
.inv-hush { font-size: .9rem; color: var(--ink); opacity: .86; }

.inv-quiet { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 14px; padding: 2px 4px 0; }
.inv-quiet .link-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 2px; font-size: .86rem; color: var(--muted); border-radius: 8px; }
.inv-quiet .link-btn:hover { color: var(--ink); }
.inv-quiet .link-btn.inv-off:hover { color: var(--bad); }
.inv-quiet .link-btn:only-child { margin-left: auto; }
.inv-card .link-btn:disabled { opacity: .55; cursor: default; text-decoration: none; }

.inv-note { display: flex; gap: 8px; align-items: flex-start; font-size: .84rem; line-height: 1.4; color: var(--muted); padding: 0 2px; }
.inv-note .icon { margin-top: .15em; color: var(--faint); }

/* ---------- no link yet, and trouble loading ---------- */
.inv-empty {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 20px 16px 16px; border-radius: 18px;
  border: 1.5px dashed color-mix(in srgb, var(--accent) 34%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 32%, transparent);
}
.inv-empty strong { font: 600 1.08rem/1.2 var(--display); }
.inv-empty p { font-size: .9rem; color: var(--muted); max-width: 34ch; }
.inv-empty .btn { margin-top: 10px; }
.inv-bubble { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; margin-bottom: 4px; font-size: 1.15rem; color: var(--accent); background: var(--surface); box-shadow: var(--shadow-1), 0 0 0 6px color-mix(in srgb, var(--accent-soft) 70%, transparent); }
.inv-trouble { border-color: var(--line); background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.inv-trouble .inv-bubble { color: var(--muted); box-shadow: var(--shadow-1); }

.inv-skel { display: flex; flex-direction: column; gap: 10px; padding: 0 0 4px; }
.inv-skel span { display: block; border-radius: 12px; background: linear-gradient(100deg, var(--surface-2) 30%, color-mix(in srgb, var(--surface-2) 45%, var(--surface)) 50%, var(--surface-2) 70%) 0 0 / 220% 100%; animation: inv-shimmer 1.3s linear infinite; }
.inv-skel-top { height: 132px; border-radius: 18px; }
.inv-skel-line { height: 12px; width: 78%; }
.inv-skel-line.short { width: 46%; }
@keyframes inv-shimmer { to { background-position: -220% 0; } }

.inv-banner { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 12px; font-size: .86rem; font-weight: 500; background: color-mix(in srgb, var(--sun) 20%, var(--surface)); border: 1px solid color-mix(in srgb, var(--sun) 46%, var(--line)); color: color-mix(in srgb, var(--sun) 38%, var(--ink)); }
.inv-banner .link-btn { color: inherit; text-decoration: underline; white-space: nowrap; font-size: .86rem; }

/* ---------- or ---------- */
.inv-or { display: flex; align-items: center; gap: 12px; color: var(--faint); font: italic 400 .95rem var(--display); }
.inv-or::before, .inv-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* ---------- by email ---------- */
.inv-fields { display: flex; flex-wrap: wrap; gap: 10px; }
.inv-fields .field:first-child { flex: 1 1 130px; }
.inv-fields .field:last-child { flex: 2 1 220px; }
.inv-opt { font-style: normal; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--faint); font-size: 1em; margin-left: 2px; }
.inv-form input[aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--bad) 16%, transparent); }
.inv-error { display: flex; align-items: center; gap: 6px; font-size: .86rem; font-weight: 500; color: var(--bad); }
.inv-send { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 12px; }
.inv-send .field-hint { flex: 1 1 150px; }

/* ---------- waiting to join ---------- */
.inv-sub { display: flex; align-items: center; gap: 8px; padding-top: 2px; }
.inv-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; font-size: .72rem; font-weight: 700; background: var(--accent-soft); color: var(--accent); font-variant-numeric: tabular-nums; }
.inv-list { list-style: none; display: flex; flex-direction: column; margin: 0; padding: 0; }
.inv-list .line { padding: 9px 0; transition: opacity .2s; }
.inv-list .line:first-child { border-top: 0; }
.inv-list .line.inv-going { opacity: .45; }
.inv-list .grow { min-width: 0; }
.inv-email { font-weight: 600; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar.inv-wait { background: color-mix(in srgb, var(--c) 13%, var(--surface)); color: var(--c); text-shadow: none; font-size: .74rem; outline: 1.5px dashed color-mix(in srgb, var(--c) 60%, transparent); outline-offset: -1.5px; }
.tag.inv-expired { background: color-mix(in srgb, var(--bad) 13%, var(--surface)); color: var(--bad); }
.inv-none { font-size: .86rem; color: var(--faint); text-align: center; padding: 0 8px; }

/* ---------- busy buttons, confirm sheet, not allowed ---------- */
.inv-card .btn:disabled { cursor: default; filter: saturate(.75); opacity: .78; }
.btn.inv-loading .icon { display: none; }
.btn.inv-loading::before { content: ""; width: 15px; height: 15px; flex: none; border-radius: 50%; border: 2.2px solid currentColor; border-right-color: transparent; animation: inv-spin .7s linear infinite; }
@keyframes inv-spin { to { transform: rotate(360deg); } }

.inv-confirm p { color: var(--muted); }
.inv-confirm .actions { flex-wrap: wrap; justify-content: flex-end; }
.btn.inv-danger { background: var(--bad); border-color: transparent; color: var(--surface); box-shadow: 0 6px 16px color-mix(in srgb, var(--bad) 28%, transparent); }
.btn.inv-danger:hover { background: var(--bad); filter: brightness(1.08); }

.card.inv-card.inv-is-denied { background: none; border: 0; box-shadow: none; padding: 0; }
.inv-is-denied::before, .inv-is-denied .inv-head { display: none; }
.inv-denied { display: flex; gap: 8px; align-items: center; }

@media (prefers-color-scheme: dark) {
  .inv-pass { filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .4)); }
  .inv-pass-body { background: color-mix(in srgb, var(--accent-soft) 80%, var(--surface)); }
  .inv-card::before { background: radial-gradient(circle, color-mix(in srgb, var(--sun) 12%, transparent), transparent 66%); }
  .inv-copy.inv-copied { color: var(--accent-ink); }
}
@media (max-width: 420px) {
  .inv-pass-top { padding: 14px 16px 15px; }
  .inv-trip { font-size: 1.2rem; }
  .inv-send .field-hint { flex-basis: 100%; }
  .inv-send .btn { flex: 1 1 100%; padding: 12px 14px; }
}
