/* ==========================================================================
   L&T HYDRAULIC INDUSTRY - WEBSITE QUOTATION MODULE STYLES
   ========================================================================== */

.quotation-page-section {
  padding: 36px 0 40px;
  background: radial-gradient(circle at 50% 0%, rgba(53, 182, 178, 0.08) 0%, transparent 65%), #07171d;
}

.quotation-container {
  width: min(1240px, calc(100% - 28px));
  margin: 0 auto;
}

/* Page Header */
.quotation-page-header {
  text-align: center;
  max-width: 820px;
  margin: 0 auto 22px;
}

.quotation-page-header .eyebrow {
  margin-bottom: 12px;
}

.quotation-page-title {
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.18;
  color: #ffffff;
  margin: 0 0 12px;
}

.quotation-page-subtitle {
  font-size: 15px;
  line-height: 1.7;
  color: #9cb2bc;
  margin: 0 auto;
  max-width: 680px;
}

/* Steps Indicator */
.quotation-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 34px;
}

.quotation-step {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(11, 34, 41, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  padding: 16px 20px;
  backdrop-filter: blur(8px);
}

.quotation-step-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--final-teal), #5bd0cb);
  color: #ffffff;
  font-weight: 900;
  font-size: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 0 14px rgba(53, 182, 178, 0.4);
}

.quotation-step-text strong {
  display: block;
  font-size: 13.5px;
  color: #ffffff;
  font-weight: 800;
}

.quotation-step-text span {
  display: block;
  font-size: 11.5px;
  color: #8da4af;
  margin-top: 2px;
}

/* Form & Card Styles */
#quotation-form {
  display: block;
  width: 100%;
}

.quotation-card {
  border: 1px solid var(--final-border);
  border-radius: 24px;
  background: #0b2229;
  padding: 34px;
  margin: 0 0 32px 0;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  position: relative;
  overflow: hidden;
}

.quotation-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--final-teal), rgba(110, 219, 214, 0.8), transparent);
}

.quotation-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding-bottom: 18px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.quotation-legend-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quotation-legend-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(53, 182, 178, 0.14);
  border: 1px solid rgba(110, 219, 214, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--final-teal-2);
  flex-shrink: 0;
}

.quotation-legend h2 {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: 0;
}

.quotation-legend-badge {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(53, 182, 178, 0.12);
  border: 1px solid rgba(110, 219, 214, 0.3);
  color: #7cebe5;
}

/* Form Grid & Input Fields */
.quotation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.quotation-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.quotation-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.quotation-field.wide {
  grid-column: 1 / -1;
}

.quotation-label {
  font-size: 13px;
  font-weight: 700;
  color: #c0d4dc;
  display: flex;
  align-items: center;
  gap: 4px;
}

.quotation-label .req {
  color: #ff6b6b;
  font-weight: 900;
}

.quotation-field input,
.quotation-field select,
.quotation-field textarea {
  width: 100%;
  border: 1px solid rgba(110, 219, 214, 0.22);
  background: #07191f;
  border-radius: 12px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14px;
  color: #ffffff;
  transition: all 0.22s ease;
  box-sizing: border-box;
}

.quotation-field input:focus,
.quotation-field select:focus,
.quotation-field textarea:focus {
  outline: none;
  background: #082129;
  border-color: #6edbd6;
  box-shadow: 0 0 0 4px rgba(53, 182, 178, 0.2);
}

.quotation-field input::placeholder,
.quotation-field textarea::placeholder {
  color: #5c7480;
}

.quotation-field select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236edbd6' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

.quotation-field select option {
  background: #081d24;
  color: #ffffff;
}

.quotation-field textarea {
  resize: vertical;
  min-height: 82px;
  line-height: 1.5;
}

.quotation-hint {
  font-size: 11px;
  color: #728c98;
  margin-top: 2px;
}

/* Items Table */
.quotation-table-intro {
  color: #9eb2bc;
  font-size: 13.5px;
  line-height: 1.6;
  margin: 0 0 16px 0;
}

.quotation-table-wrapper {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #07171d;
  margin-bottom: 20px;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.25);
}

.quotation-table-wrapper table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

.quotation-table-wrapper th {
  background: #051319;
  color: #8da4af;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

.quotation-table-wrapper td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: middle;
}

.quotation-table-wrapper tr:last-child td {
  border-bottom: none;
}

.quotation-table-wrapper tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.quotation-table-wrapper td:first-child {
  min-width: 260px;
}

