html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;

  color: #fff;
  background-color: #162b30;
  background-image: url("../images/background_image.webp");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
}

.hidden {
  display: none !important;
}

.status-panel {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(22, 43, 48, 1);
  z-index: 10000;
}

.status-card {
  width: min(400px, 90vw);
  text-align: center;
}

.status-panel img {
  width: 220px;
  max-width: 80%;
  margin-bottom: 30px;
}

.status-title {
  font-size: 30px;
  font-weight: 200;
  text-align: center;
  margin: 15px;
}

.status-message {
  font-weight: 200;
  font-size: 20px;
  line-height: 1.5;
  text-align: center;
  margin: 20px 0 30px;
}

.status-panel.hidden {
  display: none;
}

/*****************************************
    WORKING OVERLAY
*****************************************/

/* Overlay background */
#workingOverlay {
  position: fixed;
  z-index: 2000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

#workingOverlay.show {
  display: flex;
}

/* Spinner */
.spinner {
  width: 100px;
  height: 100px;
  border: 5px solid rgba(32, 202, 237, 0.3); /* transparent border */
  border-top-color: #20caed; /* cyan blue top */
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Animation */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/*****************************************
    MESSAGE POPUP
*****************************************/

.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.popup-overlay.hidden {
  display: none;
}

/* Base popup box */
.popup {
  padding: 20px;
  border-left: 6px solid #999;
  border-radius: 8px;
  background-color: #f9f9f9;
  color: #333;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  max-width: 400px;
  width: 90%;
  text-align: center;
  font-family: Arial, sans-serif;
}

.popup.error {
  border-left-color: #e53935;
  background-color: #fdecea;
}

.popup.success {
  border-left-color: #43a047;
  background-color: #e8f5e9;
}

.popup.info {
  border-left-color: #1e88e5;
  background-color: #e3f2fd;
}

/* Popup content */
.popup-content p {
  margin-bottom: 20px;
  font-size: 16px;
}

/* Buttons */
.popup-ok,
.popup-cancel {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  margin: 5px;
  cursor: pointer;
  font-size: 14px;
}

.popup.error .popup-ok,
.popup.error .popup-cancel {
  background-color: #e53935;
  color: #fff;
}

.popup.success .popup-ok,
.popup.success .popup-cancel {
  background-color: #43a047;
  color: #fff;
}

.popup.info .popup-ok,
.popup.info .popup-cancel {
  background-color: #1e88e5;
  color: #fff;
}

.popup-ok:hover,
.popup-cancel:hover {
  opacity: 0.9;
}

/*****************************************
    TOP BAR (LOGO ETC)
*****************************************/

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 24px;
}

.logo {
  width: 180px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.welcome {
  font-weight: 600;
  color: #333;
  margin-right: 10px;
}

.logout-btn {
  background-color: #20caed;
  color: white;
  border: none;
  padding: 6px 14px;
  font-size: 14px;
  border-radius: 4px;
  cursor: pointer;
}

.logout-btn:hover {
  background: #1ab3d3;
}

/*****************************************
    TAB (NAVBAR) CONTAINER AND BUTTONS
*****************************************/

.tab-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 1024px;
  margin: 40px auto 20px auto;
  gap: 10px;
}

.tab-button {
  flex: 1 1 200px;
  max-width: 240px;
  padding: 18px 12px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 1px;
  border-radius: 6px;
  background: linear-gradient(
    180deg,
    rgba(22, 43, 48, 0.85),
    rgba(22, 43, 48, 0.85)
  );
  color: white;
  border: none;
  transition: background 0.3s ease;
  cursor: pointer;
}

.tab-button:hover {
  background: linear-gradient(
    180deg,
    rgba(30, 60, 65, 0.9),
    rgba(30, 60, 65, 0.9)
  );
  box-shadow:
    0 0 10px rgba(255, 255, 255, 0.3),
    0 0 20px rgba(0, 255, 255, 0.3);
}

.tab-button.active {
  background: #ffffff;
  color: #162b30;
  font-weight: bold;
  border: 2px solid #162b30;
}

.tab-button.completed::after {
  content: "✓";
  color: #28a745;
  font-weight: bold;
  margin-left: 8px;
}

/*****************************************
    TAB CONTAINER AND CONTENT
*****************************************/

