/* =========================================================
   WEBSDOCS SCOPE OF WORK
   FINAL LIVE PAGE CSS
   Draft document styling + modal + validation + actions
========================================================= */

/* ========================= BASE ========================= */
#sow-intro,
#scope-of-work-form-section {
  position: relative;
}

.sow-doc-shell {
  max-width: 1040px;
  margin: 0 auto;
}

#sow-intro {
  padding-top: 60px;
  padding-bottom: 20px;
}

#sow-intro .kicker {
  margin-bottom: 14px;
}

#sow-intro h2 {
  max-width: 920px;
  margin-bottom: 22px;
  line-height: 1.2;
}

#sow-intro .section-text {
  max-width: 920px;
  margin-bottom: 18px;
}

/* ========================= FORM SHELL ========================= */
.sow-draft-form,
.sow-document-form {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.985) 0%, rgba(249,250,252,0.985) 100%);
  border: 1px solid rgba(11, 32, 64, 0.08);
  border-radius: 22px;
  box-shadow: 0 20px 60px rgba(9, 23, 46, 0.08);
  padding: 34px 34px 28px;
  overflow: hidden;
}

.sow-draft-form::before,
.sow-document-form::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: linear-gradient(180deg, #0d2f63 0%, #356db7 100%);
  opacity: 0.95;
}

.sow-draft-form::after,
.sow-document-form::after {
  content: "DRAFT";
  position: absolute;
  top: 22px;
  right: -34px;
  transform: rotate(30deg);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.28em;
  color: rgba(13, 47, 99, 0.18);
  border: 1px solid rgba(13, 47, 99, 0.14);
  padding: 8px 42px;
  background: rgba(255,255,255,0.72);
  pointer-events: none;
}

/* ========================= DRAFT BLOCKS ========================= */
.sow-draft-block,
.sow-doc-section {
  position: relative;
  padding: 0 0 34px;
  margin: 0 0 34px;
  border-bottom: 1px solid rgba(10, 25, 48, 0.08);
}

.sow-draft-block:last-of-type,
.sow-doc-section:last-of-type {
  border-bottom: 0;
  margin-bottom: 18px;
  padding-bottom: 10px;
}

.sow-draft-header {
  padding-top: 6px;
}

.sow-draft-header h2,
.sow-doc-section h2 {
  margin-bottom: 14px;
  line-height: 1.2;
  color: #0c1830;
}

.sow-doc-section .section-text,
.sow-draft-header .section-text {
  color: #344255;
  line-height: 1.82;
  margin-bottom: 16px;
  max-width: 920px;
}

.sow-doc-section .section-text:last-of-type,
.sow-draft-header .section-text:last-of-type {
  margin-bottom: 20px;
}

/* ========================= GRID ========================= */
.sow-inline-grid {
  display: grid;
  gap: 18px 18px;
  margin-bottom: 18px;
}

.sow-inline-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sow-inline-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.contact-form-field-span-2 {
  grid-column: span 2;
}

/* ========================= FIELDS ========================= */
.sow-draft-form .contact-form-field,
.sow-document-form .contact-form-field {
  margin-bottom: 18px;
}

.sow-draft-form .contact-form-field label,
.sow-document-form .contact-form-field label {
  display: block;
  font-size: 0.93rem;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 8px;
  color: #11233f;
}

.sow-draft-form input,
.sow-draft-form select,
.sow-draft-form textarea,
.sow-document-form input,
.sow-document-form select,
.sow-document-form textarea {
  width: 100%;
  font: inherit;
  color: #10233f;
  background: transparent;
  border-radius: 0;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease,
    transform 0.2s ease;
  outline: none;
  box-shadow: none;
}

/* ========================= LINE FIELDS ========================= */
.sow-line-field input,
.sow-line-field select {
  min-height: 50px;
  border: 0;
  border-bottom: 1.6px solid rgba(13, 34, 65, 0.32);
  padding: 10px 2px 9px;
  background: transparent;
}

.sow-line-field input:hover,
.sow-line-field select:hover {
  border-bottom-color: rgba(13, 47, 99, 0.58);
}

.sow-line-field input:focus,
.sow-line-field select:focus {
  border-bottom-color: #1e58a8;
  box-shadow: 0 8px 0 -7px rgba(30, 88, 168, 0.18);
}