.quotation-table-wrapper td input,
.quotation-table-wrapper td select {
  background: #081d24;
  border: 1px solid rgba(110, 219, 214, 0.2);
  border-radius: 9px;
  padding: 10px 11px;
  color: #ffffff;
  font-family: inherit;
  font-size: 13.5px;
  width: 100%;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.quotation-table-wrapper td input:focus,
.quotation-table-wrapper td select:focus {
  outline: none;
  background: #0a252f;
  border-color: #6edbd6;
  box-shadow: 0 0 0 3px rgba(53, 182, 178, 0.2);
}

.quotation-table-wrapper td input[type="number"] {
  min-width: 90px;
  text-align: right;
}

.quotation-table-wrapper td output {
  display: inline-block;
  min-width: 105px;
  text-align: right;
  font-weight: 800;
  color: #6edbd6;
  font-size: 14.5px;
  white-space: nowrap;
}

.quotation-table-wrapper td button.secondary {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.quotation-table-wrapper td button.secondary:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #ffffff;
  transform: translateY(-1px);
}

/* Add Item Button */
#add-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(53, 182, 178, 0.12);
  border: 1px dashed rgba(110, 219, 214, 0.5);
  color: #7cebe5;
  padding: 11px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

#add-item:hover {
  background: rgba(53, 182, 178, 0.22);
  border-color: #6edbd6;
  color: #ffffff;
  transform: translateY(-1px);
}

/* Totals Summary Card */
.quotation-totals-container {
  display: flex;
  justify-content: flex-end;
  margin-top: 22px;
}

.quotation-totals-box {
  width: min(420px, 100%);
  background: linear-gradient(145deg, #071920, #0c2630);
  border: 1px solid rgba(110, 219, 214, 0.3);
  border-radius: 16px;
  padding: 20px 24px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
  position: relative;
}

.quotation-totals-box::before {
  content: "SUMMARY BREAKDOWN";
  display: block;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--final-teal-2);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#totals {
  font-family: inherit;
  font-size: 14.5px;
  line-height: 2;
  color: #c2d5de;
  text-align: right;
  white-space: pre-line;
  letter-spacing: 0.02em;
}

/* Notice & Alerts */
.notice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(184, 131, 50, 0.12);
  border: 1px solid rgba(184, 131, 50, 0.35);
  color: #fce8b8;
  font-size: 13px;
  font-weight: 500;
  margin: 24px 0 16px;
}

.notice::before {
  content: "ℹ";
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(184, 131, 50, 0.25);
  color: #d49a3d;
  display: inline-grid;
  place-items: center;
  font-size: 13px;
  font-weight: 900;
  flex-shrink: 0;
}

/* Action Bar */
.actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  flex-wrap: wrap;
}

#preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.22s ease;
}

#preview:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

#submit-quotation {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #b88332, #d49a3d);
  color: #ffffff;
  font-size: 14.5px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(184, 131, 50, 0.35);
  transition: all 0.22s ease;
}

#submit-quotation:hover {
  background: linear-gradient(135deg, #c78f39, #e0a747);
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(184, 131, 50, 0.5);
}

#submit-quotation:disabled,
#preview:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

#quotation-status {
  margin-top: 18px;
  padding: 16px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  white-space: pre-line;
  line-height: 1.6;
  display: none;
}

#quotation-status:not(:empty) {
  display: block;
  background: rgba(53, 182, 178, 0.15);
  border: 1px solid rgba(110, 219, 214, 0.4);
  color: #7cebe5;
}

/* Preview Modal Dialog */
dialog#quotation-preview {
  width: min(840px, 94vw);
  max-height: 85vh;
  border: 1px solid rgba(110, 219, 214, 0.35);
  border-radius: 22px;
  background: #091d24;
  color: #ffffff;
  padding: 28px 32px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65);
  position: fixed;
  inset: 0;
  margin: auto;
  overflow: auto;
}

dialog#quotation-preview::backdrop {
  background: rgba(2, 9, 13, 0.84);
  backdrop-filter: blur(12px);
}

dialog#quotation-preview h2 {
  font-size: 22px;
  font-weight: 900;
  color: #6edbd6;
  margin-top: 0;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  letter-spacing: -0.02em;
}

#preview-content {
  background: #06151b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 22px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.7;
  color: #d6e4ea;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin-bottom: 22px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

#close-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

#close-preview:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: #ffffff;
  transform: translateY(-1px);
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .quotation-steps {
    grid-template-columns: 1fr;
  }
  .quotation-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .quotation-card {
    padding: 24px 20px;
  }
}

@media (max-width: 600px) {
  .quotation-grid,
  .quotation-grid-2 {
    grid-template-columns: 1fr;
  }
  .actions {
    flex-direction: column;
  }
  .actions button {
    width: 100%;
  }
  .quotation-totals-box {
    width: 100%;
  }
  dialog#quotation-preview {
    padding: 20px 16px;
  }
}

