/* ============================================
   RenterCalc.com — Demand Letter Page Styles
   ============================================ */

/* ===== LAYOUT ===== */
.dl-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 28px;
  align-items: start;
}
.dl-sidebar { position: sticky; top: calc(var(--header-h) + 16px); }

/* ===== FORM CARD ===== */
#dl-form {
  padding: 0 32px 32px;
  display: flex;
  flex-direction: column;
}

/* Form sections */
.dl-form-section {
  border-bottom: 1px solid #EEF1F7;
  padding: 24px 0 8px;
}
.dl-form-section:first-child { padding-top: 28px; }
.dl-form-section:last-child  { border-bottom: none; padding-bottom: 0; }

.dl-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .72rem;
  font-weight: 800;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 18px;
  padding: 7px 12px;
  background: var(--blue-light);
  border-radius: 8px;
  border-left: 3px solid var(--blue);
}
.dl-section-label i { font-size: .8rem; }

/* Standard text inputs */
#dl-form input[type="text"],
#dl-form input[type="number"],
#dl-form textarea {
  width: 100%;
  font-family: var(--font);
  font-size: .97rem;
  font-weight: 500;
  color: var(--text-dark);
  background: #FAFBFF;
  border: 2px solid #DDE3EE;
  border-radius: 10px;
  padding: 0 16px;
  height: 52px;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
#dl-form input[type="text"]:hover,
#dl-form input[type="number"]:hover {
  border-color: #B6C2D5;
}
#dl-form input[type="text"]:focus,
#dl-form input[type="number"]:focus,
#dl-form textarea:focus {
  outline: none;
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

/* Textarea */
#dl-form textarea {
  height: auto;
  padding: 14px 16px;
  resize: vertical;
  min-height: 90px;
  line-height: 1.6;
}

/* Optional label tag */
.opt {
  color: var(--text-muted);
  font-weight: 500;
  font-size: .7rem;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 2px;
}

/* 3-column city/state/zip row */
.form-row--3 {
  display: grid;
  grid-template-columns: 2fr 1fr 1.2fr;
  gap: 12px;
}
.form-row--3 .form-group { margin-bottom: 0; }

/* Short inputs (state abbr, zip) */
.input-short { text-transform: uppercase; letter-spacing: .5px; }

/* Error on text inputs */
.has-error input[type="text"],
.has-error input[type="number"],
.has-error textarea {
  border-color: #EF4444 !important;
  background: #FFF8F8 !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,.1) !important;
}

/* ===== OUTPUT SECTION ===== */
.dl-output-section {
  padding: 52px 0 20px;
  background: var(--bg-light);
}

.dl-output-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.dl-output-header-left { flex: 1; min-width: 200px; }

.dl-success-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #F0FDF4;
  color: #16A34A;
  border: 1px solid #BBF7D0;
  border-radius: 40px;
  padding: 5px 14px;
  font-size: .78rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.dl-output-header-left h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 6px;
}
.dl-output-header-left p {
  font-size: .9rem;
  color: var(--text-muted);
}

.dl-output-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.dl-output-actions--bottom {
  margin-top: 24px;
  justify-content: flex-start;
}

/* ===== THE LETTER CARD ===== */
.dl-letter-card {
  background: #fff;
  border: 1px solid #DDE3EE;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,.07), 0 2px 8px rgba(0,0,0,.04);
  overflow: hidden;
  position: relative;
}

/* Subtle top rule to suggest letterhead */
.dl-letter-card::before {
  content: '';
  display: block;
  height: 5px;
  background: linear-height(90deg, #1D4ED8, #60A5FA);
  background: linear-gradient(90deg, #1D4ED8 0%, #2563EB 50%, #60A5FA 100%);
}

/* ===== LETTER BODY ===== */
.dl-letter-body {
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
  font-size: 1rem;
  color: #1A202C;
  line-height: 1.8;
  padding: 52px 64px 64px;
  max-width: 780px;
  margin: 0 auto;
}

.dl-letter-body p {
  margin-bottom: 1.2em;
}

.dl-letter-date {
  margin-bottom: 2em;
  font-weight: 500;
}

.dl-letter-block {
  margin-bottom: 1.5em;
  line-height: 1.6;
}

.dl-letter-re {
  margin-bottom: 1.5em;
  padding: 10px 16px;
  border-left: 3px solid var(--blue);
  background: var(--blue-light);
  border-radius: 0 6px 6px 0;
  font-family: var(--font);
  font-size: .92rem;
  color: var(--text-dark);
}

.dl-letter-closing {
  margin-top: 2em;
}
.dl-letter-sig-space {
  height: 52px;
  border-bottom: 1px solid #CBD5E1;
  width: 220px;
  margin: 8px 0 6px;
}

/* ===== COPY TOAST ===== */
.dl-copy-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #0F172A;
  color: #fff;
  padding: 12px 24px;
  border-radius: 40px;
  font-size: .88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 500;
  white-space: nowrap;
}
.dl-copy-toast i { color: #4ADE80; }
.dl-copy-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== NEXT STEPS ===== */
.next-steps-section {
  padding: 32px 0 56px;
  background: var(--bg-light);
}

.next-steps-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 48px;
  box-shadow: var(--shadow-md);
}

.next-steps-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.next-steps-icon {
  font-size: 2rem;
  color: var(--blue);
  flex-shrink: 0;
}
.next-steps-header h2 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 4px;
}
.next-steps-header p {
  font-size: .9rem;
  color: var(--text-muted);
}

