/* ==========================================================================
   315 Kent Street — Application, Privacy, Lease E-Sign & Landlord Admin CSS
   ========================================================================== */

.portal-shell {
  padding: 36px 0 72px;
}

.doc-sheet {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.doc-sheet-header {
  background: var(--bg-dark);
  color: var(--ink-on-dark);
  padding: 28px 24px;
  border-bottom: 3px solid var(--accent-gold);
}

@media (min-width: 768px) {
  .doc-sheet-header {
    padding: 34px 40px;
  }
}

.doc-sheet-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  margin: 6px 0 8px;
  color: #FFFFFF;
  line-height: 1.2;
}

.doc-sheet-header p {
  margin: 0;
  color: var(--ink-on-dark-muted);
  font-size: 0.94rem;
  max-width: 68ch;
}

.doc-sheet-body {
  padding: 24px 20px 36px;
}

@media (min-width: 768px) {
  .doc-sheet-body {
    padding: 36px 40px 44px;
  }
}

/* Form Sections */
.app-section {
  margin-bottom: 34px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border-light);
}

.app-section:last-of-type {
  border-bottom: 0;
  margin-bottom: 16px;
}

.app-section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.app-section-num {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-size: 1.22rem;
  font-weight: 600;
  color: var(--ink-primary);
  margin: 0;
}

.app-section-num span {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--brand-primary);
  color: #FFFFFF;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 680px) {
  .field-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .field-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink-primary);
}

.field-label .req {
  color: var(--accent-brick);
}

.field-hint {
  font-size: 0.77rem;
  color: var(--ink-muted);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: #FFFFFF;
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 0.93rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(30, 70, 54, 0.14);
}

.form-textarea {
  min-height: 84px;
  resize: vertical;
}

/* Unit Radio Cards in Section 1 */
.unit-select-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 720px) {
  .unit-select-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.unit-radio-card {
  position: relative;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  background: var(--bg-canvas);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.unit-radio-card:hover {
  border-color: var(--border-strong);
}

.unit-radio-card.selected {
  border-color: var(--brand-primary);
  background: var(--brand-soft);
  box-shadow: 0 0 0 1px var(--brand-primary);
}

.unit-radio-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.unit-radio-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.92rem;
}

.unit-radio-sub {
  font-size: 0.78rem;
  color: var(--ink-secondary);
}

/* Party Sub-Cards (Primary / Secondary / Guarantor) */
.party-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-canvas);
  padding: 20px;
  margin-top: 16px;
}

.party-card-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--brand-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Driver's Licence Smart Scan Box */
.id-scan-box {
  background: #F1F7F4;
  border: 1.5px dashed #7AB098;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 18px;
}

.id-scan-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.id-scan-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--brand-primary);
  color: #FFFFFF;
  font-size: 0.73rem;
  font-weight: 700;
}

.privacy-callout {
  background: var(--bg-subtle);
  border-left: 4px solid var(--brand-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 16px;
  font-size: 0.85rem;
  color: var(--ink-secondary);
  line-height: 1.55;
}

/* Legal Consent Box */
.legal-consent-box {
  background: #FAF8F4;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 20px;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 14px;
  cursor: pointer;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--ink-primary);
}

.check-row input[type="checkbox"] {
  width: 19px;
  height: 19px;
  margin-top: 2px;
  accent-color: var(--brand-primary);
  flex-shrink: 0;
}

/* Signature Pad */
.sig-pad-wrap {
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: #FFFFFF;
  overflow: hidden;
}

