/**
 * @file        style.css
 * @description SynthMailClean styles: SynthetixMind palette, Sora / IBM Plex fonts, responsive 360-1920 px (NFR-14, NFR-15)
 *
 * @author      Thomas Dobler - SYNTHETIXMIND LTD
 * @company     SYNTHETIXMIND LTD, Paphos, Cyprus
 * @url         https://synthetixmind.com
 *
 * @uid         275ddf06-9833-4bdc-95e6-a1b62b44aa6a
 * @version     0.1.0.1
 * @created     2026-11-27
 * @updated     2026-11-27
 *
 * @copyright   (c) 2026 by SYNTHETIXMIND LTD
 * @license     Proprietary — All rights reserved
 */

@font-face { font-family: 'Sora'; font-weight: 600; font-display: swap; src: url('/fonts/sora-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; font-display: swap; src: url('/fonts/ibm-plex-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-display: swap; src: url('/fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); }

/* Brand palette (SynthMailClean-BrandIdentity.md). Orange is never used for text. */
:root {
  --navy: #1C2C37;
  --orange: #FA5800;
  --white: #F2F4F6;
  --beige: #EADDD3;
  --mahogany: #6B2D19;
  --surface: #FFFFFF;
  --line: #CBD2D9;
  --muted: #4A5964;
  --ok: #1E6B3A;
  --radius: 8px;
  --font-display: 'Sora', 'Segoe UI', sans-serif;
  --font-text: 'IBM Plex Sans', 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--white); color: var(--navy); font: 400 16px/1.5 var(--font-text); min-height: 100vh; display: flex; flex-direction: column; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.25; margin: 0 0 16px; }
h1 { font-size: 28px; }
h2 { font-size: 20px; margin-top: 32px; }
h3 { font-size: 17px; }
p { margin: 0 0 12px; }
a { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--mahogany); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.mono, code, pre { font-family: var(--font-mono); }
code { background: var(--beige); padding: 1px 5px; border-radius: 4px; font-size: 0.92em; word-break: break-all; }
pre { background: var(--navy); color: var(--white); padding: 14px 16px; border-radius: var(--radius); overflow-x: auto; font-size: 14px; }
pre code { background: none; padding: 0; color: inherit; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: var(--surface); padding: 8px 12px; z-index: 10; }

/* Buttons: one orange primary action per view; destructive actions in mahogany. */
.button, button.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 18px; border-radius: var(--radius);
  border: 2px solid var(--navy); background: var(--surface); color: var(--navy); font: 600 16px var(--font-text); text-decoration: none; cursor: pointer; }
.button:hover { background: var(--beige); color: var(--navy); }
/* Navy on orange is 4.41:1, so primary labels are bold and at least 19 px (large text). */
.button.button-primary { background: var(--orange); border-color: var(--orange); color: var(--navy); font-size: 19px; font-weight: 700; }
.button.button-primary:hover { background: #E04F00; border-color: #E04F00; color: var(--navy); }
.button.button-danger { background: var(--mahogany); border-color: var(--mahogany); color: var(--white); }
.button.button-danger:hover { background: #561F0F; color: var(--white); }
.button-small { min-height: 36px; padding: 4px 12px; font-size: 14px; }
.button[disabled], button[disabled] { opacity: 0.55; cursor: not-allowed; }
.link-button { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline { display: inline; }

/* Forms */
form.stack { display: grid; gap: 16px; max-width: 520px; }
label { display: block; font-weight: 600; margin-bottom: 4px; }
.hint { font-size: 14px; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=date], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid #8A96A0; border-radius: var(--radius); background: var(--surface); color: var(--navy); font: 400 16px var(--font-text); }
input[aria-invalid=true] { border-color: var(--mahogany); border-width: 2px; }
.field-error { color: var(--mahogany); font-size: 14px; font-weight: 600; margin: 4px 0 0; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.checkbox input { width: 20px; height: 20px; margin-top: 2px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 20px; background: var(--surface); }
legend { font: 600 17px var(--font-display); padding: 0 6px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }

/* Banners */
.banner { padding: 12px 16px; border-radius: var(--radius); margin: 0 0 20px; border-left: 6px solid var(--navy); background: var(--beige); }
.banner-error { border-left-color: var(--mahogany); color: var(--mahogany); font-weight: 600; }
.banner-ok { border-left-color: var(--ok); }
.banner a { color: inherit; }

/* Public pages */
.public-header { padding: 20px 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; font: 600 20px var(--font-display); }
.brand img { border-radius: 8px; }
.public-card { width: min(480px, calc(100% - 32px)); margin: 24px auto 48px; background: var(--surface); padding: 32px; border-radius: 12px; box-shadow: 0 1px 3px rgba(28,44,55,0.12); }
.public-wide { width: min(960px, calc(100% - 32px)); margin: 24px auto 48px; }
.panel { background: var(--beige); border-radius: var(--radius); padding: 16px 20px; margin: 0 0 20px; }
.panel ul { margin: 8px 0 0; padding-left: 20px; }
.result-icon { font: 600 40px var(--font-display); line-height: 1; margin-bottom: 12px; }

/* App layout: sidebar on desktop (>= 1024 px), top menu below that */
.topbar { display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: var(--navy); color: var(--white); }
.topbar .brand { color: var(--white); font-size: 18px; }
.tag { font: 600 12px var(--font-text); text-transform: uppercase; letter-spacing: 0.06em; background: var(--white); color: var(--navy); border-radius: 4px; padding: 2px 6px; }
.account { margin-left: auto; display: flex; gap: 16px; align-items: center; font-size: 14px; }
.account form { margin: 0; }
.account .link-button { color: var(--white); }
.menu-toggle { display: none; margin-left: auto; background: none; color: var(--white); border: 2px solid var(--white); border-radius: var(--radius); min-height: 40px; padding: 4px 12px; font: 600 15px var(--font-text); }
.layout { display: flex; flex: 1 0 auto; width: 100%; max-width: 1480px; margin: 0 auto; }
.sidebar { width: 230px; flex-shrink: 0; padding: 24px 12px; display: flex; flex-direction: column; gap: 4px; }
.sidebar a { text-decoration: none; padding: 10px 14px; border-radius: var(--radius); font-weight: 500; border-left: 4px solid transparent; }
.sidebar a:hover { background: var(--beige); color: var(--navy); }
.sidebar a[aria-current=page] { background: var(--surface); border-left-color: var(--orange); font-weight: 600; }
.content { flex: 1; min-width: 0; max-width: 1200px; padding: 28px 24px 48px; }

/* Cards and tables */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 24px; }
.card { background: var(--surface); border-radius: 12px; padding: 18px 20px; box-shadow: 0 1px 3px rgba(28,44,55,0.10); }
.stat-label { font-size: 14px; color: var(--muted); font-weight: 500; }
.stat-value { font: 600 30px var(--font-display); margin-top: 4px; font-variant-numeric: tabular-nums; }
/* "New today" carries an orange bar, not orange text (2.95:1 would fail). */
.stat-accent { border-top: 5px solid var(--orange); }
.table-wrap { overflow-x: auto; background: var(--surface); border-radius: 12px; box-shadow: 0 1px 3px rgba(28,44,55,0.10); margin-bottom: 24px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid #E1E6EA; vertical-align: top; }
th { font-weight: 600; background: #E9EDF0; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.num { font-family: var(--font-mono); }
tr.row-error td { background: #F6E9E4; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; white-space: nowrap; }
.status::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.status-ok::before { background: var(--ok); }
.status-error { color: var(--mahogany); }
.status-error::before { background: var(--mahogany); }
.status-warn::before { background: var(--orange); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; text-decoration: none; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 16px; }
.toolbar form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.toolbar input, .toolbar select { width: auto; min-width: 200px; }
.pagination { display: flex; gap: 12px; align-items: center; }
.truncate { max-width: 320px; }
details summary { cursor: pointer; }
.key-box { display: flex; gap: 8px; align-items: stretch; margin: 12px 0; }
.key-box input { font-family: var(--font-mono); font-size: 14px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }

/* Dialogs */
dialog { border: 0; border-radius: 12px; padding: 24px; max-width: min(520px, calc(100% - 32px)); color: var(--navy); box-shadow: 0 10px 40px rgba(28,44,55,0.3); }
dialog::backdrop { background: rgba(28,44,55,0.55); }
dialog h2 { margin-top: 0; }

/* Footer */
.site-footer { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: center; padding: 18px 16px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); margin-top: auto; }
.site-footer a { color: var(--muted); }

/* API docs */
.endpoint { background: var(--surface); border-radius: 12px; padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(28,44,55,0.10); }
.method { font: 600 14px var(--font-mono); background: var(--navy); color: var(--white); padding: 2px 8px; border-radius: 4px; margin-right: 8px; }

@media (max-width: 1023px) {
  .layout { flex-direction: column; }
  .menu-toggle { display: inline-flex; }
  .account { margin-left: 0; }
  .topbar { flex-wrap: wrap; }
  .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
  .sidebar.collapsed { display: none; }
  .content { padding: 20px 16px 40px; }
}
@media (max-width: 480px) {
  .public-card { padding: 22px 18px; }
  h1 { font-size: 24px; }
  .toolbar input, .toolbar select { min-width: 0; width: 100%; }
  .account .mono { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
