/* Copyright 2026 CLEALINK TECHNOLOGY CO.,LTD. All rights reserved. */

/* Reset, document defaults and the generic form controls shared by every page. */

*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100%; background: var(--bg); color: var(--text);
  font: 400 var(--fs-14)/1.5 var(--font); -webkit-font-smoothing: antialiased;
}
/* Pages are revealed once their texts are in place. */
html:not(.ready) body { visibility: hidden; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
a { color: var(--link); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled, [aria-disabled="true"] { cursor: not-allowed; }
svg.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Text fields. */
.field { display: flex; flex-direction: column; gap: 5px; font-size: var(--fs-12); color: var(--muted); min-width: 0; }
.input, .select {
  height: 44px; border: 1px solid var(--border-strong); border-radius: var(--r-lg); padding: 0 12px;
  font-size: var(--fs-15); color: var(--text); background: var(--surface); width: 100%; min-width: 0;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.select { height: 38px; border-radius: var(--r-md); padding: 0 10px; font-size: var(--fs-14); }
.input:hover, .select:hover { border-color: var(--faint); }
.input:focus-visible, .select:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 30%, transparent); }
.input[aria-invalid="true"] { border-color: var(--red); }
.input::placeholder { color: var(--faint); }

/* Buttons. */
.btn {
  appearance: none; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  border-radius: var(--r-md); height: 36px; padding: 0 12px; font-size: var(--fs-13); font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--faint); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; }
.btn svg.icon { width: 16px; height: 16px; }
.btn-sm { height: 32px; font-size: var(--fs-12); }
.btn-lg { height: 48px; border-radius: var(--r-lg); }
.btn-primary { border-color: transparent; background: var(--primary); color: var(--on-primary); font-weight: 600; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); border-color: transparent; }
.btn-primary.btn-lg { font-size: var(--fs-15); padding: 0 28px; }
.btn-danger { border-color: var(--danger); background: var(--danger); color: var(--on-danger); font-weight: 600; }
.btn-danger:hover:not(:disabled) { background: var(--danger-hover); border-color: var(--danger-hover); }
.btn[aria-busy="true"] { cursor: progress; }

/* Segmented choice (radio group). */
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--r-md); overflow: hidden; flex: none; max-width: 100%; }
.seg button {
  appearance: none; border: 0; background: var(--surface); color: var(--muted); height: 32px; padding: 0 12px;
  font-size: var(--fs-12); font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px;
}
.seg button + button { border-left: 1px solid var(--border); }
.seg button:hover { color: var(--text); }
.seg button[aria-checked="true"] { background: var(--on-bg); color: var(--on-text); font-weight: 600; }
.seg button[aria-checked="true"]::before { content: "✓"; font-size: 11px; }
.seg button:focus-visible { outline-offset: -2px; }

.kbd {
  display: inline-block; border: 1px solid var(--border-strong); border-radius: var(--r-sm); padding: 2px 8px;
  font: 600 var(--fs-12)/1.4 var(--font); background: var(--raised); color: var(--text); white-space: nowrap;
}

.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: var(--fs-15); color: var(--text); text-decoration: none; }
/* The application's icon. Its colours are fixed: it follows neither the organisation's key colour nor the theme.
   Up to about 24px the drawing with the thinner strokes and the larger dot is used; above that, the full one. */
.brand-mark { width: 20px; height: 20px; display: inline-block; flex: none; background: url("/assets/img/brand/synapse-icon-small.svg") center / contain no-repeat; forced-color-adjust: none; }
.brand-lg { gap: 12px; font-size: var(--fs-20); }
.brand-lg .brand-mark { width: 40px; height: 40px; background-image: url("/assets/img/brand/synapse-icon.svg"); }
/* The mark without its frame, in the colour of the text around it. */
.brand-mark-mono { background: currentColor; -webkit-mask: url("/assets/img/brand/synapse-mark.svg") center / contain no-repeat; mask: url("/assets/img/brand/synapse-mark.svg") center / contain no-repeat; }

.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid color-mix(in srgb, currentColor 25%, transparent); border-top-color: currentColor; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before, :root[data-motion="reduce"] *::after {
  animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important;
}
