/* Application Letter Maker (BD) — ToolNest mobile-first styles.
   System font stack only (no webfont downloads, PRD 8).
   Print: A4, 20mm margins, letter 12pt / 1.6 (PRD 7.7). */

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Bengali", "Nirmala UI", sans-serif;
  background: #f4f7f5;
  color: #17211d;
  line-height: 1.5;
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 12px 14px 32px;
}

header.site {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 0 4px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.05rem;
}

.brand .tool { font-weight: 600; color: #0b6b57; }

.spacer { flex: 1; }

.lang-toggle {
  display: flex;
  border: 1px solid #b9ccc4;
  border-radius: 8px;
  overflow: hidden;
}

.lang-toggle button {
  border: 0;
  background: #fff;
  padding: 10px 14px;
  min-height: 44px;
  cursor: pointer;
  font: inherit;
}

.lang-toggle button[aria-pressed="true"] {
  background: #0b6b57;
  color: #fff;
}

h1 { font-size: 1.45rem; line-height: 1.3; margin: 14px 0 8px; }
h2 { font-size: 1.2rem; margin: 4px 0 6px; }
h3 { font-size: 1.05rem; margin: 16px 0 6px; }

.hint { color: #3c4a44; font-size: 0.92rem; margin: 4px 0 8px; }
.counts { color: #3c4a44; font-size: 0.92rem; margin: 6px 0 2px; min-height: 1.2em; }

.banner {
  padding: 10px 12px;
  border-radius: 8px;
  margin: 10px 0;
}

.banner.warn { background: #fdf3e3; border: 1px solid #e8c98a; }
.banner.info { background: #eef4f1; border: 1px solid #b9ccc4; }

.confirm-bar {
  background: #fdf3e3;
  border: 1px solid #e8c98a;
  border-radius: 8px;
  padding: 12px;
  margin: 10px 0;
}

.card {
  background: #fff;
  border: 1px solid #d8e2dd;
  border-radius: 12px;
  padding: 16px;
  margin: 14px 0;
}

label { display: block; font-weight: 600; margin: 6px 0 4px; }

input[type="text"], input[type="date"], textarea, select {
  width: 100%;
  padding: 11px 12px;
  min-height: 44px;
  border: 1px solid #b9ccc4;
  border-radius: 8px;
  font: inherit;
  background: #fff;
  color: inherit;
}

textarea { resize: vertical; overflow-wrap: anywhere; white-space: pre-wrap; }

textarea[readonly] { background: #f4f7f5; }

input:focus-visible, textarea:focus-visible, button:focus-visible,
a:focus-visible, summary:focus-visible, select:focus-visible {
  outline: 3px solid #f2a93b;
  outline-offset: 1px;
}

.field { margin: 4px 0; }

.choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  margin: 6px 14px 6px 0;
  min-height: 44px;
  cursor: pointer;
}

.choice input[type="checkbox"] { width: 20px; height: 20px; }

.row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin: 10px 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid #0b6b57;
  border-radius: 8px;
  background: #fff;
  color: #0b6b57;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn.primary { background: #0b6b57; color: #fff; }
.btn.small-btn { min-height: 44px; padding: 7px 12px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.plain-list { margin: 6px 0 10px; padding-left: 20px; }
.plain-list li { margin: 4px 0; overflow-wrap: anywhere; }

.no-changes {
  background: #eef4f1;
  border-left: 4px solid #0b6b57;
  padding: 10px 12px;
  border-radius: 6px;
  margin: 10px 0;
}

details {
  border: 1px solid #d8e2dd;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 0;
}

summary { font-weight: 600; cursor: pointer; min-height: 44px; display: flex; align-items: center; }

footer { color: #3c4a44; font-size: 0.92rem; margin-top: 18px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Letter preview / print DOM ---------- */

.letter-sheet {
  background: #fff;
  border: 1px solid #c9d4ce;
  box-shadow: 0 2px 10px rgba(23, 33, 29, 0.12);
  padding: 28px 24px;
  margin: 14px auto;
  max-width: 210mm;
  color: #000;
  font-size: 12pt;
  line-height: 1.6;
}

.letter-block {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0 0 1em;
}

.letter-block:last-child { margin-bottom: 0; }

.letter-subject { font-weight: 700; }

.letter-signature { break-inside: avoid; }

.signature-gap { height: 2.2em; }

@media (max-width: 480px) {
  h1 { font-size: 1.25rem; }
  .card { padding: 13px; }
  .letter-sheet { padding: 18px 14px; font-size: 11pt; }
}

/* ---------- Print (PRD 7.7) ---------- */

@page {
  size: A4;
  margin: 20mm;
}

@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .wrap { max-width: none; padding: 0; margin: 0; }
  #preview-section { border: 0; padding: 0; margin: 0; background: #fff; }
  .letter-sheet {
    border: 0;
    box-shadow: none;
    margin: 0;
    padding: 0;
    max-width: none;
    font-size: 12pt;
    line-height: 1.6;
  }
  .letter-signature { break-inside: avoid; }
}
