/* =============================
   COMPARE MY INSULATION – FORM
   ============================= */

.form-page {
  min-height: 100vh;
  background: linear-gradient(160deg, #eef2f8 0%, #f6f9ff 100%);
  display: flex;
  flex-direction: column;
}

/* ===== FORM HEADER ===== */
.form-header {
  background: var(--navy);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.form-header .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
}

.form-header .logo-icon { font-size: 1.5rem; }

.form-security {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.6);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===== PROGRESS BAR ===== */
.progress-wrapper {
  background: var(--white);
  border-bottom: 1px solid #dee6ef;
  padding: 16px 24px 12px;
}

.progress-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-light);
  font-weight: 600;
  margin-bottom: 8px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.progress-bar-outer {
  max-width: 600px;
  margin: 0 auto;
  height: 8px;
  background: #dde6f0;
  border-radius: 50px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--green);
  border-radius: 50px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== FORM CONTAINER ===== */
.form-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 60px;
}

/* ===== STEP CARD ===== */
.step-card {
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.1);
  padding: 48px 40px 40px;
  max-width: 600px;
  width: 100%;
  position: relative;
  animation: stepIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes stepIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.step-emoji {
  font-size: 2.8rem;
  display: block;
  text-align: center;
  margin-bottom: 12px;
}

.step-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--navy);
  text-align: center;
  margin-bottom: 8px;
  line-height: 1.15;
}

.step-sub {
  text-align: center;
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 32px;
  line-height: 1.5;
}

.encourage-msg {
  background: var(--green-light);
  border-left: 4px solid var(--green);
  color: var(--green-dark);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 24px;
  animation: fadeSlide 0.4s ease both;
}

@keyframes fadeSlide {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ===== OPTION CARDS ===== */
.options-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 28px;
}

.options-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.options-grid.cols-1 { grid-template-columns: 1fr; }
.options-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

.option-card {
  border: 2px solid #dde6f0;
  border-radius: 12px;
  padding: 18px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all 0.18s ease;
  background: #fafcff;
  text-align: center;
  position: relative;
}

.option-card:hover {
  border-color: var(--green);
  background: var(--green-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(45, 198, 83, 0.15);
}

.option-card.selected {
  border-color: var(--green);
  background: var(--green-light);
  box-shadow: 0 4px 16px rgba(45, 198, 83, 0.2);
}

.option-card.selected::after {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 10px;
  background: var(--green);
  color: white;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 22px;
}

.option-icon { font-size: 1.8rem; }

.option-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
}

.option-desc {
  font-size: 0.76rem;
  color: var(--text-light);
  line-height: 1.4;
}

/* ===== TEXT INPUT ===== */
.form-input-group {
  margin-bottom: 28px;
}

.form-label {
  display: block;
  font-weight: 700;
  color: var(--navy);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 16px 18px;
  border: 2px solid #dde6f0;
  border-radius: 10px;
  font-size: 1rem;
  font-family: 'Lato', sans-serif;
  color: var(--text);
  background: #fafcff;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.form-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(45,198,83,0.1);
}

.form-input.error { border-color: #e03e3e; }
.error-msg { color: #e03e3e; font-size: 0.8rem; margin-top: 6px; display: none; }
.error-msg.visible { display: block; }

/* ===== POSTCODE SPECIFIC ===== */
.postcode-input-wrap {
  position: relative;
}

.postcode-lookup-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--green);
  color: white;
  border: none;
  border-radius: 7px;
  padding: 8px 16px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.18s;
}

.postcode-lookup-btn:hover { background: var(--green-dark); }

/* ===== MAP SECTION ===== */
.map-section {
  margin-bottom: 28px;
}

.map-instruction {
  font-size: 0.88rem;
  color: var(--text-light);
  margin-bottom: 12px;
  text-align: center;
}

#map-frame {
  width: 100%;
  height: 300px;
  border-radius: 12px;
  border: 2px solid #dde6f0;
  overflow: hidden;
  background: #e8f0f8;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: var(--text-light);
  font-size: 0.9rem;
}

#map-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.map-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-light);
  font-size: 0.9rem;
}

