
*, *::after, *::before {
  box-sizing: border-box;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: 200ms ease-in-out;
  border: 1px solid #d7e2ee;
  border-radius: 18px;
  z-index: 1000;
  background-color: white;
  width: min(840px, 92vw);
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.30);
}

.modal.active {
  transform: translate(-50%, -50%) scale(1);
}

.modal-header {
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid #e8eef5;
}

.modal-title-wrap .title {
  color: #2B6FB1;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 2px;
}

.modal-title-wrap .subtitle {
  color: #475569;
  font-size: 0.92rem;
  line-height: 1.3;
}

.modal-header .close-button {
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
  font-size: 1.5rem;
  line-height: 1;
  font-weight: bold;
  color: #334155;
  padding: 0 0 0 12px;
}

.modal-body {
  padding: 6px 14px 12px;
  max-height: calc(90vh - 74px);
  overflow-y: auto;
  overflow-x: hidden;
  color: #334155;
}

.signup-brand {
  margin: 0 0 8px 0;
  text-align: center;
}

.signup-brand img {
  max-width: 150px;
  width: 100%;
  height: auto;
  display: inline-block;
}

.signup-intro {
  margin: 0 0 10px 0;
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.45;
}

.signup-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-grid.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-field label {
  color: #1f2937;
  font-weight: 700;
  font-size: 0.95rem;
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  font-size: 1rem;
  color: #1f2937;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: none;
  border-color: #2B6FB1;
  box-shadow: 0 0 0 3px rgba(43, 111, 177, 0.15);
}

.form-field textarea {
  resize: vertical;
  min-height: 110px;
}

.checkbox-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 4px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.checkbox-item:hover {
  border-color: #2B6FB1;
  background: #f1f7fd;
}

.checkbox-item input {
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
}

.checkbox-item span {
  flex: 1;
  font-size: 0.95rem;
  color: #1f2937;
  line-height: 1.35;
}

.checkbox-consent-row {
  margin-top: 2px;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #1f2937;
  line-height: 1.45;
  font-weight: 700;
}

.checkbox-label input {
  margin-top: 4px;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.turnstile-wrap {
  margin-top: 2px;
}

.form-actions {
  position: sticky;
  bottom: 0;
  background: #fff;
  padding-top: 10px;
  padding-bottom: 4px;
  z-index: 2;
}

.signup-submit,
.download-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  border: none;
  border-radius: 9999px;
  padding: 14px 24px;
  font-weight: 700;
  font-size: 1rem;
  color: #ffffff;
  cursor: pointer;
  text-decoration: none;
  background: linear-gradient(90deg, #2B6FB1 0%, #81B01F 100%);
  box-shadow: 0 12px 30px rgba(43, 111, 177, 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.signup-submit:hover,
.download-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(43, 111, 177, 0.26);
}

.signup-submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

.form-status {
  min-height: 20px;
  margin: 6px 0 0;
  font-weight: 700;
  font-size: 0.95rem;
}

.form-status.success { color: #2f7d20; }
.form-status.error { color: #b42318; }

.signup-success {
  display: none;
  text-align: center;
  padding: 12px 4px 4px;
}

.signup-success.active {
  display: block;
}

.signup-success h3 {
  color: #2B6FB1;
  font-size: 1.75rem;
  line-height: 1.1;
  margin: 0 0 12px;
  font-weight: 700;
}

.signup-success p {
  color: #334155;
  margin: 0 0 18px;
  line-height: 1.5;
  font-size: 1rem;
}

.success-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.secondary-close-btn {
  background: none;
  border: none;
  color: #334155;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
}

.honeypot-field,
.is-hidden {
  display: none !important;
}

#overlay {
  position: fixed;
  opacity: 0;
  transition: 200ms ease-in-out;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(87, 87, 87, 0.9);
  pointer-events: none;
  z-index: 900;
}

#overlay.active {
  opacity: 1;
  pointer-events: all;
}

@media (max-width: 640px) {
  .modal {
    width: 94vw;
    max-height: 92vh;
  }

  .modal-body {
    max-height: calc(92vh - 72px);
    padding: 6px 12px 12px;
  }

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

  .signup-brand img {
    max-width: 130px;
  }
}
