/*------------------------------------*\
  #TABLE OF CONTENTS
\*------------------------------------*/

/* 
 * 1. RESET / NORMALIZE
 * 2. BASE & TYPOGRAPHY
 * 3. INPUT FIELDS
    #3.1 - Input Fields - Checkboxes and Radio buttons
    #3.2 - Input Fields - Date Picker
    #3.3 - Input Fields - Select Fields
 * 4. BUTTONS
 * 5. UTILITIES (Helpers)
 * 6. VENDOR & THIRD-PARTY
 */

:root {
  --white-hsl: 0, 0%, 100%;
  --black-hsl: 0, 0%, 0%;
  --safeLightAccent-hsl: 209.23, 52.7%, 70.98%;
  --safeDarkAccent-hsl: 0, 0%, 0%;
  --safeInverseAccent-hsl: 0, 0%, 0%;
  --safeInverseLightAccent-hsl: 0, 0%, 0%;
  --safeInverseDarkAccent-hsl: 0, 0%, 100%;
  --accent-hsl: 209.23, 52.7%, 70.98%;
  --lightAccent-hsl: 240, 10.53%, 92.55%;
  --darkAccent-hsl: 204.39, 79.49%, 38.24%;

  --form-field-border-thickness: 1px;
  --navigationLinkColor: hsla(var(--safeInverseAccent-hsl) 0, 0%, 0%, 1);

  --form-field-checkbox-size: 20px;
  --form-field-checkbox-border-thickness: 1px;
  --fill-hover-transition: 0.15s background-color cubic-bezier(0.33, 1, 0.68, 1);
  --normal-text-size-value: 16.5px;
  --normal-text-font-family: sans-serif;

  /* colors */
  --primary-color: #1470af;
  --primary-color-background: #eaeaee;

  --primary-button-font-font-style: normal;
  --primary-button-font-font-weight: 500;
  --primary-button-font-text-transform: uppercase;
  --primary-button-font-letter-spacing: 0.05em;
  --primary-button-font-font-size: 12px;
  --primaryButtonPadding: 1.2em;
  --primary-button-padding-x: 2em;
  --primary-button-padding-y: 1.5em;
  --primary-button-stroke: 0px;
}

.room-card {
  background: #f9fafb;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid #e5e7eb;
}

.form-container {
  background: var(--primary-color-background);
  max-width: 600px;
  margin: auto;
}

.width-20 {
  max-width: 20%;
}

.width-50 {
  width: 50%;
}

.form-group {
  display: flex;
  flex-direction: row; /* side-by-side instead of column */
  gap: 0.5rem; /* consistent space between columns */
  margin-bottom: 0.25rem;
  flex-wrap: nowrap; /* allows them to wrap on smaller screens */
}

.form-group .form-field {
  min-width: 150px; /* ensures they don’t shrink too much */
  margin-bottom: 12px;
}

/*-----------------------------------------------------------*\

                      #3. INPUT FIELDS

\*-----------------------------------------------------------*/

.form-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.5rem;
}

.form-alert {
  margin: 12px 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #b91c1c;
  background: #fef2f2;
  color: #7f1d1d;
  font-family: var(--normal-text-font-family);
  font-size: 0.95rem;
  line-height: 1.4;
}

.is-hidden {
  display: none;
}

.form-field.inline-radio {
  border: 0;
  padding: 0;
  margin: 0 0 1.5rem;
}

.form-field.inline-radio legend {
  margin-bottom: 0.25rem;
  color: #000;
  font-size: var(--normal-text-size-value);
  font-family: var(--normal-text-font-family);
  font-weight: 400;
  line-height: 24.75px;
  letter-spacing: -0.33px;
  padding: 0;
}

.form-field label:not(.radio-group label) {
  margin-bottom: 0.25rem;
  color: #000; /* dark neutral */
  font-size: var(--normal-text-size-value);
  font-family: var(--normal-text-font-family);
  font-weight: 400;
  line-height: 24.75px;
  letter-spacing: -0.33px;
}

.required-marker {
  color: var(--primary-color);
  padding: 0;
  font-size: 13.5px;
  font-family: var(--normal-text-font-family);
  font-weight: 400;
  line-height: 13.5px;
  opacity: 0.7;
}

input[readonly] {
  background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
  color: #6b7280;
  cursor: not-allowed;
}

