/* ==========================================================================
   Phoenix .net cc - shared design tokens and base components
   Brand: blue #0A30BF primary, navy #001B3D, bright #0099FF, tint #E6ECF2
   Type:  Quicksand (Bold headings / Medium subheads / Regular body)
   ========================================================================== */

:root {
  /* Brand palette */
  --brand-blue: #0A30BF;
  --brand-navy: #001B3D;
  --brand-bright: #0099FF;
  --brand-tint: #E6ECF2;
  --brand-grey: #647280;
  --white: #FFFFFF;

  /* Applied roles */
  --accent: var(--brand-blue);
  --accent-soft: rgba(10, 48, 191, 0.08);
  --accent-border: rgba(10, 48, 191, 0.22);

  --ink: #0d1626;
  --ink-soft: #3d4a5c;
  --ink-muted: var(--brand-grey);

  --bg: #f5f7fb;
  --surface: var(--white);
  --line: #dfe5ee;
  --line-soft: #eef2f7;

  /* Status tones */
  --tone-grey: #647280;
  --tone-blue: #0A30BF;
  --tone-purple: #6b3fd4;
  --tone-green: #0f8a4d;
  --tone-red: #cc2b3d;
  --tone-amber: #b8730b;

  /* Shape and depth - "clean shapes, gradients and soft shadows" */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(0, 27, 61, 0.06), 0 1px 3px rgba(0, 27, 61, 0.05);
  --shadow: 0 4px 16px rgba(0, 27, 61, 0.08);
  --shadow-lg: 0 18px 44px rgba(0, 27, 61, 0.14);

  --font: 'Quicksand', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-script: 'PT Mistral Cyrillic', 'Segoe Script', 'Brush Script MT', cursive;

  --gradient-brand: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-navy) 100%);
  --gradient-bright: linear-gradient(135deg, var(--brand-bright) 0%, var(--brand-blue) 100%);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 500;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: var(--font);
  font-weight: 700;
  color: var(--brand-navy);
  line-height: 1.25;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h2 { font-size: clamp(1.3rem, 2.2vw, 1.6rem); }
h3 { font-size: 1.1rem; font-weight: 600; }

p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--ink-muted); }
.small { font-size: 0.85rem; }
.tiny { font-size: 0.78rem; }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mono { font-variant-numeric: tabular-nums; }

/* --- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.94rem;
  padding: 0.62em 1.25em;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.18s ease, background 0.18s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid var(--brand-bright); outline-offset: 2px; }
.btn[disabled], .btn.is-busy { opacity: 0.55; pointer-events: none; transform: none; }

.btn-primary { background: var(--gradient-brand); color: var(--white); box-shadow: var(--shadow-sm); }
.btn-primary:hover { box-shadow: var(--shadow); color: var(--white); }

.btn-bright { background: var(--gradient-bright); color: var(--white); box-shadow: var(--shadow-sm); }
.btn-bright:hover { color: var(--white); }

.btn-ghost { background: var(--white); color: var(--brand-navy); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-quiet { background: transparent; color: var(--ink-muted); padding: 0.5em 0.85em; }
.btn-quiet:hover { color: var(--accent); background: var(--accent-soft); }

.btn-danger { background: var(--white); color: var(--tone-red); border-color: rgba(204, 43, 61, 0.35); }
.btn-danger:hover { background: var(--tone-red); color: var(--white); }

.btn-success { background: linear-gradient(135deg, #12a05c, #0f8a4d); color: var(--white); }
.btn-success:hover { color: var(--white); }

.btn-lg { font-size: 1.05rem; padding: 0.8em 1.8em; }
.btn-sm { font-size: 0.82rem; padding: 0.45em 0.9em; }
.btn-block { width: 100%; }

/* --- Cards and surfaces -------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 1.5rem; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--line-soft);
}
.card-head h2, .card-head h3 { margin: 0; }

/* --- Badges -------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 0.4em;
  font-size: 0.76rem; font-weight: 700; letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.32em 0.75em;
  border-radius: 999px;
  background: var(--brand-tint);
  color: var(--brand-navy);
  white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-grey   { background: #eef1f5; color: var(--tone-grey); }
.badge-blue   { background: rgba(10, 48, 191, 0.10); color: var(--tone-blue); }
.badge-purple { background: rgba(107, 63, 212, 0.12); color: var(--tone-purple); }
.badge-green  { background: rgba(15, 138, 77, 0.12); color: var(--tone-green); }
.badge-red    { background: rgba(204, 43, 61, 0.12); color: var(--tone-red); }
.badge-amber  { background: rgba(184, 115, 11, 0.14); color: var(--tone-amber); }
.badge-plain::before { display: none; }

/* --- Forms --------------------------------------------------------------- */
label, .label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-navy);
  margin-bottom: 0.35rem;
  letter-spacing: 0.01em;
}
.hint { font-size: 0.8rem; color: var(--ink-muted); margin-top: 0.3rem; font-weight: 500; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="search"], input[type="tel"], input[type="url"],
select, textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--white);
  padding: 0.65em 0.85em;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea { resize: vertical; min-height: 90px; line-height: 1.55; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input[type="color"] {
  width: 48px; height: 38px; padding: 2px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--white);
}
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%23647280' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.8em center; background-size: 11px; padding-right: 2.2em; }

