/*
 * Scoped styles for the Travelfootprint guest calculator (see
 * guest-calculator.js). Everything is namespaced under .tfcalc so this file
 * can be dropped into another site without colliding with its styles, and
 * looks reasonable even without Bootstrap/MDB present.
 */

.tfcalc {
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #161c27;
  max-width: 100%;
}

.tfcalc-name-row {
  margin-bottom: 1.5rem;
}

.tfcalc-panel {
  border: 1px solid #dde2f0;
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  background: #fff;
  box-shadow: 0 4px 6px -1px rgba(20, 72, 163, 0.05), 0 2px 4px -2px rgba(20, 72, 163, 0.08);
}

.tfcalc-panel-title {
  margin: 0 0 0.75rem 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.tfcalc-step-type-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.tfcalc-step-type-btn {
  padding: 0.6rem 1.1rem;
}

.tfcalc-field {
  margin-bottom: 0.75rem;
}

.tfcalc-field-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tfcalc-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.tfcalc-input {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 1px solid #c3c6d4;
  border-radius: 4px;
  font-size: 0.95rem;
  box-sizing: border-box;
}

.tfcalc-input-narrow {
  max-width: 10rem;
}

.tfcalc-hint {
  font-size: 0.82rem;
  color: #434652;
  margin: 0.25rem 0 0.5rem 0;
}

.tfcalc-error {
  font-size: 0.88rem;
  color: #ba1a1a;
}

.tfcalc-btn {
  border: 1px solid #c3c6d4;
  background: #f1f3ff;
  border-radius: 4px;
  padding: 0.45rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.tfcalc-btn:hover {
  background: #e8eeff;
}

.tfcalc-btn-primary {
  background: #1448a3;
  border-color: #1448a3;
  color: #fff;
}

.tfcalc-btn-primary:hover {
  background: #0f3a85;
}

.tfcalc-btn-danger {
  color: #ba1a1a;
}

.tfcalc-btn-small {
  padding: 0.2rem 0.6rem;
  font-size: 0.8rem;
}

.tfcalc-btn-link {
  background: none;
  border: none;
  color: #1448a3;
  text-decoration: underline;
  padding: 0.25rem 0;
}

.tfcalc-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.tfcalc-actions-inline {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.tfcalc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tfcalc-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid #eee;
  gap: 1rem;
}

.tfcalc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.tfcalc-table th,
.tfcalc-table td {
  text-align: left;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid #eee;
}

.tfcalc-total {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.tfcalc-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
}

/* higher specificity than `.tfcalc-modal-overlay` alone so toggling the
   `hidden` attribute from JS reliably hides the modal despite `display: flex` above */
.tfcalc-modal-overlay[hidden] {
  display: none;
}

.tfcalc-modal {
  background: #fff;
  border-radius: 0.75rem;
  width: min(480px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.tfcalc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  background: #fff;
}

.tfcalc-modal-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  text-transform: capitalize;
}

.tfcalc-modal-close {
  border: none;
  background: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: #6c757d;
  padding: 0;
}

.tfcalc-modal-close:hover {
  color: #212529;
}

.tfcalc-modal-body {
  padding: 1rem 1.25rem 1.25rem;
}