.input-error {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.form-field input:not([type="radio"]):not([type="checkbox"]) {
  border: 1px solid #000;
  border-radius: 40px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: var(--normal-text-font-family);
  color: #000;
  background-color: var(--primary-color-background);
  transition: all 0.2s ease;
  appearance: none;
}

.form-field input:not([type="radio"]):not([type="checkbox"]):hover {
  background-color: #fff;
}

.form-field .hint,
.hint {
  font-family: var(--normal-text-font-family);
  font-size: 13.5px;
  color: var(--primary-color);
  margin-bottom: 4px;
  line-height: 20.25px;
  font-weight: 400;
  padding: 0.5em 0 0.5em;
  opacity: 0.7;
  margin: 0px;
}

/*-----------------------------------------------------------*\
  #3.1 - Input Fields - Checkboxes and Radio buttons 
\*-----------------------------------------------------------*/
.radio-group label {
  display: flex;
  column-gap: 11px;
  align-items: center;
  margin: 6px 0 4px;
  font-family: var(--normal-text-font-family);
  font-size: 13.5px;
  line-height: 20.25px;
  font-weight: 400;
}

input[type="checkbox"],
input[type="radio"] {
  border-radius: 25%;
  appearance: none;
  position: relative;
  cursor: pointer;
  transition: var(--fill-hover-transition);
  background: var(--primary-color-background);
  border: var(--form-field-checkbox-border-thickness) solid var(--dynamic-border-color, #a9a9a9);
  width: var(--form-field-checkbox-size);
  height: var(--form-field-checkbox-size);
  flex-shrink: 0;
  margin-right: 0px;
  border: 1px solid #000;
}

input[type="checkbox"]:hover,
input[type="radio"]:hover {
  background: #fff;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
  background-color: black;
  border-color: black;
}

input[type="radio"]:checked::after {
  background-color: white;
  position: absolute;
  top: 25%;
  left: 25%;
  width: 50%;
  height: 50%;
  transform: scale(1);
  content: "";
}

input[type="checkbox"]:checked::after {
  background-color: white;
  position: absolute;
  top: 12.5%;
  left: 12.5%;
  width: 75%;
  height: 75%;
  transform: scale(1);
  content: "";
  -webkit-clip-path: polygon(13.29% 49.19%, 3.89% 59.8%, 40.98% 90%, 96.95% 21.23%, 86.94% 13.08%, 85.97% 12.29%, 38.95% 70.07%);
  clip-path: polygon(13.29% 49.19%, 3.89% 59.8%, 40.98% 90%, 96.95% 21.23%, 86.94% 13.08%, 85.97% 12.29%, 38.95% 70.07%);
}

.inline-radio .radio-group {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

/*-----------------------------------------------------------*\
  #3.2 - Input Fields - Date Picker 
\*-----------------------------------------------------------*/

.form-field input[type="date"] {
  border: 1px solid #000;
  border-radius: 40px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: var(--normal-text-font-family);
  color: #000;
  background-color: #fff;
  transition: all 0.2s ease;
  appearance: none;
  width: 200px;
}

/* make the date icon fit nicely inside rounded field */
input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
  background-color: rgba(26, 115, 232, 0.1);
}

/*-----------------------------------------------------------*\
  #3.3 - Input Fields - Select Fields
\*-----------------------------------------------------------*/

select {
  border: 1px solid #000;
  border-radius: 40px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: var(--normal-text-font-family);
  color: #111;
  background-color: #fff;
  transition: all 0.2s ease;

  /* Remove default arrow */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  /* Custom arrow */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='12'%3E%3Cpath fill='currentColor' fill-rule='evenodd' clip-rule='evenodd' d='M0.439453 1.49825L1.56057 0.501709L9.00001 8.87108L16.4395 0.501709L17.5606 1.49825L9.00001 11.1289L0.439453 1.49825Z'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 20px center;
  background-size: 20px;
  cursor: pointer;
  width: 100%;
  background-color: var(--primary-color-background);
}

select:hover {
  background-color: #fff;
}

/*-----------------------------------------------------------*\
  #3.4 - Input Fields - Text area
\*-----------------------------------------------------------*/

textarea {
  height: 93px;
  padding: 8px 15px;
  font-size: var(--normal-text-size-value);
  font-family: var(--normal-text-font-family);
  border-radius: 25px;
  resize: vertical;
  border: 1px solid #000;
  box-shadow: 0 0 0 1px transparent;
  background: var(--primary-color-background);
}

textarea:hover {
  background: #fff;
}

/*-----------------------------------------------------------*\

                      #4. BUTTONS

\*-----------------------------------------------------------*/
button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 600;
  border-radius: 300px;
  align-items: center;
}

button:disabled {
  background-color: #b0c6f0;
  cursor: not-allowed;
}

button:hover {
  transform: translateY(-1px);
  opacity: 0.8;
}

.form-button:disabled {
  background-color: #b0c6f0;
  cursor: not-allowed;
}

.form-icon-button {
  background: var(--primary-color);
  color: #fff;
  border: none;
  max-height: 3em;
  display: flex;
  font-size: var(--primary-button-font-font-size);
  font-style: var(--primary-button-font-font-style);
  line-height: normal;
  letter-spacing: var(--primary-button-font-letter-spacing);
  text-transform: var(--primary-button-font-text-transform);
  font-weight: 500;
  min-height: fit-content;
}

.form-icon-button.lookup {
  margin-top: 27px;
}

.form-submit-button {
  border-style: solid;
  border-width: var(--primary-button-stroke);
  padding: var(--primary-button-padding-y) var(--primary-button-padding-x);
  transition: 0.1s opacity linear;

  display: inline-block;
  width: auto;
  max-height: 51px;
  text-align: center;
  appearance: none;
  -webkit-font-smoothing: antialiased;
  background: var(--primary-color);
  color: #fff;

  font-size: var(--primary-button-font-font-size);
  font-style: var(--primary-button-font-font-style);
  line-height: normal;
  letter-spacing: var(--primary-button-font-letter-spacing);
  text-transform: var(--primary-button-font-text-transform);
}

.form-button-cancel {
  background: white;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  max-height: 3em;
  display: flex;
  font-size: var(--primary-button-font-font-size);
  font-style: var(--primary-button-font-font-style);
  line-height: normal;
  letter-spacing: var(--primary-button-font-letter-spacing);
  text-transform: var(--primary-button-font-text-transform);
  font-weight: 500;
  min-height: fit-content;
}

/* === Extra Services Icons === */
.extras-icons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.tile-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  width: 100px;
  height: 100px;
  border: 2px solid #cfd8e3;
  border-radius: 12px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  color: #1e3a8a;
  text-align: center;
}
.tile-option.selected {
  border-color: #2563eb;
  background-color: #e0edff;
  box-shadow: 0 0 0 2px #2563eb33;
}
.tile-option:hover {
  border-color: #2563eb;
}
/* .tile-option span {
  margin-top: 6px;
  font-size: 0.7rem;
  white-space: nowrap;
} */

