/* ===== BuddyBar for Teams: the dashboard, sign-in and join pages =====
   Same header, type and colors as the rest of buddybar.io. */

* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --ink: #0f172a;
    --text: #334155;
    --muted: #64748b;
    --line: #e2e8f0;
    --soft: #f8fafc;
    --coral: #FFA69E;
    --good: #15803d;
    --good-bg: #f0fdf4;
    --warn: #b45309;
    --warn-bg: #fffbeb;
    --bad: #b91c1c;
    --bad-bg: #fef2f2;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}
body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}
p, li, label, .note { text-wrap: pretty; }
h1, h2, h3 { color: var(--ink); text-wrap: balance; line-height: 1.25; }
a { color: var(--ink); }
.container { max-width: 1000px; margin: 0 auto; padding: 0 20px; width: 100%; }
[hidden] { display: none !important; }

/* Header (same as the rest of the site) */
header { background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.1); position: fixed; width: 100%; top: 0; z-index: 100; }
nav.container { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; padding-bottom: 14px; gap: 16px; }
.logo { display: flex; align-items: center; gap: 12px; font-size: 1.5rem; font-weight: 600; color: var(--ink); text-decoration: none; }
.logo-icon { display: flex; gap: 4px; }
.color-swatch { width: 16px; height: 16px; border-radius: 4px; border: 1px solid rgba(0,0,0,0.1); transition: transform 0.2s ease-out; }
.logo:hover .color-swatch:nth-child(1) { transform: rotate(-8deg); }
.logo:hover .color-swatch:nth-child(2) { transform: translateY(-2px); }
.logo:hover .color-swatch:nth-child(3) { transform: rotate(8deg); }
/* The BuddyBar logo, unchanged, with a coral Teams tag after the name */
.teams-tag {
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; line-height: 1;
    background: var(--coral); color: var(--ink); padding: 5px 8px 4px; border-radius: 6px;
}
.account { display: flex; align-items: center; gap: 12px; font-size: 0.9rem; color: var(--muted); }
.account .email { overflow-wrap: anywhere; }
/* Smaller than the page's buttons: the header shouldn't compete with the work below it. */
.account .btn { white-space: nowrap; flex-shrink: 0; }

main { flex: 1; padding: 112px 0 64px; }
footer { padding: 2rem 0; text-align: center; font-size: 0.9rem; color: var(--muted); }
footer a { color: var(--muted); }

