/* ============================================================
   style5-base.css — shared design tokens and primitives.
   "Counsel" theme: a calm, trustworthy professional-services
   look built for accountants and lawyers. Warm paper ground,
   deep ink type, a single confident evergreen action color,
   and a refined Fraunces serif over Inter body / IBM Plex Mono.
   Soft hairline borders, gentle shadows, no glow, no gloss —
   it should feel like a well-made document, not an app skin.
   Loaded by every page, before style5.css (marketing) or
   style5-app.css (application).
   ============================================================ */

/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
  padding: 0;
}

/* Custom properties */
:root {
  color-scheme: light;

  /* SURFACES — warm paper + clean white sheets */
  --color-surface-base: #f5f1e8;
  --color-surface-card: #ffffff;
  --color-surface-solid: #ffffff;
  --color-surface-subtle: #f0ebe0;
  --color-surface-muted: #e7e0d2;
  /* TEXT — ink */
  --color-text-primary: #21262e;
  --color-text-secondary: #5d6571;
  --color-text-strong: #12161c;
  /* BORDERS — soft hairlines */
  --color-border-subtle: #e6e0d3;
  --color-border-strong: #d2cbbb;
  /* PRIMARY — evergreen: money, growth, steady counsel */
  --color-evergreen: #0f7355;
  --color-evergreen-deep: #0b5d44;
  --color-brass: #9a7636;
  --gradient-action: linear-gradient(180deg, #138163 0%, #0f7355 100%);
  --gradient-action-bright: linear-gradient(180deg, #15916f 0%, #11805f 100%);
  --color-action-primary: #0f7355;
  --color-action-primary-hover: #0b5d44;
  /* INFO */
  --color-info-bg: rgba(15, 115, 85, 0.08);
  --color-info-border: rgba(15, 115, 85, 0.26);
  --color-info-text: #0b5d44;
  /* DANGER */
  --color-danger-bg: rgba(176, 35, 42, 0.07);
  --color-danger-border: rgba(176, 35, 42, 0.26);
  --color-danger-text: #9a1f25;
  --color-danger-solid: #b4232a;
  --color-danger-solid-hover: #971a20;
  /* WARNING */
  --color-warning-bg: rgba(168, 116, 24, 0.1);
  --color-warning-border: rgba(168, 116, 24, 0.32);
  --color-warning-text: #835910;
  /* SUCCESS */
  --color-success-bg: rgba(15, 115, 85, 0.1);
  --color-success-border: rgba(15, 115, 85, 0.3);
  --color-success-text: #0b5d44;
  /* CLIENT ACTIVITY — warm clay, distinct from the green */
  --color-client-bg: rgba(176, 106, 44, 0.09);
  --color-client-border: rgba(176, 106, 44, 0.3);
  --color-client-text: #92531e;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-title: "Fraunces", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --radius: 0.625rem;
  --radius-sm: 0.4375rem;
  --radius-pill: 999px;
  --max-width: 1000px;
  --heading-scale: 1;

  --shadow-card: 0 1px 2px rgba(22, 30, 40, 0.05), 0 4px 14px rgba(22, 30, 40, 0.05);
  --shadow-raised: 0 6px 22px rgba(22, 30, 40, 0.1);
  --shadow-deep: 0 24px 64px rgba(18, 24, 32, 0.22);
}

h1 { font-size: calc(2.5rem * var(--heading-scale)); line-height: 1.12; letter-spacing: -0.012em; font-weight: 600; }
h2 { font-size: calc(2rem * var(--heading-scale)); line-height: 1.18; letter-spacing: -0.01em; font-weight: 600; }
h3 { font-size: calc(1.625rem * var(--heading-scale)); line-height: 1.25; letter-spacing: -0.006em; font-weight: 600; }
h4 { font-size: calc(1.25rem * var(--heading-scale)); line-height: 1.3; letter-spacing: 0; font-weight: 600; }
h5 { font-size: calc(1.0625rem * var(--heading-scale)); line-height: 1.35; letter-spacing: 0; font-weight: 600; }
h6 { font-size: calc(0.9375rem * var(--heading-scale)); line-height: 1.4; letter-spacing: 0.01em; font-weight: 600; }

/* Base */
html {
  font-size: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.65;
  color: var(--color-text-primary);
  background-color: var(--color-surface-base);
  background-image:
    radial-gradient(1100px 520px at 100% -8%, rgba(15, 115, 85, 0.05), transparent 60%),
    radial-gradient(900px 460px at -5% 0%, rgba(154, 118, 54, 0.05), transparent 55%);
  background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
  padding-top: 1.5em;
  padding-bottom: 0.5em;
  font-family: var(--font-title);
  font-optical-sizing: auto;
  color: var(--color-text-strong);
  text-wrap: balance;
}

main ul, main ol {
  margin-left: 1.5rem;
  margin-bottom: 0.5rem;
}
main ul li {
  list-style: disc;
}
main p {
  margin-bottom: 0.5rem;
}

a {
  color: var(--color-evergreen-deep);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-decoration-color: var(--color-evergreen);
  text-underline-offset: 0.22em;
}
ul {
  list-style: none;
  margin: 0;
}
img,
svg {
  display: block;
  max-width: 100%;
}

::selection {
  background: rgba(15, 115, 85, 0.2);
  color: var(--color-text-strong);
}

/* Layout utilities */
.page-wrap {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}
.section {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

/* Text utilities */
.field-label {
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-secondary);
}

/* Alerts — tinted note cards */
.alert {
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  line-height: 1.5;
  border: 1px solid transparent;
  border-left-width: 3px;
}
.alert--error {
  background: var(--color-danger-bg);
  color: var(--color-danger-text);
  border-color: var(--color-danger-border);
  border-left-color: var(--color-danger-solid);
}

.alert--warn {
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
  border-color: var(--color-warning-border);
  border-left-color: var(--color-warning-text);
}

.alert--success {
  background: var(--color-success-bg);
  color: var(--color-success-text);
  border-color: var(--color-success-border);
  border-left-color: var(--color-evergreen);
}

/* Input — works on <input> and <textarea> */
.input {
  width: 100%;
  padding: 0.5625rem 0.875rem;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  background: var(--color-surface-card);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    background-color 0.15s;
  box-sizing: border-box;
}
.input:focus {
  border-color: var(--color-evergreen);
  background: var(--color-surface-card);
  box-shadow: 0 0 0 3px rgba(15, 115, 85, 0.16);
}
.input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.input::placeholder {
  color: var(--color-text-secondary);
  opacity: 0.7;
}
textarea.input {
  font-family: var(--font-sans);
  line-height: 1.5;
  resize: vertical;
  min-height: 5rem;
  padding: 0.625rem 0.875rem;
}

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5625rem 1.25rem;
  font-size: 0.875rem;
  line-height: normal;
  font-weight: 600;
  font-family: var(--font-sans);
  letter-spacing: 0.005em;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background-color 0.15s,
    border-color 0.15s,
    color 0.15s,
    opacity 0.15s,
    transform 0.12s ease,
    box-shadow 0.15s ease;
}
.btn--default {
  background: var(--gradient-action);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(11, 93, 68, 0.4);
}
.btn--default:hover, a:hover .btn--default:hover {
  background: var(--gradient-action-bright);
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(11, 93, 68, 0.32);
}
.btn--default:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(11, 93, 68, 0.4);
}
.btn--outline {
  background: var(--color-surface-card);
  color: var(--color-text-primary);
  border-color: var(--color-border-strong);
  box-shadow: 0 1px 1px rgba(22, 30, 40, 0.04);
}
.btn--outline:hover, a:hover .btn--outline:hover {
  background: var(--color-surface-subtle);
  border-color: var(--color-evergreen);
  color: var(--color-evergreen-deep);
  text-decoration: none;
}
.btn--outline:active {
  transform: translateY(1px);
}
.btn.disabled,
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Keyboard focus: visible ring on interactive elements */
.btn:focus-visible {
  outline: 2px solid var(--color-evergreen);
  outline-offset: 2px;
}