/* SweetAlert Quotation Modal Styles */
.swal-quotation-popup {
  border: 1px solid rgba(110, 219, 214, 0.35) !important;
  border-radius: 22px !important;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.8) !important;
  padding: 28px 24px !important;
  font-family: inherit !important;
}

.swal-quotation-ref {
  display: inline-block;
  background: rgba(53, 182, 178, 0.16);
  border: 1px solid rgba(110, 219, 214, 0.45);
  color: #7cebe5;
  font-size: 13.5px;
  font-weight: 800;
  padding: 6px 18px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.swal-quotation-ref strong {
  color: #ffffff;
  letter-spacing: 0.05em;
}

.swal-quotation-msg {
  font-size: 13.5px;
  color: #c2d5de;
  line-height: 1.6;
  margin: 0 0 16px;
}

.swal-quotation-scroll {
  background: #05141a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  max-height: 320px;
  overflow-y: auto;
  text-align: left;
  padding: 16px 20px;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.4);
}

.swal-quotation-pre {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.7;
  color: #d6e4ea;
  white-space: pre-wrap;
  word-break: break-word;
}

.swal-quotation-confirm-btn {
  background: linear-gradient(135deg, #b88332, #d49a3d) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  padding: 13px 40px !important;
  border-radius: 12px !important;
  font-size: 15px !important;
  border: none !important;
  box-shadow: 0 4px 18px rgba(184, 131, 50, 0.45) !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.swal-quotation-confirm-btn:hover {
  background: linear-gradient(135deg, #c78f39, #e0a747) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 24px rgba(184, 131, 50, 0.6) !important;
}


/* Customer requests expose product and quantity only. */
#quotation-form [hidden] { display: none !important; }
#quotation-form .quotation-table-wrapper th:nth-child(n+3):nth-child(-n+6),
#quotation-form .quotation-table-wrapper td:nth-child(n+3):nth-child(-n+6) { display: none; }

#quotation-form .quotation-table-wrapper button:disabled,
#add-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Allow fieldsets and controls to shrink inside narrow viewports. */
#quotation-form .quotation-card,
#quotation-form .quotation-field,
.quotation-step-text { min-width: 0; }
#quotation-form .quotation-card { max-width: 100%; box-sizing: border-box; }
#quotation-form .quotation-legend { flex-wrap: wrap; gap: 12px; }
#quotation-form .quotation-legend-title { min-width: 0; }
#quotation-form input, #quotation-form select, #quotation-form textarea { min-width: 0; max-width: 100%; }
#quotation-form .quotation-table-wrapper table { min-width: 480px; }
#quotation-form .quotation-hint, #quotation-form #totals { overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .quotation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quotation-steps { gap: 10px; }
  .quotation-step { padding: 12px; gap: 8px; }
}
@media (max-width: 600px) {
  .quotation-page-section { padding: 24px 0 32px; }
  .quotation-page-header { text-align: left; margin-bottom: 24px; }
  #quotation-form .quotation-card { padding: 18px 14px; border-radius: 16px; }
  #quotation-form .quotation-grid, #quotation-form .quotation-grid-2 { grid-template-columns: minmax(0, 1fr); }
  .quotation-steps { grid-template-columns: minmax(0, 1fr); }
  #quotation-form .quotation-legend h2 { font-size: 18px; line-height: 1.3; }
  #quotation-form input, #quotation-form select, #quotation-form textarea { font-size: 16px; }
  #quotation-form .quotation-table-wrapper table { min-width: 0; }
  #quotation-form .quotation-table-wrapper thead { display: none; }
  #quotation-form .quotation-table-wrapper tbody { display: block; }
  #quotation-form .quotation-table-wrapper tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 12px; gap: 10px; border-bottom: 1px solid rgba(255,255,255,.12); }
  #quotation-form .quotation-table-wrapper td { min-width: 0; padding: 0; border: 0; }
  #quotation-form .quotation-table-wrapper td:first-child { grid-column: 1 / -1; }
  #quotation-form .quotation-table-wrapper td:first-child::before { content: "Product"; }
  #quotation-form .quotation-table-wrapper td:nth-child(2)::before { content: "Quantity"; }
  #quotation-form .quotation-table-wrapper td::before { display: block; margin-bottom: 6px; font-size: 12px; color: #c0d4dc; }
  #quotation-form .quotation-table-wrapper td:last-child { align-self: end; }
  #quotation-form .quotation-table-wrapper button { min-height: 44px; }
  #quotation-form .actions { flex-direction: column; align-items: stretch; }
  #quotation-form .actions button { width: 100%; white-space: normal; }
}