.next-steps-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 32px;
}
.next-steps-list li {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.next-steps-list li:last-child { border-bottom: none; }

.ns-num {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: .85rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(37,99,235,.3);
}
.ns-content strong {
  display: block;
  font-size: .97rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
}
.ns-content p {
  font-size: .88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.next-steps-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: 8px;
}
.next-steps-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--blue);
  transition: gap var(--transition);
}
.next-steps-link:hover { gap: 10px; }
.next-steps-link--muted { color: var(--text-muted); }
.next-steps-link--muted:hover { color: var(--text-dark); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .dl-layout {
    grid-template-columns: 1fr;
  }
  .dl-sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .dl-sidebar .sidebar-card:last-child {
    grid-column: 1 / -1;
  }
  .next-steps-card { padding: 28px 24px; }
}

@media (max-width: 640px) {
  #dl-form { padding: 0 18px 24px; }
  .dl-form-section { padding: 20px 0 6px; }

  .form-row--3 {
    grid-template-columns: 1fr 1fr;
  }
  .form-row--3 .form-group:first-child {
    grid-column: 1 / -1;
  }

  .dl-letter-body { padding: 32px 24px 40px; font-size: .95rem; }

  .dl-output-header { flex-direction: column; gap: 16px; }
  .dl-output-actions { width: 100%; }
  .dl-output-actions .btn { flex: 1; justify-content: center; font-size: .82rem; padding: 10px 12px; }
  .dl-output-actions--bottom { flex-direction: column; }
  .dl-output-actions--bottom .btn { width: 100%; justify-content: center; }

  .dl-sidebar { grid-template-columns: 1fr; }
  .next-steps-card { padding: 22px 18px; }
  .next-steps-header { flex-direction: column; gap: 12px; align-items: flex-start; }
  .next-steps-links { flex-direction: column; gap: 12px; }
}

/* ===== NATIVE DATE INPUT ===== */

/* Wrapper: mirrors .input-prefix-wrap — icon panel on left, input on right */
.date-input-wrap {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  height: 52px;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  border: 1.5px solid #DDE3EE;
  border-radius: 10px;
  background: #FAFBFF;
  overflow: hidden;
  -webkit-transition: border-color .18s, box-shadow .18s, background .18s;
  transition: border-color .18s, box-shadow .18s, background .18s;
}

.date-input-wrap:hover {
  border-color: #B6C2D5;
  background: #fff;
}

.date-input-wrap:focus-within {
  border-color: #2563EB;
  background: #fff;
  -webkit-box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

.has-error .date-input-wrap {
  border-color: #EF4444;
  background: #FFF8F8;
  -webkit-box-shadow: 0 0 0 3px rgba(239, 68, 68, .1);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .1);
}

/* Left icon panel */
.date-input-icon {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  width: 48px;
  -ms-flex-negative: 0;
  flex-shrink: 0;
  background: #EFF6FF;
  border-right: 1.5px solid #DDE3EE;
  -webkit-transition: background .18s, border-color .18s;
  transition: background .18s, border-color .18s;
  pointer-events: none;
}

.date-input-icon i {
  font-size: 15px;
  color: #2563EB;
}

.date-input-wrap:focus-within .date-input-icon {
  background: #DBEAFE;
  border-color: #93C5FD;
}

/* The actual <input type="date"> */
input.date-input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  -webkit-box-flex: 1;
  -ms-flex: 1;
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 12px;
  background: transparent;
  border: none;
  outline: none;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #0F172A;
  cursor: pointer;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* Placeholder colour (empty state) */
input.date-input:not(:valid),
input.date-input[value=""] {
  color: #94A3B8;
}

/* Blue calendar picker icon (right side) */
input.date-input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.7;
  -webkit-filter: invert(29%) sepia(92%) saturate(1800%) hue-rotate(215deg) brightness(95%);
  filter: invert(29%) sepia(92%) saturate(1800%) hue-rotate(215deg) brightness(95%);
  padding: 4px;
  margin-right: 4px;
  -webkit-transition: opacity .15s;
  transition: opacity .15s;
}

input.date-input::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  /* Hide everything except the letter card */
  body * { visibility: hidden; }

  .dl-letter-card,
  .dl-letter-card * { visibility: visible; }

  .dl-letter-card {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: auto !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .dl-letter-card::before { display: none !important; }

  .dl-letter-body {
    padding: 0.75in 1in !important;
    font-size: 11pt !important;
    line-height: 1.75 !important;
    color: #000 !important;
    max-width: 100% !important;
  }

  .dl-letter-re {
    background: none !important;
    border-left: 2px solid #000 !important;
    color: #000 !important;
    padding: 6px 12px !important;
  }

  .dl-letter-sig-space {
    border-bottom: 1px solid #000 !important;
  }

  a { color: #000 !important; text-decoration: none !important; }

  @page {
    margin: 0;
    size: letter portrait;
  }
}