/* File type icon — quiet document chips, labelled by extension */
.file-type-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-shrink: 0;
  user-select: none;
  border: 1px solid;
}
.file-icon--image    { background: #fbf2e0; color: #97651a; border-color: #ecdcb9; }
.file-icon--pdf      { background: #f9e7e6; color: #9a1f25; border-color: #eccbc9; }
.file-icon--spreadsheet { background: #e3f1ea; color: #0b5d44; border-color: #c4e0d2; }
.file-icon--text     { background: #eef0f2; color: #4b5563; border-color: #dadee3; }
.file-icon--data     { background: #ece8f5; color: #5b4b9a; border-color: #d6cdec; }
.file-icon--archive  { background: #f6ead9; color: #8a5712; border-color: #e7d2b4; }
.file-icon--document { background: #e5edf7; color: #2b5a96; border-color: #c7d8ec; }
.file-icon--video    { background: #f6e6f1; color: #8a3a72; border-color: #e7c8de; }
.file-icon--audio    { background: #e2eff1; color: #1d6470; border-color: #c3dee2; }
.file-icon--default  { background: #eeece6; color: #5d6571; border-color: #ddd8cc; }

/* Site header — solid paper bar with a hairline rule */
.site-header {
  border-bottom: 1px solid var(--color-border-subtle);
  padding: 0.5rem;
  position: sticky;
  top: 0;
  background: rgba(245, 241, 232, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-width: 0;
}
.site-logo {
  font-weight: 700;
  font-size: 2.5rem;
  text-decoration: none;
  color: var(--color-text-strong);
}
.site-logo:hover {
  text-decoration: none;
  opacity: 0.78;
}
.site-logo img {
  height: 3.5rem;
  margin-bottom: -1rem;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.site-nav__link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 0.12s;
}
.site-nav__link:hover {
  color: var(--color-text-strong);
  text-decoration: none;
}

/* Important-info pages (404, login sent, link expired) */
.important-info {
  padding-top: 6rem;
  padding-bottom: 6rem;
  text-align: center;
}
.important-info__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}
.important-info__code {
  font-size: clamp(3.5rem, 12vw, 7rem);
  font-family: var(--font-title);
  font-weight: 600;
  font-style: italic;
  line-height: 1;
  color: var(--color-evergreen);
}
.important-info__heading {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: clamp(1.25rem, 3.5vw, 1.75rem);
  padding: 0;
}
.important-info__sub {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  max-width: 400px;
}