/* ========================= TEXTAREA FIELDS ========================= */
.sow-textarea-field textarea {
  min-height: 138px;
  resize: vertical;
  border: 1px solid rgba(13, 34, 65, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
  padding: 14px 14px 13px;
  line-height: 1.7;
}

.sow-textarea-field textarea:hover {
  border-color: rgba(13, 47, 99, 0.28);
  background: rgba(255, 255, 255, 0.92);
}

.sow-textarea-field textarea:focus {
  border-color: #2a62af;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(42, 98, 175, 0.08);
}

/* ========================= PLACEHOLDERS ========================= */
.sow-draft-form input::placeholder,
.sow-draft-form textarea::placeholder,
.sow-document-form input::placeholder,
.sow-document-form textarea::placeholder {
  color: #7d8897;
  opacity: 1;
}

/* ========================= SELECT ========================= */
.sow-draft-form select,
.sow-document-form select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #35537e 50%),
    linear-gradient(135deg, #35537e 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 10px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

/* ========================= REQUIRED MARK ========================= */
.sow-required-mark {
  color: #b42318;
  font-weight: 800;
  margin-left: 2px;
}

/* ========================= INVALID FIELDS ========================= */
.sow-invalid-field {
  border-color: #b42318 !important;
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.08) !important;
  background: rgba(255, 244, 244, 0.95) !important;
}

/* ========================= APPROVAL NOTICE ========================= */
.sow-approval-notice {
  margin: 0 0 22px;
  padding: 16px 18px;
  border: 1px solid rgba(16, 36, 62, 0.12);
  border-radius: 16px;
  background: rgba(248, 251, 255, 0.95);
}

.sow-approval-notice-title {
  margin: 0 0 10px;
  font-weight: 700;
  color: #10243e;
}

.sow-approval-notice-list {
  margin: 0;
  padding-left: 18px;
  color: #425469;
  line-height: 1.75;
}

.sow-field-help {
  margin: 8px 0 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #5c6f84;
}

.sow-submit-helper {
  margin-top: 14px;
  font-size: 0.92rem;
  line-height: 1.6;
  color: #5d6f84;
}

.sow-conditional-field[hidden] {
  display: none !important;
}

/* ========================= CHECKBOX CONFIRMATIONS ========================= */
.sow-draft-form .ai-estimator-check,
.sow-document-form .ai-estimator-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(13, 34, 65, 0.1);
  border-radius: 14px;
  background: rgba(247, 249, 252, 0.9);
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.sow-draft-form .ai-estimator-check:hover,
.sow-document-form .ai-estimator-check:hover {
  border-color: rgba(35, 80, 146, 0.24);
  background: rgba(252, 253, 255, 1);
  transform: translateY(-1px);
}

.sow-draft-form .ai-estimator-check input[type="checkbox"],
.sow-document-form .ai-estimator-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: 0 0 18px;
  accent-color: #1f57a4;
}

.sow-draft-form .ai-estimator-check span,
.sow-document-form .ai-estimator-check span {
  display: block;
  line-height: 1.68;
  color: #223248;
  font-size: 0.97rem;
}

/* ========================= SIGNATURE AREA ========================= */
.sow-signature-section {
  padding-bottom: 22px;
}

.sow-signature-lines {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 18px;
  padding-top: 4px;
}

.sow-sign-line {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sow-sign-line strong {
  font-size: 0.95rem;
  color: #10233e;
}

.sow-sign-blank {
  height: 56px;
  border-bottom: 1.8px solid rgba(13, 34, 65, 0.42);
}

/* ========================= ACTIONS ========================= */
.sow-doc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding-top: 12px;
  margin-top: 6px;
}

.sow-doc-actions .btn {
  min-height: 50px;
  border-radius: 14px;
  padding: 12px 20px;
}

.sow-doc-actions .btn span {
  white-space: nowrap;
}

/* ========================= LINKS ========================= */
.sow-doc-shell a,
.sow-draft-form a,
.sow-document-form a {
  text-underline-offset: 3px;
}

/* ========================= POPUP ========================= */
.scope-form-popup {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 99999;
  min-width: 280px;
  max-width: 420px;
  padding: 14px 16px;
  border-radius: 14px;
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.5;
  box-shadow: 0 16px 40px rgba(0,0,0,0.18);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.scope-form-popup.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.scope-form-popup.is-success {
  background: #14532d;
}

.scope-form-popup.is-error {
  background: #991b1b;
}

/* ========================= MODAL ========================= */
body.sow-modal-open {
  overflow: hidden;
}

.sow-terms-modal {
  position: fixed;
  inset: 0;
  z-index: 99998;
  display: none;
}

.sow-terms-modal.is-open {
  display: block;
}

.sow-terms-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 18, 34, 0.58);
}