.map-selected-msg {
  background: var(--green-light);
  border: 1px solid var(--green);
  color: var(--green-dark);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  margin-top: 10px;
  display: none;
}

.map-selected-msg.visible { display: block; }

/* ===== BUTTONS ===== */
.btn-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn-next {
  flex: 1;
  padding: 18px;
  background: var(--green);
  color: white;
  border: none;
  border-radius: 50px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 6px 24px rgba(45,198,83,0.3);
}

.btn-next:hover { background: var(--green-dark); transform: translateY(-2px); }
.btn-next:disabled { background: #b0c4b0; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-back {
  padding: 18px 22px;
  background: transparent;
  border: 2px solid #dde6f0;
  border-radius: 50px;
  color: var(--text-light);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
  font-size: 1rem;
}

.btn-back:hover { border-color: var(--navy); color: var(--navy); }

/* ===== PRIVACY NOTE ===== */
.privacy-note {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ===== FORM FOOTER ===== */
.form-footer {
  background: #f0f4f8;
  border-top: 1px solid #dee6ef;
  padding: 16px 24px;
  text-align: center;
  font-size: 0.73rem;
  color: var(--text-light);
  line-height: 1.5;
}

.form-footer a { color: var(--green); }

/* ===== PHONE SPECIFIC ===== */
.phone-group {
  display: flex;
  gap: 0;
}

.phone-prefix {
  background: #f0f4f8;
  border: 2px solid #dde6f0;
  border-right: none;
  border-radius: 10px 0 0 10px;
  padding: 16px 14px;
  font-weight: 700;
  color: var(--text-light);
  font-size: 0.95rem;
}

.phone-group .form-input {
  border-radius: 0 10px 10px 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .step-card { padding: 32px 20px 28px; }
  .options-grid.cols-2 { grid-template-columns: 1fr; }
  .options-grid.cols-3 { grid-template-columns: 1fr 1fr; }
  .step-title { font-size: 1.5rem; }
}

/* ===== MAP PIN OVERLAY ===== */
#map-frame {
  position: relative;
  width: 100%;
  height: 300px;
  border-radius: 12px;
  border: 2px solid #dde6f0;
  overflow: hidden;
}

#map-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.map-pin-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-pin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
}

.pin-dot {
  width: 24px;
  height: 24px;
  background: #e03e3e;
  border: 3px solid white;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.pin-label {
  background: white;
  color: var(--navy);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 50px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  white-space: nowrap;
}

@keyframes pinDrop {
  0%   { transform: translateY(-40px) scale(0.8); opacity: 0; }
  60%  { transform: translateY(6px) scale(1.1); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* ===== MAP ACTIONS ===== */
.map-actions {
  text-align: center;
  margin: 12px 0 8px;
}

.map-drop-btn {
  background: var(--navy);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 12px 28px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}

.map-drop-btn:hover:not(:disabled) {
  background: var(--green);
  transform: translateY(-2px);
}

.map-drop-btn:disabled { cursor: default; }

.map-hint {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: 8px;
}

/* ===== INPUT HINTS ===== */
.input-hint {
  font-size: 0.75rem;
  color: #8a9ab0;
  margin-top: 6px;
}

/* ===== EMAIL VALIDATION COLOUR ===== */
#text-input:valid { border-color: #dde6f0; }
#text-input[type="email"]:not(:placeholder-shown):valid { border-color: var(--green); }
#text-input[type="email"]:not(:placeholder-shown):invalid { border-color: #e03e3e; }

/* ===== BUTTON TEXT FIX - PREVENT INVISIBLE TEXT ON MOBILE ===== */
.btn-next {
  color: #ffffff !important;
  background: var(--primary) !important;
}

.btn-next:hover {
  background: var(--primary-dark) !important;
  color: #ffffff !important;
}

.btn-next:disabled {
  background: #b0a8a0 !important;
  color: rgba(255,255,255,0.7) !important;
  cursor: not-allowed;
  box-shadow: none !important;
  transform: none !important;
}

/* ===== HOME LINK IN FORM HEADER ===== */
.form-home-link {
  color: rgba(255,255,255,0.6);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-home-link:hover {
  color: var(--primary);
}
