/* Sign-in and entry pages, error pages, global banners and the bug-report dialog (canvas-auth boards). */

/* ---- Auth layout: brand top, centred card, footer ------------------------------------------------ */
.pui-auth { min-height: 100dvh; width: 100%; display: flex; flex-direction: column; background: var(--background); box-sizing: border-box; }
.pui-auth-top { display: flex; align-items: center; gap: 10px; padding: 28px 40px; flex: none; }
.pui-auth-brand { font-weight: 700; font-size: 17px; color: #0e2445; letter-spacing: -0.01em; }
.pui-auth-body { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; padding: 0 24px 40px; min-height: 0; }
.pui-auth-foot { display: flex; justify-content: space-between; gap: 16px; padding: 20px 40px; font-size: 12px; color: var(--muted-foreground); flex: none; }
.pui-auth-foot .pui-num { font-size: 12px; }

.pui-auth-card {
    width: 400px; max-width: 100%; box-sizing: border-box; padding: 28px; gap: 20px;
    display: flex; flex-direction: column; background: var(--card); color: var(--card-foreground);
    border: 1px solid var(--border); border-radius: 12px;
}
.pui-auth-h { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.pui-auth-title { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; margin: 0; }
.pui-auth-sub { font-size: 13px; color: var(--muted-foreground); margin: 0; line-height: 1.45; }
.pui-auth-form { display: flex; flex-direction: column; gap: 16px; }
.pui-auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pui-auth-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pui-auth-center { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; }
.pui-auth-center .pui-auth-title { text-align: center; }
.pui-auth-sep { height: 1px; background: var(--border); border: 0; margin: 0; width: 100%; }
.pui-auth-note { font-size: 13px; color: var(--muted-foreground); text-align: center; margin: 0; }
.pui-auth-note-xs { font-size: 12px; color: var(--muted-foreground); text-align: center; margin: 0; }
.pui-auth-note a, .pui-auth-link { color: var(--primary); text-decoration: none; }
.pui-auth-note a:hover, .pui-auth-link:hover { text-decoration: underline; }
.pui-auth-xs { font-size: 12px; }
.pui-auth-block { width: 100%; }
.pui-auth-check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.pui-auth-code { letter-spacing: 0.08em; }
.pui-auth-cta { height: 44px; padding: 0 20px; font-size: 15px; width: 100%; }
.pui-auth-version { font-size: 12px; }

/* Alerts */
.pui-auth-alert { display: flex; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 13px; align-items: flex-start; }
.pui-auth-alert svg { flex: none; width: 16px; height: 16px; margin-top: 1px; }
.pui-auth-alert-info { background: var(--tone-info-bg); border-color: oklch(0.88 0.05 250); color: var(--tone-info-fg); }
.pui-auth-alert-danger { background: var(--tone-danger-bg); border-color: oklch(0.88 0.06 25); color: var(--tone-danger-fg); }
.pui-auth-alert-warning { background: var(--tone-warning-bg); border-color: oklch(0.88 0.08 80); color: var(--tone-warning-fg); }
.pui-auth-alert-success { background: var(--tone-success-bg); border-color: oklch(0.88 0.06 165); color: var(--tone-success-fg); }

/* Status medallion (confirmed, check your email, link no longer valid) */
.pui-auth-medal { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--muted); color: var(--muted-foreground); }
.pui-auth-medal svg { width: 16px; height: 16px; }
.pui-auth-medal-success { background: var(--tone-success-bg); color: var(--tone-success-fg); }
.pui-auth-medal-danger { background: var(--tone-danger-bg); color: var(--tone-danger-fg); }

/* Member details block */
.pui-auth-dl { display: flex; flex-direction: column; gap: 10px; font-size: 13px; padding: 12px 14px; background: var(--muted); border-radius: 10px; margin: 0; }
.pui-auth-dl > * { min-width: 0; }
.pui-auth-dl dd, .pui-auth-dl-value { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }

/* App store badges */
.pui-auth-stores { display: flex; flex-direction: column; gap: 10px; }
.pui-auth-store {
    display: flex; align-items: center; justify-content: center; gap: 10px; height: 48px; border-radius: 8px;
    background: #0e2445; color: #fff; font: 600 14px var(--font-sans); text-decoration: none;
}
.pui-auth-store:hover { background: oklch(0.33 0.07 258); color: #fff; text-decoration: none; }
.pui-auth-store svg { width: 14px; height: 14px; }

/* Company picker */
.pui-auth-cos { display: flex; flex-direction: column; gap: 10px; }
.pui-auth-co {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 1px solid var(--border);
    border-radius: 10px; background: var(--card); font: 400 14px var(--font-sans); text-align: left; cursor: pointer;
    color: var(--foreground); box-sizing: border-box;
}
.pui-auth-co:hover { border-color: var(--primary); background: var(--accent); }
.pui-auth-co:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.pui-auth-co:disabled { opacity: 0.6; cursor: not-allowed; }
.pui-auth-co-avatar {
    width: 36px; height: 36px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--secondary); color: var(--secondary-foreground); font: 600 12px var(--font-sans); flex: none;
}
.pui-auth-co-avatar-first { background: var(--primary); color: #fff; }
.pui-auth-co-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pui-auth-co-role {
    margin-left: auto; display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px;
    border: 1px solid var(--border); font: 500 12px/1 var(--font-sans); white-space: nowrap;
}
.pui-auth-co svg { width: 16px; height: 16px; color: var(--muted-foreground); flex: none; }

/* ---- Error pages (inside the app shell) ---------------------------------------------------------- */
.pui-err { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 0; min-height: calc(100dvh - 80px); width: 100%; box-sizing: border-box; }
.pui-err-box { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; max-width: 420px; }
.pui-err-medal { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--muted); color: var(--muted-foreground); }
.pui-err-medal svg { width: 24px; height: 24px; }
.pui-err-medal-danger { background: var(--tone-danger-bg); color: var(--tone-danger-fg); }
.pui-err-code { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.08em; color: var(--muted-foreground); }
.pui-err-actions { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; justify-content: center; }

/* ---- Global banners and toasts ------------------------------------------------------------------- */
.pui-banner { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; font-size: 13px; font-weight: 500; text-align: center; position: sticky; top: 0; z-index: 40; width: 100%; box-sizing: border-box; }
.pui-banner svg { width: 14px; height: 14px; flex: none; }
.pui-banner-warn { background: oklch(0.78 0.15 75); color: oklch(0.25 0.06 60); }
.pui-toast { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 8px; font-size: 13px; box-shadow: 0 8px 20px oklch(0.2 0.03 258 / 0.18); pointer-events: none; }
.pui-toast svg { width: 16px; height: 16px; flex: none; }
.pui-toast-busy { background: var(--foreground); color: var(--background); }
.pui-toast-ok { background: oklch(0.55 0.13 160); color: #fff; }
.pui-toast-host { position: fixed; right: 16px; bottom: 16px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }

/* ---- Report a bug dialog (board "Bug report, screenshot failed": 560px, centred) ------------------- */
.pui-bug-scrim { position: fixed; inset: 0; z-index: 1000; background: oklch(0.1 0.02 258 / 0.6); }
.pui-bug {
    position: fixed; inset: 0; margin: auto; width: min(560px, calc(100vw - 32px)); height: fit-content; max-height: calc(100vh - 32px);
    z-index: 1001; display: flex; flex-direction: column;
    background: var(--card); border: 1px solid var(--border); border-radius: 14px;
    box-shadow: 0 24px 48px oklch(0.2 0.03 258 / 0.3); overflow: hidden;
}
.pui-bug-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 24px 16px; border-bottom: 1px solid var(--border); flex: none; }
.pui-bug-title { font-size: 17px; font-weight: 600; margin: 0; }
.pui-bug-body { padding: 16px 24px; overflow-y: auto; min-height: 0; flex: 1 1 auto; }
.pui-bug-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pui-bug-file { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; font-size: 13px; color: var(--muted-foreground); }
.pui-bug-file svg { flex: none; }
.pui-bug-file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; color: var(--foreground); }
.pui-bug-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 14px 24px; border-top: 1px solid var(--border); flex: none; }
.pui-bug-actions-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 520px) { .pui-bug-foot, .pui-bug-actions-right { flex-direction: column-reverse; align-items: stretch; width: 100%; } .pui-bug-body, .pui-bug-head { padding-left: 16px; padding-right: 16px; } }