.sig-canvas {
  width: 100%;
  height: 150px;
  display: block;
  touch-action: none;
  cursor: crosshair;
  background:
    linear-gradient(to bottom, transparent 118px, #D8D3C8 119px, transparent 120px),
    #FFFFFF;
}

.sig-pad-footer {
  padding: 8px 12px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

/* Lease Clause Cards */
.lease-clause {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  margin-bottom: 16px;
}

.lease-clause h3 {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  margin: 0 0 10px;
  color: var(--brand-primary);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 8px;
}

.lease-kv-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px 20px;
  font-size: 0.9rem;
}

@media (min-width: 680px) {
  .lease-kv-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.initial-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #F5F8F6;
  border: 1px solid #C6DDD2;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 12px;
}

.initial-input {
  width: 86px;
  text-align: center;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Admin Dashboard Layout */
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 14px;
}

.admin-table-wrap {
  overflow-x: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.admin-table th,
.admin-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.admin-table th {
  background: var(--bg-subtle);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-secondary);
}

.pill-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
}

.pill-status.submitted,
.pill-status.under_review {
  background: #EBF3FE;
  color: #1D4ED8;
}

.pill-status.lease_sent,
.pill-status.awaiting_tenant {
  background: #FEF3C7;
  color: #92400E;
}

.pill-status.awaiting_landlord {
  background: #F3E8FF;
  color: #6B21A8;
}

.pill-status.leased,
.pill-status.executed {
  background: var(--status-avail-bg);
  color: var(--status-avail-fg);
}

.pill-status.purged,
.pill-status.declined,
.pill-status.voided {
  background: var(--status-occ-bg);
  color: var(--status-occ-fg);
}

.audit-cert {
  background: #F4F7F5;
  border: 1.5px solid #9EC4B2;
  border-radius: var(--radius-md);
  padding: 18px 20px;
  font-size: 0.84rem;
}

.mono-hash {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  word-break: break-all;
  background: #FFFFFF;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
}

/* Official Ontario Form 2229E (2020/12) Screen & Print Layout */
.form2229-sheet {
  background: #FFFFFF;
  color: #111111;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13.5px;
  line-height: 1.48;
}

.f2229-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 2px solid #111111;
  margin-bottom: 16px;
}

.f2229-ontario-mark {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #111111;
}

.f2229-sec-bar {
  background: #E6E6E6;
  border-top: 1.5px solid #111111;
  border-bottom: 1px solid #888888;
  padding: 6px 10px;
  font-weight: 700;
  font-size: 14px;
  margin: 22px 0 10px;
  color: #111111;
}

.f2229-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 12px;
  font-size: 13px;
}

.f2229-table th,
.f2229-table td {
  border: 1px solid #666666;
  padding: 6px 9px;
  vertical-align: top;
}

.f2229-table th {
  background: #F4F4F4;
  font-weight: 700;
  text-align: left;
  font-size: 11.5px;
}

.f2229-note {
  background: #F2F2F2;
  border-left: 3px solid #333333;
  padding: 7px 10px;
  font-size: 12px;
  margin: 8px 0 12px;
}

.f2229-chk {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-right: 16px;
  font-weight: 600;
}

.f2229-box {
  display: inline-flex;
  width: 15px;
  height: 15px;
  border: 1.5px solid #111111;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.f2229-box.checked {
  background: #111111;
  color: #FFFFFF;
}

.f2229-footer-line {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #555555;
  border-top: 1px solid #CCCCCC;
  padding-top: 8px;
  margin-top: 22px;
}

.audit-timeline {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.audit-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  padding: 10px 12px;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 0.82rem;
}

.onboarding-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  margin-bottom: 16px;
}

.onboarding-card.done {
  border-color: #9ED3BC;
  background: #F7FCF9;
}

@media print {
  .site-header,
  .site-footer,
  .no-print {
    display: none !important;
  }
  details.print-open > *:not(summary) {
    display: block !important;
  }
  body {
    background: #FFFFFF !important;
    font-size: 10.5pt;
  }
  .portal-shell {
    padding: 0 !important;
  }
  .doc-sheet {
    border: 0 !important;
    box-shadow: none !important;
  }
  .lease-clause,
  .f2229-table {
    break-inside: avoid;
  }
}