.container {
  max-width: 1024px;
  margin: 40px auto;
  padding: 0 20px;
}

@media (max-width: 600px) {
  .container {
    padding: 0 10px;
  }
}

.tab-content {
  display: none;
  max-width: 1024px;
  margin: 0 auto;
  padding: 20px;
  /*background: #fff;*/
  border-radius: 6px;
}

.tab-content:not(.hidden) {
  display: block;
}

.form-actions {
  margin-top: 10px;
}

/*****************************************
    TAB BACKGROUND FOR TABS 2-4
*****************************************/

.has-background {
  background-color: #162b30d9;
  margin-top: 0px;
  border-radius: 8px;
}

/*****************************************
    TAB 1 BLURB
*****************************************/

.intro {
  background: linear-gradient(
    180deg,
    rgba(22, 43, 48, 0.85),
    rgba(22, 43, 48, 0.85)
  );
  color: white;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
}

/*****************************************
    TAB 1 SERVICES BUTTONS
*****************************************/

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.services_button {
  width: 100%;
  height: 135px;
  padding: 25px 10px;
  border-radius: 5px;
  background: linear-gradient(
    180deg,
    rgba(22, 43, 48, 0.85),
    rgba(22, 43, 48, 0.85)
  );
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  color: white;
  text-align: center;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.services_button:hover {
  background: linear-gradient(
    180deg,
    rgba(30, 60, 65, 0.9),
    rgba(30, 60, 65, 0.9)
  );
  box-shadow:
    0 0 10px rgba(255, 255, 255, 0.3),
    0 0 20px rgba(0, 255, 255, 0.3);
}

.services_button img {
  margin-bottom: 10px;
}

.services_button_title {
  line-height: 1.4;
}

/*****************************************
    TAB 1 SERVICES MODALS
*****************************************/

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal.hidden {
  display: none;
}

.modal-inner {
  background: #fff;
  color: #333;
  padding: 2rem;
  border-radius: 8px;
  max-width: 600px;
  width: 90%;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #333;
  cursor: pointer;
}

.modal-title {
  font-weight: 600;
  font-size: 16px;
}

.modal-text {
  margin-top: 1rem;
  font-size: 16px;
}

.signature-date {
  width: 120px !important;
  max-width: 100%;
}

/*****************************************
    TAB 2 REMOVAL DETAILS
*****************************************/

/* Standardise all checkboxes and radio buttons */
input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: #20caed;
  cursor: pointer;
  margin: 0;
  vertical-align: middle;
}

/* Form container */
#move_protect_form,
form#removal_details_form {
  max-width: 1024px;
  margin: 0 auto;
  padding: 1.5rem;
  box-sizing: border-box;
}

/* Section headers */
.formtitle {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: #1e2b30;
  border-bottom: 2px solid #ccc;
  padding-bottom: 0.25rem;
}

/* Form grid layout */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 1rem 2rem;
  margin-bottom: 1.5rem;
  align-items: center;
}

.form-grid.full {
  grid-template-columns: 1fr;
}

.packing-removal-dates + .form-grid {
  margin-top: 20px;
}

.packing-removal-dates + .form-grid label {
  grid-column: 1 / -1;
}

.packing-removal-dates + .form-grid textarea {
  grid-column: 1 / -1;
  width: 100%;
  box-sizing: border-box;
}

.form-section {
  margin-bottom: 15px;
  padding-top: 15px;
}

/* Labels */
label {
  font-weight: 400;
}

/* Form controls */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 0.25rem;
  border: 1px solid #999;
  border-radius: 4px;
  font-size: 1rem;
  box-sizing: border-box;
  outline: none;
}

/* Read-only fields */
input[readonly] {
  background-color: #f5f5f5;
  color: #555;
}

/* Validation */
input.invalid,
select.invalid,
textarea.invalid {
  border: 2px solid #c00 !important;
  background: rgba(198, 40, 40, 0.1);
}

/* Checkbox groups */
.checkbox-grid {
  display: flex;
  align-items: center;
  gap: 12px 20px;
  flex-wrap: wrap;
}

.checkbox-grid label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-weight: 400;
}