/* ---- Narrow screens ------------------------------------------------------------------------------ */
@media (max-width: 520px) {
    .pui-auth-top { padding: 20px 16px; }
    .pui-auth-foot { padding: 16px; }
    .pui-auth-body { padding: 0 16px 24px; }
    .pui-auth-card { padding: 20px; }
}

/* Password field with "Forgot password?" on the label row */
.pui-auth-pw { position: relative; }
.pui-auth-forgot { position: absolute; top: 2px; right: 0; line-height: 1; }

/* Card typography and controls, per the boards (13 px labels, 6 px label gap, 12 px helper text) */
.pui-auth-card .cn-label { font-size: 13px; }
.pui-auth-card .cn-field { gap: 6px; }
.pui-auth-card [data-slot="field-description"], .pui-auth-card [data-slot="field-error"] { font-size: 12px; margin: 0; }
.pui-auth-card [data-slot="field-error"] { color: var(--tone-danger-fg); }
.pui-auth-card .cn-input[aria-invalid="true"] { border-color: var(--tone-danger-fg); }
.pui-auth-card .cn-toggle-group { display: inline-flex; padding: 3px; gap: 2px; background: var(--muted); border-radius: 8px; height: auto; }
.pui-auth-card .cn-toggle-group > button {
    height: 28px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; box-shadow: none;
    font: 500 13px var(--font-sans); color: var(--muted-foreground);
}
.pui-auth-card .cn-toggle-group > button[aria-pressed="true"] {
    background: var(--card); color: var(--foreground); box-shadow: 0 1px 2px oklch(0.2 0.02 258 / 0.08);
}
.pui-auth-card .cn-toggle-group > button:hover { background: transparent; }
.pui-auth-card .cn-toggle-group > button[aria-pressed="true"]:hover { background: var(--card); }
.pui-auth-card [data-invalid="true"] .cn-label { color: var(--foreground); }
.pui-auth-card .cn-field [data-slot="field-description"] { order: 2; }
.pui-auth-card .cn-field [data-slot="field-error"] { order: 1; }
.pui-auth-stores { align-items: stretch; }
.pui-auth-store { box-sizing: border-box; }
.pui-auth-back { font-size: 13px; }
.pui-auth-back svg { width: 14px; height: 14px; }
.pui-auth-h > :first-child:not(.pui-auth-title) + .pui-auth-title { margin-top: 6px; }
.pui-auth-h [data-slot="badge"] { height: 22px; padding: 0 8px; font-size: 12px; }

.cn-button.pui-auth-co { height: auto; min-height: 62px; padding: 12px 14px; font-size: 14px; font-weight: 400; justify-content: flex-start; border-radius: 10px; gap: 12px; box-sizing: border-box; }
.cn-button.pui-auth-co:hover { border-color: var(--primary); background: var(--accent); }
.cn-button.pui-auth-link { text-decoration: none; font-size: 13px; height: auto; padding: 0; font-weight: 400; }
.cn-button.pui-auth-link:hover { text-decoration: underline; }
a.cn-button.pui-auth-cta, a.cn-button.pui-auth-cta:hover { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; }
a.cn-button-variant-default.pui-auth-cta, a.cn-button-variant-default.pui-auth-cta:hover { color: var(--primary-foreground); }
.pui-err-actions a.cn-button { text-decoration: none; }
.pui-err-actions a.cn-button-variant-default, .pui-err-actions a.cn-button-variant-default:hover { color: var(--primary-foreground); }