.tile-option span:last-of-type {
  color: #5fa5ff;
  margin-top: 5px;
}

.tile-option .plus-icon {
  font-size: 2rem;
  margin-bottom: 6px;
}

.tile-option.half{
  height: 50px;
}

.section-title {
  font-size: var(--normal-text-size-value);
  font-family: var(--normal-text-font-family);
  font-weight: 400;
  line-height: 24.75px;
  letter-spacing: normal;
}

.section-separator {
  line-height: normal;
  margin: 32px 0px 32px 0px;
  padding-bottom: 4px;
  border-bottom: 2px solid #000;
}

textarea:focus,
.form-field input[type="date"]:focus,
.form-field input:focus:not(:read-only),
select:focus {
  outline-style: solid;
  outline-color: var(--dynamic-border-color, var(--navigationLinkColor));
  outline-width: 2px;
  outline-offset: 2px;
  background-color: #fff;
}

.form-success {
  text-align: center;
}

.form-success h2 {
  color: #1270af;
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.form-success p {
  color: #1270af;
  font-size: 1.1rem;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
 .modal.hidden {
  display: none;
}

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

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.open {
  display: flex;
}


.modal-content {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  width: min(90vw, 400px);
  max-height: calc(100dvh - 48px);
  overflow: auto;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}


/* Nice fade-in animation */
@keyframes modalFade {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Optional smooth fade/slide */
.modal.open .modal-content {
  opacity: 1;
  transform: translateY(0);
}

.modal.hidden .modal-content {
  opacity: 0;
  transform: translateY(20px);
}

.tiles-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.room-tile {
  position: relative;
  border-radius: 10px;
  width: 120px;
  text-align: center;
  cursor: pointer;
  transition: 0.2s;
}

.room-tile:hover {
  background: #eef3ff;
}

.room-tile .trash {
  position: absolute;
  top: 5px;
  right: 5px;
  background: transparent;
  border: 1px solid;
  cursor: pointer;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  padding: 2px;
}

.room-tile .trash:hover {
  background: var(--primary-color);
  color: white;
}

/* === Tooltip Icon === */
/* Used for help tooltips next to labels */
.tooltip-icon {
  min-width: 1.5rem;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  background-color: #007bff;
  color: white;
  border-radius: 50%;
  font-weight: 500;
  cursor: help;
  font-size: 0.9rem;
  text-align: center;
  display: inline-block;
  position: relative;
}

.tooltip-icon:hover {
  background-color: #0056b3;
}

.tooltip-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  top: 120%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.3;
  white-space: pre-line;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  width: 260px;
  text-align: left;
  z-index: 1000;
}

/* visible when active */
.tooltip-icon.active::after {
  opacity: 1;
  pointer-events: auto;
}

/*------------------------------------*\
        #7. RESPONSIVE STYLES
\*------------------------------------*/
@media (max-width: 480px) {
  /* Stack address fields vertically on small screens */
  .form-group {
    flex-wrap: wrap; /* allow items to wrap */
    flex-direction: column; /* stack inputs */
  }

  .form-field.width-20,
  .form-field.width-50,
  .form-field {
    width: 100% !important; /* full width */
    max-width: 100%;
  }

  /* Make lookup button align nicely */
  #lookup-btn {
    width: 100%;
    justify-content: center;
    margin-top: 0;
    margin-bottom: 1.5rem;
  }

  /* Add a little more spacing for clarity */
  .form-group .form-field {
    margin-bottom: 0.75rem;
  }

  .tooltip-icon::after {
    top: auto;
    bottom: 120%;
  }
}