@media (max-width: 600px) {
  .checkbox-grid {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/* Radio button groups */
.radio-group {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}

.radio-date-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.radio-date-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  white-space: nowrap;
}

.radio-date-group .date-label {
  margin-left: 16px;
  font-weight: 400;
}

input.pikaday-date {
  width: 120px;
  max-width: 100%;
}

@media (max-width: 600px) {
  .radio-date-group {
    gap: 10px;
  }

  .radio-date-group .date-label {
    margin-left: 0;
  }

  .radio-date-group input[type="text"] {
    width: 150px;
  }
}

/*
.packing-removal-dates {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.packing-removal-dates label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 280px;
}

.packing-removal-dates span {
  white-space: nowrap;
}

.packing-removal-dates input {
  width: 120px;
  max-width: 100%;
}

@media (max-width: 600px) {
  .packing-removal-dates label {
    width: 100%;
    justify-content: space-between;
  }
}
*/

.date-time {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-time .pikaday-date {
  width: 120px;
}

.date-time select {
  width: 65px;
}
/* Textarea */

textarea {
  width: 100%;
  resize: vertical;
  min-height: 120px;
  padding: 0.5rem;
  font-size: 1rem;
  border-radius: 4px;
  border: 1px solid #999;
  box-sizing: border-box;
}

.signature-box {
  width: 100%;
}

.signature-pad {
  width: 100%;
  height: 180px;
  background: #ffffff;
  border: 1px solid #999;
  border-radius: 4px;
  display: block;
  touch-action: none;
}

.signature-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.signature-actions-button {
  background: #1e2b30;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 0.6rem 1rem;
  cursor: pointer;
  margin-bottom: 10px;
  margin-right: 10px;
}

.signature-actions-button:hover {
  background-color: #334d55;
}

/* Button row */
#formlower {
  display: flex;
  justify-content: flex-end;
  margin-top: 2rem;
}

/* Save button */
.save_button {
  background-color: #1e2b30;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.3s ease;
}

.save_button:hover {
  background-color: #334d55;
}

.radio-group.invalid-group,
.radio-date-group.invalid-group {
  padding: 10px;
  border: 2px solid #c00;
  border-radius: 4px;
}

/*****************************************
    RESPONSIVE
*****************************************/

@media (max-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .checkbox-grid {
    grid-template-columns: 1fr;
  }

  .radio-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  #save_button {
    width: 100%;
  }
}

/*****************************************
    TAB 3 MOVE PROTECT
*****************************************/

.move-protect-information {
  margin-bottom: 28px;
}

.move-protect-text-section {
  padding: 15px;
}

.move-protect-text-section:last-child {
  margin-bottom: 0;
}

.move-protect-text-section h3 {
  margin: 0 0 12px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.45;
  text-decoration: underline;
}

.move-protect-text-section ul {
  margin: 0;
  padding-left: 28px;
  font-size: 14px;
  font-weight: 200;
}

.move-protect-text-section li {
  margin-bottom: 10px;
  line-height: 1.5;
}

.move-protect-text-section li:last-child {
  margin-bottom: 0;
}

/*****************************************
    NAME ROW
*****************************************/

.move-protect-name-row {
  margin-bottom: 24px;
}

.move-protect-name-row label {
  align-self: center;
}

.move-protect-name-row input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/*****************************************
    SIGNING SECTIONS
*****************************************/

.move-protect-signing-section {
  margin-bottom: 26px;
}

.move-protect-section-heading {
  margin: 0 0 14px;
  padding: 10px 12px;
  color: #ffffff;
  background: rgba(24, 173, 182, 0.14);
  border-left: 4px solid #18adb6;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.3;
}

.move-protect-signature-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(180px, 1fr);
  gap: 20px;
  align-items: start;
}

.move-protect-signature-cell,
.move-protect-date-cell {
  min-width: 0;
}

.move-protect-signature-cell > label,
.move-protect-date-cell > label {
  display: block;
  margin-bottom: 8px;
  color: #162b30;
  font-weight: bold;
}

.move-protect-date-cell input {
  min-width: 0;
  box-sizing: border-box;
}

/*****************************************
    SIGNATURE BOX
*****************************************/

.signature-box {
  position: relative;
  width: 100%;
  min-width: 0;
  border: 1px solid #9aa6a9;
  border-radius: 3px;
  background: #ffffff;
  box-sizing: border-box;
  overflow: hidden;
}