.field { margin-bottom: 1.1rem; }
.field-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.check {
  display: flex; align-items: flex-start; gap: 0.6rem;
  font-weight: 500; font-size: 0.92rem; color: var(--ink-soft);
  margin-bottom: 0.6rem; cursor: pointer;
}
.check input[type="checkbox"] { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); cursor: pointer; flex: none; }
.check span { font-weight: 500; }

/* --- Tables -------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.data th {
  text-align: left; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--ink-muted); font-weight: 700;
  padding: 0.7rem 0.9rem; border-bottom: 1.5px solid var(--line);
  white-space: nowrap;
}
table.data td { padding: 0.85rem 0.9rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: #fafbfd; }

/* --- Alerts -------------------------------------------------------------- */
.alert {
  display: flex; gap: 0.75rem; align-items: flex-start;
  padding: 0.9rem 1.1rem; border-radius: var(--radius-sm);
  font-size: 0.92rem; font-weight: 500;
  border: 1.5px solid; margin-bottom: 1.2rem;
}
.alert-error   { background: rgba(204, 43, 61, 0.07); border-color: rgba(204, 43, 61, 0.3); color: #8f1e2b; }
.alert-success { background: rgba(15, 138, 77, 0.08); border-color: rgba(15, 138, 77, 0.3); color: #0b6538; }
.alert-info    { background: var(--accent-soft); border-color: var(--accent-border); color: var(--brand-navy); }
.alert-warn    { background: rgba(184, 115, 11, 0.1); border-color: rgba(184, 115, 11, 0.32); color: #8a5608; }

/* --- Empty state --------------------------------------------------------- */
.empty { text-align: center; padding: 3.5rem 1.5rem; color: var(--ink-muted); }
.empty h3 { color: var(--brand-navy); margin-bottom: 0.4rem; }
.empty-icon {
  width: 56px; height: 56px; margin: 0 auto 1rem;
  display: grid; place-items: center;
  background: var(--brand-tint); border-radius: 50%; color: var(--accent);
}

/* --- Access code display ------------------------------------------------- */
.code-chip {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: 'Consolas', 'SF Mono', monospace;
  font-size: 1.05rem; font-weight: 700; letter-spacing: 0.22em;
  background: var(--brand-navy); color: var(--white);
  padding: 0.4em 0.5em 0.4em 0.72em; border-radius: var(--radius-sm);
}

/* --- Utilities ----------------------------------------------------------- */
.stack > * + * { margin-top: 1rem; }
.row { display: flex; align-items: center; gap: 0.75rem; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--line-soft); margin: 1.4rem 0; border: 0; }

/* Rich text rendered from the editor */
.rich h2, .rich h3, .rich h4 { margin-top: 1.6em; }
.rich ul, .rich ol { padding-left: 1.4em; margin: 0 0 1em; }
.rich li { margin-bottom: 0.4em; }
.rich blockquote {
  margin: 1.2em 0; padding: 0.8em 1.2em;
  border-left: 3px solid var(--accent); background: var(--accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--ink-soft);
}
.rich table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: 0.93rem; }
.rich th, .rich td { border: 1px solid var(--line); padding: 0.6em 0.8em; text-align: left; }
.rich th { background: var(--brand-tint); font-weight: 700; }
.rich img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.rich a { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* --- Logo ---------------------------------------------------------------- */
.logo { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--brand-blue); }
.logo-invert { color: var(--white); }
.logo-mark { width: 34px; height: 28px; flex: none; }
.logo-img { max-height: 44px; width: auto; display: block; }
.logo-sm .logo-mark { width: 27px; height: 22px; }
.logo-sm .logo-img { max-height: 34px; }
.logo-lg .logo-mark { width: 46px; height: 38px; }
.logo-lg .logo-img { max-height: 62px; }
.logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.logo-name { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; color: currentColor; }
.logo-sm .logo-name { font-size: 0.95rem; }
.logo-lg .logo-name { font-size: 1.4rem; }
.logo-dot { color: var(--brand-bright); }
.logo-invert .logo-dot { color: #9fd0ff; }
.logo-tag {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  opacity: 0.72; color: currentColor;
}
