/* ============================================================
   style6-base.css — shared design tokens and primitives.
   "Parcel Post" theme, professional register: the app side of
   the postal brand. Manila-envelope paper ground, postal ink
   navy type, a single confident airmail-blue action color, and
   Bricolage Grotesque headings over Inter body / IBM Plex Mono.
   Soft hairline borders, gentle shadows — the stamps, stripes
   and jokes live in style6.css (marketing) only; here it should
   feel like well-run correspondence, not an app skin.
   Loaded by every page, before style6.css (marketing) or
   style6-app.css (application).
   ============================================================ */

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

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

  /* SURFACES — manila envelope + white label stock */
  --color-surface-base: #f3ecdb;
  --color-surface-card: #fffdf6;
  --color-surface-solid: #fffdf6;
  --color-surface-subtle: #ede3cc;
  --color-surface-muted: #e3d5b4;
  /* TEXT — postal ink */
  --color-text-primary: #2b3247;
  --color-text-secondary: #5b6175;
  --color-text-strong: #161c30;
  /* BORDERS — soft hairlines */
  --color-border-subtle: #ddd0b0;
  --color-border-strong: #c2b189;
  /* PRIMARY — airmail blue: official, first-class (kept under
     the historical evergreen token names so shared components
     restyle without a rename sweep) */
  --color-evergreen: #24509e;
  --color-evergreen-deep: #1b3d7c;
  --color-brass: #a3772e;
  --gradient-action: linear-gradient(180deg, #2b5cb4 0%, #24509e 100%);
  --gradient-action-bright: linear-gradient(180deg, #3568c4 0%, #2b5cb4 100%);
  --color-action-primary: #24509e;
  --color-action-primary-hover: #1b3d7c;
  /* INFO */
  --color-info-bg: rgba(36, 80, 158, 0.08);
  --color-info-border: rgba(36, 80, 158, 0.26);
  --color-info-text: #1b3d7c;
  /* 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: "Bricolage Grotesque", "Inter", -apple-system, sans-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(36, 80, 158, 0.045), transparent 60%),
    radial-gradient(900px 460px at -5% 0%, rgba(163, 119, 46, 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(36, 80, 158, 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(36, 80, 158, 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(22, 46, 92, 0.4);
}
.btn--default:hover, a:hover .btn--default:hover {
  background: var(--gradient-action-bright);
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(22, 46, 92, 0.32);
}
.btn--default:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(22, 46, 92, 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;
}

.link-button {
  display: inline-block;
  background: none;
  border: none;
  padding: 0;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--color-action-primary);
  text-decoration: underline;
  cursor: pointer;
}
.link-button:hover {
  opacity: 0.8;
}

/* 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(243, 236, 219, 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;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.lang-picker {
  position: relative;
}
.lang-picker__trigger {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
  background: none;
  border: 1px solid var(--color-border-subtle);
  border-radius: 0.25rem;
  padding: 0.2rem 0.45rem;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
}
.lang-picker__trigger:hover {
  color: var(--color-text-primary);
  border-color: var(--color-border-strong);
}
.lang-picker__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.25rem);
  background: var(--color-surface-card);
  border: 1px solid var(--color-border-subtle);
  border-radius: 0.375rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  min-width: 4rem;
  z-index: 100;
  overflow: hidden;
}
.lang-picker__menu[hidden] {
  display: none;
}
.lang-picker__option {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
  background: none;
  border: none;
  padding: 0.4rem 0.75rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.lang-picker__option:hover {
  background: var(--color-surface-subtle);
  color: var(--color-text-primary);
}

/* 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;
}