.signature-pad {
  display: block;
  width: 100%;
  height: 180px;
  background: #ffffff;
  cursor: crosshair;
  touch-action: none;
}

.signature-clear-button {
  display: block;
  margin: 0 10px 10px auto;
  padding: 7px 12px;
  border: none;
  border-radius: 4px;
  background: #1e2b30;
  color: #ffffff;
  font: inherit;
  cursor: pointer;
  margin-top: 10px;
}

.signature-clear-button:hover {
  background-color: #334d55;
}

/*****************************************
    MAXIMUM REPLACEMENT VALUE
*****************************************/

.move-protect-value-row {
  margin-top: 20px;
}

.move-protect-value-row > label {
  align-self: center;
}

.move-protect-required-note {
  display: block;
  margin-top: 3px;
  font-size: 14px;
  font-weight: normal;
}

.currency-input {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  width: 180px;
  min-width: 0;
  background: #ffffff;
  border: 1px solid #9aa6a9;
  border-radius: 3px;
  box-sizing: border-box;
  overflow: hidden;
  outline: none;
}

.currency-symbol {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-right: 1px solid #9aa6a9;
  background: #f3f5f5;
  color: #162b30;
  font-size: 18px;
  font-weight: bold;
}

.currency-input input {
  width: 180px;
  min-width: 0;
  border: 0;
  padding: 10px 12px;
  background: #ffffff;
  font: inherit;
  box-sizing: border-box;
  outline: none;
}

.currency-input input:focus {
  outline: 2px solid #18adb6;
  outline-offset: -2px;
}

/*****************************************
    GUIDANCE
*****************************************/

.move-protect-guidance {
  margin: 6px 0 22px;
  padding: 12px 14px;
  border-left: 4px solid #d4a900;
  background: rgba(255, 247, 214, 0.6);
  color: #162b30;
  font-weight: bold;
}

/*****************************************
    MOVE PROTECT VALIDATION
*****************************************/

.move-protect-signing-section.invalid-section {
  padding: 12px;
  border: 2px solid #c62828;
  border-radius: 3px;
}

.move-protect-signing-section.invalid-section .move-protect-section-heading {
  background: rgba(198, 40, 40, 0.1);
  border-left-color: #c62828;
}

.move-protect-signing-section.selected-section .move-protect-section-heading {
  background: rgba(24, 173, 182, 0.2);
}

#tab-3 input.invalid {
  border: 2px solid #c62828;
}

/*****************************************
    BUTTON ROW
*****************************************/
/*
.form-button-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 22px;
}
*/
/*****************************************
    RESPONSIVE
*****************************************/

@media screen and (max-width: 800px) {
  .move-protect-signature-grid {
    grid-template-columns: 1fr;
  }

  .move-protect-date-cell {
    max-width: 300px;
  }
}

@media screen and (max-width: 600px) {
  .container.has-background {
    padding-left: 0;
    padding-right: 0;
  }

  .move-protect-text-section h3 {
    font-size: 16px;
  }

  .move-protect-text-section ul {
    padding-left: 22px;
  }

  .move-protect-section-heading {
    font-size: 17px;
  }

  .move-protect-signature-grid {
    gap: 16px;
  }

  .move-protect-date-cell {
    max-width: none;
  }

  .signature-pad {
    height: 160px;
  }

  .move-protect-guidance {
    margin-left: 0;
    margin-right: 0;
  }

  .form-button-row {
    display: block;
  }

  .form-button-row .primary-button {
    width: 100%;
  }
}

/*****************************************
    COMPLETE PAGE
*****************************************/

.acceptance-title {
  font-size: 30px;
  font-weight: 200;
  text-align: left;
  padding-top: 20px;
}

.acceptance-text {
  font-size: 14px;
  font-weight: 200;
  text-align: left;
}

.pdf-preview-wrapper {
  width: 100%;
  height: 900px;
  border: 1px solid #ccc;
  background: #f5f5f5;
}

#acceptancePdfPreview {
  width: 100%;
  height: 100%;
  border: 0;
}

.complete-actions {
  margin-top: 20px;
  padding-bottom: 20px;
  text-align: center;
}

@media (max-width: 600px) {
  .pdf-preview-wrapper {
    height: 650px;
  }
}