.sow-terms-dialog {
  position: relative;
  width: min(920px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  margin: 24px auto;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 28px 80px rgba(8, 18, 34, 0.24);
  padding: 28px 24px 24px;
}

.sow-terms-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 34, 60, 0.08);
  color: #10243e;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.sow-terms-close:hover {
  background: rgba(15, 34, 60, 0.14);
  transform: scale(1.03);
}

.sow-terms-kicker {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #5d7288;
}

.sow-terms-dialog h2 {
  margin: 0 0 18px;
  color: #10243e;
  line-height: 1.2;
}

.sow-terms-content {
  display: grid;
  gap: 16px;
}

.sow-terms-item {
  border: 1px solid rgba(16, 36, 62, 0.1);
  border-radius: 16px;
  padding: 16px;
  background: #fbfdff;
}

.sow-terms-item h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: #10243e;
}

.sow-terms-item p {
  margin: 0;
  color: #3d4f63;
  line-height: 1.7;
}

/* ========================= RHYTHM ========================= */
.sow-draft-form .kicker,
.sow-document-form .kicker {
  margin-bottom: 10px;
}

.sow-draft-form h2 + .section-text,
.sow-document-form h2 + .section-text {
  margin-top: 0;
}

.sow-draft-form p + .sow-inline-grid,
.sow-draft-form p + .contact-form-field,
.sow-document-form p + .sow-inline-grid,
.sow-document-form p + .contact-form-field {
  margin-top: 4px;
}

.sow-draft-block .contact-form-field:last-child,
.sow-draft-block .sow-inline-grid:last-child,
.sow-doc-section .contact-form-field:last-child,
.sow-doc-section .sow-inline-grid:last-child {
  margin-bottom: 0;
}

.sow-draft-form textarea,
.sow-document-form textarea {
  white-space: pre-wrap;
}

.sow-draft-form input[type="date"],
.sow-document-form input[type="date"] {
  min-width: 0;
}

/* ========================= LARGE SCREEN ========================= */
@media (min-width: 1200px) {
  .sow-draft-form,
  .sow-document-form {
    padding: 42px 44px 34px;
  }

  .sow-doc-shell {
    max-width: 1100px;
  }
}

/* ========================= TABLET ========================= */
@media (max-width: 991px) {
  .sow-draft-form,
  .sow-document-form {
    padding: 30px 24px 24px;
    border-radius: 18px;
  }

  .sow-inline-grid-3 {
    grid-template-columns: 1fr 1fr;
  }

  .sow-signature-lines {
    grid-template-columns: 1fr;
  }
}

/* ========================= MOBILE ========================= */
@media (max-width: 767px) {
  #sow-intro {
    padding-top: 42px;
    padding-bottom: 10px;
  }

  .sow-draft-form,
  .sow-document-form {
    padding: 22px 16px 18px;
    border-radius: 16px;
  }

  .sow-draft-form::after,
  .sow-document-form::after {
    top: 16px;
    right: -40px;
    font-size: 0.64rem;
    padding: 6px 36px;
  }

  .sow-inline-grid-2,
  .sow-inline-grid-3 {
    grid-template-columns: 1fr;
  }

  .contact-form-field-span-2 {
    grid-column: auto;
  }

  .sow-draft-block,
  .sow-doc-section {
    padding-bottom: 28px;
    margin-bottom: 28px;
  }

  .sow-line-field input,
  .sow-line-field select {
    min-height: 46px;
  }

  .sow-textarea-field textarea {
    min-height: 124px;
    padding: 12px 12px 11px;
  }

  .sow-doc-actions {
    flex-direction: column;
  }

  .sow-doc-actions .btn,
  .sow-doc-actions a.btn {
    width: 100%;
    justify-content: center;
  }

  .scope-form-popup {
    right: 12px;
    left: 12px;
    bottom: 12px;
    min-width: 0;
    max-width: none;
  }

  .sow-terms-dialog {
    width: calc(100% - 18px);
    margin: 9px auto;
    border-radius: 16px;
    padding: 22px 16px 18px;
  }
}

/* ========================= PRINT LIVE PAGE CLEANUP ========================= */
@media print {
  .site-header,
  .site-footer,
  .hero,
  .panel-toggle,
  .mega-panels,
  .chatbot-widget,
  .floating-contact,
  .floating-whatsapp,
  .cookie-banner,
  .mobile-bottom-bar,
  .scope-form-popup,
  .sow-terms-modal {
    display: none !important;
  }
}