/* Type */
.eyebrow {
    display: inline-block; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--muted); background: #f1f5f9; border-radius: 999px; padding: 4px 12px; margin-bottom: 0.75rem;
}
h1 { font-size: 2.1rem; font-weight: 700; overflow-wrap: anywhere; }
h2 { font-size: 1.25rem; font-weight: 700; }
.lead { font-size: 1.05rem; color: var(--text); margin-top: 0.5rem; max-width: 60ch; }
.note { font-size: 0.9rem; color: var(--muted); }
.count { font-size: 0.9rem; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Buttons and fields */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
    font: inherit; font-weight: 600; font-size: 0.95rem; cursor: pointer; text-decoration: none;
    transition: background 0.15s ease, transform 0.15s var(--ease-out-expo), border-color 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #1e293b; }
.btn-secondary { background: #fff; color: var(--ink); border-color: #cbd5e1; }
.btn-secondary:hover { background: var(--soft); border-color: #94a3b8; }
.btn-quiet { background: none; color: var(--text); padding: 8px 10px; }
.btn-quiet:hover { background: #f1f5f9; }
.btn-danger { background: #fff; color: var(--bad); border-color: #fecaca; }
.btn-danger:hover { background: var(--bad-bg); }
/* The yes in a confirm window for something that takes palettes away from people. */
.btn-danger-solid { background: var(--bad); color: #fff; }
.btn-danger-solid:hover { background: #991b1b; }
.btn-small { padding: 6px 14px; font-size: 0.875rem; border-radius: 8px; }
.link-button { font: inherit; color: var(--ink); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.btn-icon { width: 44px; height: 44px; flex: none; padding: 0; border-radius: 8px; background: none; color: var(--muted); border: 1px solid transparent; }
.btn-icon:hover { background: #f1f5f9; color: var(--ink); }
.btn-icon svg { width: 16px; height: 16px; }

input[type="text"], input[type="email"], input[type="search"], textarea, select {
    font: inherit; font-size: 0.95rem; color: var(--ink);
    padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; width: 100%; /* 46px, the same as a button */
}
textarea { resize: vertical; min-height: 40px; }
label { font-size: 0.85rem; font-weight: 600; color: var(--ink); display: block; margin-bottom: 4px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > input { flex: 1; min-width: 200px; }

/* Messages: an icon and words, never color alone */
.msg { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 0.95rem; border: 1px solid; }
.msg::before { font-weight: 700; flex: none; width: 1.2em; text-align: center; }
.msg.good { background: var(--good-bg); border-color: #bbf7d0; color: #14532d; }
.msg.good::before { content: '✓'; }
.msg.warn { background: var(--warn-bg); border-color: #fde68a; color: #78350f; }
.msg.warn::before { content: '!'; }
.msg.bad { background: var(--bad-bg); border-color: #fecaca; color: #7f1d1d; }
.msg.bad::before { content: '!'; }
.msg.info { background: var(--soft); border-color: var(--line); color: var(--text); }
.msg.info::before { content: 'i'; font-style: italic; font-family: Georgia, serif; }
.msg .body { flex: 1; }
.msg .body > * + * { margin-top: 8px; }

/* Cards */
.card { border: 1px solid var(--line); border-radius: 16px; padding: 22px; background: #fff; }
.card + .card, .section + .section { margin-top: 20px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
/* Its own line, but no wider than easy reading: the padding takes up the rest. */
.section-head p { width: 100%; padding-right: max(0px, calc(100% - 72ch)); }
.subhead { font-size: 1rem; }

/* A narrow page: sign-in and join */
.narrow { max-width: 520px; margin: 0 auto; }
.narrow .card { margin-top: 24px; }
.narrow form > * + * { margin-top: 12px; }

/* Swatch strips */
.strip { display: flex; gap: 4px; flex-wrap: wrap; }
.strip i { width: 24px; height: 24px; border-radius: 6px; border: 1px solid rgba(15,23,42,0.1); display: block; }
.strip .gap { width: 8px; border: 0; }
.strip .more { font-style: normal; font-size: 0.8rem; color: var(--muted); width: auto; border: 0; align-self: center; padding-left: 4px; }

/* Dashboard */
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.dash-head .title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px;
    font-size: 0.85rem; font-weight: 600; border: 1px solid var(--line); background: var(--soft); color: var(--ink);
}
.chip.ended { background: var(--warn-bg); border-color: #fde68a; color: #78350f; }
.chip.ended::before { content: '!'; font-weight: 700; }
/* The plan notice at the top of the page */
.plan-notice { margin-bottom: 20px; }
.plan-notice p { text-wrap: balance; }
.team-picker { display: flex; gap: 8px; align-items: center; }
.team-picker select { width: auto; height: 46px; }

.palettes { display: flex; flex-direction: column; gap: 12px; }
.palette { border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.palette .info { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 8px; }
.palette h3 { font-size: 1.05rem; overflow-wrap: anywhere; }
.palette .actions { display: flex; gap: 4px; align-items: center; }
.empty { border: 1px dashed #cbd5e1; border-radius: 14px; padding: 24px; text-align: center; }
.empty p + .row { justify-content: center; margin-top: 12px; }
.add-row { margin-top: 14px; }
.row .hint { flex-basis: 100%; }

/* Dropping a file: a .buddybar file on Palettes, a spreadsheet on Add people */
[data-drop] { position: relative; }
.dropping::after {
    content: attr(data-drop); position: absolute; inset: 0; border-radius: inherit;
    display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center;
    background: rgba(255,255,255,0.94); border: 2px dashed var(--ink);
    font-size: 1.05rem; font-weight: 600; color: var(--ink); pointer-events: none;
}

.link-box { display: flex; gap: 8px; flex-wrap: wrap; }
.link-box input { flex: 1; min-width: 240px; font-family: 'Inter', ui-monospace, monospace; font-size: 0.85rem; color: var(--text); background: var(--soft); }

.admins { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.admins li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--soft); }
.admins .who { overflow-wrap: anywhere; }
.admins .you { color: var(--muted); font-size: 0.85rem; }

/* Who can join: the current answer as a summary; Change opens the choices */
.setting { margin-top: 22px; display: flex; align-items: center; gap: 16px; padding: 16px 18px; background: var(--soft); border: 1px solid var(--line); border-radius: 14px; }
.setting .what { flex: 1; min-width: 0; }
.setting .label { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.setting .value { font-size: 1.05rem; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 8px; }
/* Closed padlock for the private settings, open and amber for the link: never color alone. */
.setting .value::before { content: ''; width: 18px; height: 18px; flex: none; background: center / contain no-repeat; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2315803d' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='11' width='16' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E"); }
.setting[data-mode="link"] .value::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b45309' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='11' width='16' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 7.5-2'/%3E%3C/svg%3E"); }
.setting .why { font-size: 0.92rem; color: var(--text); margin-top: 2px; }
.choices { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.choice { display: flex; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-size: 1rem; font-weight: 400; color: var(--text); margin: 0; }
.choice:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); background: var(--soft); }
.choice > input { margin-top: 5px; accent-color: var(--ink); width: 18px; height: 18px; flex: none; }
.choice h4 { font-size: 1rem; color: var(--ink); }
.choice p { font-size: 0.9rem; }
.choice .now { font-size: 0.75rem; font-weight: 700; color: var(--good); margin-left: 8px; }
.domain-field { margin-top: 10px; display: none; }
.choice:has(input:checked) .domain-field { display: block; }
.domain-field .note { margin-top: 4px; }

/* If the link reaches the wrong people: each button explained before the click */
.safety { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.safety > .note { margin-top: 4px; }
.action-rows { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.action-row { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; }
.action-row .what { flex: 1; min-width: 0; }
.action-row h4 { font-size: 0.98rem; color: var(--ink); }
.action-row p { font-size: 0.9rem; }

/* Members: the newest few, then one plain way to see everyone */
.group-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 20px; }
.group-head .count { font-size: 0.88rem; }
.people { list-style: none; margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.people li { display: flex; align-items: center; gap: 12px; padding: 0 0 0 14px; background: var(--soft); border-radius: 10px; min-height: 46px; }
.people .who { flex: 1; min-width: 0; color: var(--ink); overflow-wrap: anywhere; }
.people .when { font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.people .empty-row { padding: 12px 14px; color: var(--muted); font-size: 0.92rem; }
.section .search { margin-top: 16px; max-width: 360px; }
.btn.more { margin-top: 8px; width: 100%; }
.add-area { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.add-area .note { margin-top: 2px; }
.add-area .add-row { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; }
.add-area textarea { max-width: 520px; min-height: 46px; resize: none; overflow: hidden; field-sizing: content; max-height: 200px; }
.add-area.dropping::after { border-radius: 12px; }

/* Check before sending: what a pasted list or file will do */
.review { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.review li { display: flex; gap: 10px; align-items: baseline; padding: 10px 12px; border-radius: 10px; background: var(--soft); border: 1px solid var(--line); }
.review li.bad { background: var(--bad-bg); border-color: #fecaca; }
.review .mark { font-weight: 700; width: 16px; flex: none; text-align: center; }
.review .ok .mark { color: var(--good); }
.review .skip .mark { color: var(--muted); }
.review .bad .mark { color: var(--bad); }

/* Plans */
.period { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; padding: 3px; background: var(--soft); margin-bottom: 14px; }
.period button { font: inherit; font-size: 0.9rem; font-weight: 600; border: 0; background: none; padding: 6px 14px; border-radius: 8px; cursor: pointer; color: var(--muted); }
.period button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15,23,42,0.12); }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.plan { border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.plan.current { border-color: var(--ink); }
.plan h3 { font-size: 1.1rem; }
.plan .price { font-size: 1.6rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.plan .price small { font-size: 0.9rem; font-weight: 500; color: var(--muted); }
.plan ul { list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 0.92rem; flex: 1; }
.plan li::before { content: '✓'; font-weight: 700; color: var(--good); margin-right: 8px; }

/* The palette editor and history: a dialog */
dialog {
    margin: auto; border: 0; border-radius: 18px; padding: 0; width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
    box-shadow: 0 24px 60px rgba(15,23,42,0.3);
}
dialog::backdrop { background: rgba(15,23,42,0.45); }
dialog[open] { animation: dialog-in 0.2s var(--ease-out-expo); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.dialog-inner { display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
.dialog-head, .dialog-foot { padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dialog-head { box-shadow: 0 1px 0 var(--line); }
.dialog-foot { box-shadow: 0 -1px 0 var(--line); }
.dialog-body { padding: 18px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }

.colors { display: flex; flex-direction: column; gap: 8px; }
.color-row { display: grid; grid-template-columns: 40px 104px 1fr 1.4fr 106px; gap: 8px; align-items: start; }
.color-row input[type="color"] { width: 40px; height: 40px; border: 1px solid #cbd5e1; border-radius: 10px; padding: 3px; background: #fff; cursor: pointer; }
.color-row .hex { font-family: 'Inter', ui-monospace, monospace; text-transform: uppercase; }
.color-row .hex[aria-invalid="true"] { border-color: var(--bad); background: var(--bad-bg); }
.color-row .tools, .group-row .tools { display: flex; gap: 2px; }
.group-row { display: flex; gap: 8px; align-items: center; padding-top: 8px; }
.group-row .rule { flex: none; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.group-row input { flex: 1; font-weight: 600; }
.colors-head { display: grid; grid-template-columns: 40px 104px 1fr 1.4fr 106px; gap: 8px; font-size: 0.8rem; font-weight: 600; color: var(--muted); }

.versions { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.versions li { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.versions .meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

@media (max-width: 720px) {
    h1 { font-size: 1.7rem; }
    .plans { grid-template-columns: 1fr; }
    /* One color per card: swatch, hex and tools on top, name and note under them. */
    .color-row { grid-template-columns: 40px 1fr auto; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
    .color-row > * { order: 4; }
    .color-row input[type="color"] { order: 1; }
    .color-row .hex { order: 2; }
    .color-row .tools { order: 3; }
    .color-row .name, .color-row .note-field { grid-column: 1 / -1; }
    .colors-head { display: none; }
    .account .email { display: none; }
    /* 16px stops iPhones zooming in on a field when you tap it. */
    input[type="text"], input[type="email"], input[type="search"], textarea, select { font-size: 16px; }
    .setting, .action-row { flex-direction: column; align-items: stretch; }
    .setting .btn, .action-row .btn { align-self: flex-start; }
    /* The date drops under the email, so addresses never break mid-word. */
    .people li { flex-wrap: wrap; padding-top: 4px; }
    .people .who { flex: 1 1 calc(100% - 60px); overflow-wrap: normal; }
    .people .btn-icon { order: 2; }
    .people .when { order: 3; flex-basis: 100%; margin-top: -8px; padding-bottom: 8px; }
    /* Logo, tag and Sign out must fit a 375px phone without touching the edge. */
    .logo { font-size: 1.25rem; gap: 8px; }
    nav.container { gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
