/* Debt Recovery Letter Builder - Modern Legal UI */



:root{
  --primary: #0b2a4a; /* deep navy */
  --primary-2: #123b66;
  --bg: #f6f8fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e5e7eb;
  --shadow: 0 10px 30px rgba(2, 8, 23, .08);
  --shadow2: 0 6px 18px rgba(2, 8, 23, .08);
  --radius: 18px;
}

html, body { height: 100%; }
body{
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 20% 0%, rgba(11,42,74,.08), transparent 55%),
              radial-gradient(1000px 600px at 85% 10%, rgba(18,59,102,.08), transparent 55%),
              var(--bg);
  color: var(--text);
}

a { color: var(--primary-2); }

.app-shell{
  padding: 28px 0 46px;
}

.brand{
  display:flex;
  gap:14px;
  align-items:center;
}
.brand-badge{
  width:44px;
  height:44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: var(--shadow2);
  display:flex; align-items:center; justify-content:center;
  color:#fff;
  font-weight: 700;
}

.header-title{
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing:-.02em;
  margin:0;
}
.header-sub{
  margin:2px 0 0;
  color: var(--muted);
  font-size:.95rem;
}

.main-card{
  background: var(--card);
  border: 1px solid rgba(15, 23, 42, .06);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}

.main-card .card-body{
  padding: 22px 22px 8px;
}

.stepper{
  display:flex;
  flex-wrap: wrap;
  gap:10px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, .06);
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,.75));
}

.step-pill{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, .10);
  color: var(--muted);
  background: rgba(15, 23, 42, .02);
  user-select:none;
  cursor: default;
}

.step-pill .num{
  width: 26px; height: 26px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .08);
  color: #0f172a;
  display:flex; align-items:center; justify-content:center;
  font-weight: 700;
  font-size:.9rem;
}

.step-pill.active{
  border-color: rgba(11,42,74,.35);
  background: rgba(11,42,74,.06);
  color: var(--text);
}
.step-pill.active .num{
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color:#fff;
}

.step-title{
  margin: 2px 0 6px;
  font-size: 1.25rem;
  font-weight: 750;
  letter-spacing:-.02em;
}
.step-help{
  margin:0 0 14px;
  color: var(--muted);
}

.form-section{
  padding: 14px 14px 6px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, .07);
  background: rgba(2, 8, 23, .015);
  margin-bottom: 14px;
}

.form-section h6{
  margin: 0 0 12px;
  font-weight: 700;
  color: #0f172a;
}

.form-label{
  font-weight: 600;
  color: #111827;
}

.form-control, .form-select{
  border-radius: 14px;
  border-color: rgba(15, 23, 42, .12);
  padding: .72rem .9rem;
}
.form-control:focus, .form-select:focus{
  border-color: rgba(11,42,74,.45);
  box-shadow: 0 0 0 .25rem rgba(11,42,74,.12);
}
.form-text{
  color: var(--muted);
}

.footer-bar{
  position: sticky;
  bottom: 0;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(15, 23, 42, .06);
  padding: 14px 22px;
  display:flex;
  gap:12px;
  justify-content: space-between;
  align-items:center;
}

.btn-primary{
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border: none;
  border-radius: 14px;
  padding: .72rem 1.05rem;
  font-weight: 650;
  box-shadow: 0 10px 22px rgba(11,42,74,.18);
}
.btn-primary:hover{ filter: brightness(1.03); }
.btn-outline-secondary{
  border-radius: 14px;
  padding: .72rem 1.05rem;
}

.btn-soft{
  border-radius: 14px;
  padding: .72rem 1.05rem;
  font-weight: 650;
  background: rgba(11,42,74,.08);
  border: 1px solid rgba(11,42,74,.18);
  color: var(--primary);
}
.btn-soft:hover{ background: rgba(11,42,74,.12); }

.badge-soft{
  background: rgba(11,42,74,.08);
  color: var(--primary);
  border: 1px solid rgba(11,42,74,.18);
  padding: .35rem .6rem;
  border-radius: 999px;
}

.invoice-card{
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, .10);
  background: #fff;
  box-shadow: 0 6px 14px rgba(2,8,23,.06);
  padding: 14px;
  margin-bottom: 12px;
}

.invoice-card .invoice-top{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap:10px;
  margin-bottom: 10px;
}
.invoice-card .invoice-title{
  font-weight: 750;
  margin:0;
}

.small-danger{
  color: #b91c1c;
  font-size: .92rem;
  margin-top: .25rem;
}

.progress{
  height: 10px;
  border-radius: 999px;
  background: rgba(2,8,23,.06);
}
.progress-bar{
  border-radius: 999px;
}

@media print{
  body{ background:#fff !important; }
  .no-print{ display:none !important; }
  .main-card{ box-shadow:none !important; border:none !important; }
  .app-shell{ padding:0 !important; }
}

/* Letter preview print styles */
.letter{
  background:#fff;
  padding: 28px;
}
.letterhead{
  display:flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 2px solid rgba(2,8,23,.12);
  padding-bottom: 12px;
  margin-bottom: 18px;
}
.letterhead .firm{
  font-weight: 800;
  font-size: 1.1rem;
}
.letterhead .meta{
  text-align:right;
  color: #334155;
  font-size: .95rem;
}
.letter .addr{
  white-space: pre-line;
}
.letter h2{
  font-size: 1.15rem;
  margin-top: 16px;
  font-weight: 800;
}
.letter .para{
  margin: 10px 0;
  line-height: 1.5;
}
.letter table{
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 14px;
  font-size: .96rem;
}
.letter th, .letter td{
  border: 1px solid rgba(2,8,23,.12);
  padding: 8px;
  vertical-align: top;
}
.letter th{
  background: rgba(2,8,23,.04);
}
.keep-together{ page-break-inside: avoid; }

.brand-logo {
  background: #cfcfcf !important;
  border-radius: 10px !important;
  padding: 8px 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.brand-logo img {
  display: block;
  max-height: 105px;
  width: auto;
}