@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ============================================================
   SLR Family Print — print.slr.family

   The design system from documents.slr.family, carried over so
   the sites read as one product. One substitution: the vault's
   violet accent becomes the print blue, because the only button
   that matters on this site is a dark blue "Print".

   The page is one column at every width. There is exactly one
   thing to do here — write a message and send it to a printer —
   so the phone layout and the desktop layout are the same
   layout, just wider.
   ============================================================ */

:root {
  /* Brand — dark blue, the Print button's colour */
  --accent:          #16407a;
  --accent-hover:    #102f5c;
  --accent-soft:     #e9eff8;
  --accent-ring:     rgba(22, 64, 122, .18);

  /* Bars */
  --rail:            #1b2a3a;
  --rail-text:       #b9c6d3;
  --rail-faint:      #6f8298;

  /* Surfaces */
  --bg:              #f4f5f7;
  --surface:         #ffffff;
  --border:          #e2e5ea;
  --border-strong:   #cbd2db;

  /* Text */
  --text:            #1a2733;
  --text-muted:      #5c6b7a;
  --text-faint:      #8a97a4;

  /* State */
  --danger:          #d0342c;
  --danger-soft:     #fdeceb;
  --ok:              #217a44;
  --ok-soft:         #e8f6ee;

  --radius:          8px;
  --radius-sm:       6px;
  --shadow:          0 1px 2px rgba(20, 35, 50, .08);
  --shadow-lg:       0 8px 24px -8px rgba(20, 35, 50, .25);

  --topbar-h:        56px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
::selection { background: var(--accent-soft); color: var(--text); }

/* ── The family mark ──────────────────────────────────────── */

.rail-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  flex: none;
}

/* ── Buttons ──────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn:hover:not(:disabled) { background: #f7f8fa; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-block { width: 100%; }

/* The one button this whole site exists for. Centred, filled dark blue,
   white text — and big enough to be the obvious end of the form. */
.print-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 20px 26px;
  border-top: 1px solid var(--border);
  background: #fbfcfd;
}

.btn-print {
  min-width: 220px;
  height: 48px;
  padding: 0 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #ffffff;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: var(--shadow);
  transition: background .12s, box-shadow .12s, transform .06s;
}
.btn-print:hover:not(:disabled) { background: var(--accent-hover); box-shadow: var(--shadow-lg); }
.btn-print:active:not(:disabled) { transform: translateY(1px); }
.btn-print:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }

.print-hint {
  font-size: 12px;
  color: var(--text-faint);
  text-align: center;
  max-width: 420px;
}

/* ── Top bar ──────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: var(--rail);
  color: #fff;
}
.topbar .rail-mark { background: rgba(255, 255, 255, .14); }
.topbar-title { font-size: 14.5px; font-weight: 600; }
.topbar-title span { display: block; font-size: 11.5px; font-weight: 400; color: var(--rail-faint); }
.topbar-spacer { flex: 1; }

.who {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.who-email {
  font-size: 12.5px;
  color: var(--rail-text);
  max-width: 46vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 600;
  object-fit: cover;
  flex: none;
}
.signout {
  border: 1px solid rgba(255, 255, 255, .22);
  background: transparent;
  color: var(--rail-text);
  height: 30px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  cursor: pointer;
}
.signout:hover { background: rgba(255, 255, 255, .1); color: #fff; }

/* ── The composer ─────────────────────────────────────────── */

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 22px 16px 48px;
}

.page-head { margin-bottom: 16px; }
.page-head h1 { font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.page-head p { margin-top: 3px; font-size: 13px; color: var(--text-muted); }

.compose {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.compose-head {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  background: var(--rail);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
}

/* One row of the header block — the To / Subject lines of an email. */
.field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  min-height: 48px;
}
.field > label,
.field > .field-label {
  flex: none;
  width: 68px;
  font-size: 13px;
  color: var(--text-muted);
}
.field-body { flex: 1; min-width: 0; }

.field input[type="text"],
.field select {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  padding: 12px 0;
}
.field input[type="text"]:focus,
.field select:focus { outline: none; }
.field input::placeholder { color: var(--text-faint); }

.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235c6b7a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
  cursor: pointer;
}

/* The signed-in address, shown the way a mail client shows "From". */
.from-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  padding: 12px 0;
}
.from-line .avatar { background: var(--accent-soft); color: var(--accent); }

.printer-note {
  font-size: 12px;
  color: var(--text-faint);
  padding: 0 16px 12px;
  border-bottom: 1px solid var(--border);
  margin-top: -4px;
}

.body-wrap { padding: 4px 16px 8px; }
textarea#body {
  width: 100%;
  min-height: 220px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.6;
  padding: 12px 0;
  resize: vertical;
}
textarea#body:focus { outline: none; }
textarea#body::placeholder { color: var(--text-faint); }

/* ── Attachments ──────────────────────────────────────────── */

.attach-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.attach-bar .spacer { flex: 1; }
.attach-count { font-size: 12px; color: var(--text-faint); }

.files { list-style: none; padding: 0 16px 12px; display: grid; gap: 8px; }
.files:empty { display: none; }
.file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fbfcfd;
  font-size: 13px;
}
.file .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .size { color: var(--text-faint); font-size: 12px; flex: none; }
.file .drop {
  border: none;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  border-radius: 4px;
  flex: none;
}
.file .drop:hover { background: var(--danger-soft); color: var(--danger); }
.file .ico { color: var(--text-muted); flex: none; display: inline-flex; }

/* Dropping a file anywhere on the composer works; this is the cue. */
.compose.dragging { outline: 2px dashed var(--accent); outline-offset: -4px; }

/* ── Notices ──────────────────────────────────────────────── */

.notice {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  border: 1px solid transparent;
}
.notice .ico { flex: none; margin-top: 1px; display: inline-flex; }
.is-danger { background: var(--danger-soft); border-color: #f6cfcc; color: #8f231d; }
.is-ok     { background: var(--ok-soft);     border-color: #c6e6d3; color: #165931; }

#status { margin-bottom: 14px; }
#status:empty { display: none; }

/* ── Spinner ──────────────────────────────────────────────── */

.spin {
  width: 15px; height: 15px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Sign-in screen ───────────────────────────────────────── */

.auth {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg);
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 26px 24px;
}
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.auth-brand strong { display: block; font-size: 14px; }
.auth-brand span { font-size: 12px; color: var(--text-faint); }
.auth-card h1 { font-size: 20px; font-weight: 600; margin-bottom: 6px; }
.auth-card > p { font-size: 13px; color: var(--text-muted); margin-bottom: 18px; }
.auth-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 11.5px;
  color: var(--text-faint);
}
.auth-note { text-align: center; margin-top: 14px; font-size: 12px; color: var(--text-faint); }
.auth-note a { color: var(--accent); }

/* ── Phones ───────────────────────────────────────────────── */

@media (max-width: 560px) {
  /* 16px is the threshold below which iOS Safari zooms the page on focus.
     Anything the user types into has to sit at or above it. */
  .field input[type="text"],
  .field select,
  textarea#body { font-size: 16px; }

  .page { padding: 16px 12px 40px; }
  .field { padding: 0 13px; gap: 8px; }
  .field > label, .field > .field-label { width: 58px; font-size: 12.5px; }
  .body-wrap { padding: 4px 13px 8px; }
  .attach-bar, .files, .printer-note { padding-left: 13px; padding-right: 13px; }
  .btn-print { width: 100%; min-width: 0; }
  .who-email { display: none; }
  .topbar-title span { display: none; }
}
