/**
 * #SomeMessAtHome — CF7 form styles only
 * Wrap your form shortcode with: <div class="sma-form">...</div>
 * Does NOT style the page headline / sub-headline.
 */

.sma-form {
  --sma-green: #0f5b24;
  --sma-cream: #f7f5f0;
  --sma-cream-50: rgba(247, 245, 240, 0.5);
  --sma-pampas: #eceae2;
  --sma-swirl: #d5d1c9;
  --sma-tide: #b8b4ac;
  --sma-cloud: #c8c4bc;
  --sma-dark-grey: #6b6860;
  --sma-white: #ffffff;
  --sma-font: "Jost", sans-serif;

  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  max-width: 873px;
  padding: 20px;
  gap: 6px;
  background: var(--sma-white);
  border-radius: 24px;
  font-family: var(--sma-font);
}

.sma-form *,
.sma-form *::before,
.sma-form *::after {
  box-sizing: border-box;
}

.sma-form .wpcf7,
.sma-form .wpcf7-form {
  width: 100%;
  margin: 0;
}

.sma-form .wpcf7-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 6px 0;
}

.sma-form .wpcf7-form p {
  margin: 0;
  width: 100%;
}

.sma-form .wpcf7-form-control-wrap {
  display: block;
  width: 100%;
}

/* ---------- File dropzone (Figma) ---------- */
/*
 * CF7 often outputs:
 * <div class="sma-upload"><p>
 *   <span class="sma-upload__icon"></span><br>
 *   <span class="sma-upload__title">...</span><br>
 *   <span class="sma-upload__hint">...</span><br>
 *   <span class="wpcf7-form-control-wrap" data-name="media">...</span>
 * </p></div>
 */

.sma-form .sma-upload {
  box-sizing: border-box;
  position: relative;
  display: block;
  align-self: stretch;
  width: 100%;
  min-height: 82px;
  height: 82px;
  padding: 6px 16px;
  background: rgba(247, 245, 240, 0.5);
  border: 1px dashed #d5d1c9;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
}

/* CF7 wraps everything in <p> — make that the flex column */
.sma-form .sma-upload > p {
  position: relative;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px;
  width: 100% !important;
  height: 100%;
  min-height: 70px;
  margin: 0 !important;
  padding: 0 !important;
  text-align: center;
}

/* CF7 inserts <br> between spans — hide them */
.sma-form .sma-upload br {
  display: none !important;
}

/* Image / media icon — 22×22, Tide #B8B4AC */
.sma-form .sma-upload__icon {
  flex: none;
  display: block !important;
  width: 22px;
  height: 22px;
  margin: 0 auto;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22' fill='none'%3E%3Crect x='2.75' y='4.125' width='16.5' height='13.75' rx='2' stroke='%23B8B4AC' stroke-width='1.375'/%3E%3Ccircle cx='8.25' cy='8.25' r='1.375' stroke='%23B8B4AC' stroke-width='1.375'/%3E%3Cpath d='M2.75 14.438L7.563 10.313L11.344 13.063L14.438 9.625L19.25 14.438' stroke='%23B8B4AC' stroke-width='1.375' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 22px 22px;
}

.sma-form .sma-upload__title {
  display: block !important;
  width: 100%;
  padding: 6px 0 0;
  margin: 0;
  font-family: var(--sma-font);
  font-style: normal;
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
  color: #b8b4ac;
  text-align: center;
  pointer-events: none;
}

.sma-form .sma-upload__hint {
  display: block !important;
  width: 100%;
  padding: 0;
  margin: 0;
  font-family: var(--sma-font);
  font-style: normal;
  font-weight: 400;
  font-size: 10px;
  line-height: 14px;
  color: #c8c4bc;
  text-align: center;
  pointer-events: none;
}

/* Selected filename (shown via JS after file pick) */
.sma-form .sma-upload__filename {
  display: none;
  width: 100%;
  max-width: 100%;
  padding: 6px 8px 0;
  margin: 0;
  font-family: var(--sma-font);
  font-weight: 500;
  font-size: 13px;
  line-height: 18px;
  color: #0f5b24;
  text-align: center;
  pointer-events: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sma-form .sma-upload.has-file {
  border-color: #0f5b24;
  background: rgba(15, 91, 36, 0.04);
}

.sma-form .sma-upload.has-file .sma-upload__title,
.sma-form .sma-upload.has-file .sma-upload__hint {
  display: none !important;
}

.sma-form .sma-upload.has-file .sma-upload__filename {
  display: block !important;
}

/* Native file input covers the whole dropzone (invisible but clickable) */
.sma-form .sma-upload .wpcf7-form-control-wrap,
.sma-form .sma-upload .wpcf7-form-control-wrap[data-name="media"] {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 2;
}

.sma-form .sma-upload input.wpcf7-file,
.sma-form .sma-upload input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
  border: 0;
  background: transparent;
}

.sma-form .sma-upload input.wpcf7-file::file-selector-button,
.sma-form .sma-upload input[type="file"]::file-selector-button {
  display: none;
}

/* ---------- Shared input / textarea ---------- */

.sma-form input.wpcf7-form-control:not([type="file"]):not([type="submit"]):not([type="checkbox"]),
.sma-form textarea.wpcf7-form-control,
.sma-form .wpcf7-text,
.sma-form .wpcf7-email,
.sma-form .wpcf7-textarea {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 6px 18px;
  min-height: 34px;
  background: var(--sma-cream);
  border: 1px solid var(--sma-pampas);
  border-radius: 12px;
  font-family: var(--sma-font);
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
  color: #1a1a18;
  outline: none;
  transition: border-color 0.15s ease;
}

.sma-form input.wpcf7-form-control::placeholder,
.sma-form textarea.wpcf7-form-control::placeholder {
  color: var(--sma-tide);
  opacity: 1;
}

.sma-form input.wpcf7-form-control:focus,
.sma-form textarea.wpcf7-form-control:focus {
  border-color: var(--sma-green);
}

/* ---------- Email + Location row ---------- */
/*
 * Actual CF7 markup:
 * <div class="row"><p>
 *   <span data-name="your-email">...</span><br>
 *   <span data-name="your-location">...</span>
 * </p></div>
 * The <br> forces a line break — hide it and flex the <p>.
 */

.sma-form .row {
  display: block;
  width: 100%;
  margin: 0;
}

.sma-form .row > p {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap;
  align-items: flex-start;
  column-gap: 10px;
  width: 100% !important;
  margin: 0 !important;
}

/* CF7 inserts <br> between the two fields — remove it */
.sma-form .row br {
  display: none !important;
}

.sma-form .row .wpcf7-form-control-wrap,
.sma-form .row .wpcf7-form-control-wrap[data-name="your-email"],
.sma-form .row .wpcf7-form-control-wrap[data-name="your-location"] {
  flex: 1 1 0;
  min-width: 0;
  width: auto !important;
  display: block;
}

.sma-form .row .wpcf7-form-control-wrap input,
.sma-form .row input.wpcf7-email,
.sma-form .row input.wpcf7-text {
  width: 100% !important;
}

/* ---------- Caption textarea ---------- */

.sma-form textarea.wpcf7-form-control,
.sma-form .wpcf7-textarea {
  min-height: 72px;
  height: 72px;
  padding: 6px 18px 24px;
  resize: vertical;
  overflow: auto;
}

/* ---------- Acceptance checkboxes ---------- */

.sma-form .wpcf7-acceptance {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  margin: 0;
}

.sma-form .wpcf7-acceptance .wpcf7-list-item {
  margin: 0;
  width: 100%;
}

.sma-form .wpcf7-acceptance .wpcf7-list-item label {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  cursor: pointer;
}

.sma-form .wpcf7-acceptance input[type="checkbox"] {
  flex: none;
  width: 15px;
  height: 15px;
  margin: 2px 0 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  background: var(--sma-white);
  border: 1px solid #767676;
  border-radius: 2.5px;
  cursor: pointer;
}

.sma-form .wpcf7-acceptance input[type="checkbox"]:checked {
  background: var(--sma-green);
  border-color: var(--sma-green);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2' d='M1 5l3.5 3.5L11 1'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 10px 8px;
}

.sma-form .wpcf7-acceptance .wpcf7-list-item-label {
  flex: 1 1 auto;
  font-family: var(--sma-font);
  font-style: italic;
  font-weight: 400;
  font-size: 11px;
  line-height: 120%;
  color: var(--sma-dark-grey);
}

.sma-form .wpcf7-form > .wpcf7-acceptance + .wpcf7-acceptance,
.sma-form .wpcf7-form p:has(.wpcf7-acceptance) + p:has(.wpcf7-acceptance) {
  margin-top: -2px;
}

/* Group consent block spacing like Figma (gap ~10px) */
.sma-form .wpcf7-form > p:has(.wpcf7-acceptance),
.sma-form .wpcf7-acceptance {
  padding: 0;
}

/* ---------- Submit button (high specificity, no !important) ---------- */

body .sma-form form.wpcf7-form input.wpcf7-submit[type="submit"],
body .sma-form form.wpcf7-form input.wpcf7-submit,
body .sma-form form.wpcf7-form .wpcf7-submit {
  display: inline-flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  width: auto;
  min-width: 291px;
  height: 44px;
  padding: 10px 20px;
  margin: 0;
  background: var(--sma-green);
  background-color: var(--sma-green);
  background-image: none;
  border: 0;
  border-radius: 100px;
  box-shadow: none;
  outline: none;
  font-family: var(--sma-font);
  font-weight: 600;
  font-size: 18px;
  line-height: 23px;
  letter-spacing: normal;
  text-align: center;
  text-transform: none;
  text-decoration: none;
  color: var(--sma-white);
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

body .sma-form form.wpcf7-form input.wpcf7-submit[type="submit"]:hover,
body .sma-form form.wpcf7-form input.wpcf7-submit:hover,
body .sma-form form.wpcf7-form input.wpcf7-submit[type="submit"]:focus,
body .sma-form form.wpcf7-form input.wpcf7-submit:focus,
body .sma-form form.wpcf7-form .wpcf7-submit:hover,
body .sma-form form.wpcf7-form .wpcf7-submit:focus {
  background: var(--sma-green);
  background-color: var(--sma-green);
  background-image: none;
  border: 0;
  box-shadow: none;
  color: var(--sma-white);
  opacity: 0.92;
}

body .sma-form form.wpcf7-form input.wpcf7-submit[type="submit"]:active,
body .sma-form form.wpcf7-form input.wpcf7-submit:active,
body .sma-form form.wpcf7-form .wpcf7-submit:active {
  transform: scale(0.98);
}

.sma-form .wpcf7-spinner {
  margin-left: 8px;
}

/* ---------- Footer note ---------- */

.sma-form p.note {
  width: 100%;
  padding: 4px 0 0;
  margin: 0;
  font-family: var(--sma-font);
  font-weight: 400;
  font-size: 10px;
  line-height: 14px;
  color: var(--sma-dark-grey);
}

/* ---------- Validation / response ---------- */

.sma-form .wpcf7-not-valid-tip {
  font-family: var(--sma-font);
  font-size: 11px;
  margin-top: 4px;
}

.sma-form .wpcf7-response-output {
  width: 100%;
  margin: 0;
  padding: 10px 14px;
  border-radius: 12px;
  font-family: var(--sma-font);
  font-size: 13px;
}

.sma-form .wpcf7-form.invalid .wpcf7-response-output,
.sma-form .wpcf7-form.unaccepted .wpcf7-response-output,
.sma-form .wpcf7-form.spam .wpcf7-response-output,
.sma-form .wpcf7-form.failed .wpcf7-response-output {
  border-color: #c0392b;
}

.sma-form .wpcf7-form.sent .wpcf7-response-output {
  border-color: var(--sma-green);
}

/* ---------- Success modal (Figma modalCard) ---------- */

body.sma-modal-open {
  overflow: hidden;
}

.sma-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.sma-modal[hidden] {
  display: none !important;
}

.sma-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 28, 26, 0.45);
}

.sma-modal__card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  isolation: isolate;
  width: 100%;
  max-width: 440px;
  padding: 48px 40px 36px;
  gap: 9.1px;
  background: #faf8f3;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
  border-radius: 24px;
  box-sizing: border-box;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* Close — lock colors so theme hover doesn't inherit */
body #sma-success-modal #smaCloseBtn.sma-modal__close,
body #sma-success-modal button.sma-modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 1px 6px;
  border: 0;
  border-radius: 16px;
  background: rgba(28, 28, 26, 0.06);
  background-color: rgba(28, 28, 26, 0.06);
  background-image: none;
  box-shadow: none;
  color: #6b6860;
  cursor: pointer;
}

body #sma-success-modal #smaCloseBtn.sma-modal__close:hover,
body #sma-success-modal #smaCloseBtn.sma-modal__close:focus,
body #sma-success-modal button.sma-modal__close:hover,
body #sma-success-modal button.sma-modal__close:focus {
  background: #d4edcc;
  background-color: #d4edcc;
  background-image: none;
  box-shadow: none;
  border: 0;
  color: #2d7a45;
  opacity: 1;
}

body #sma-success-modal .sma-modal__close-icon {
  position: relative;
  display: block;
  width: 14px;
  height: 14px;
}

body #sma-success-modal .sma-modal__close-icon::before,
body #sma-success-modal .sma-modal__close-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 1.17px;
  background: #6b6860;
  background-color: #6b6860;
  transform-origin: center;
}

body #sma-success-modal #smaCloseBtn:hover .sma-modal__close-icon::before,
body #sma-success-modal #smaCloseBtn:hover .sma-modal__close-icon::after,
body #sma-success-modal #smaCloseBtn:focus .sma-modal__close-icon::before,
body #sma-success-modal #smaCloseBtn:focus .sma-modal__close-icon::after,
body #sma-success-modal button.sma-modal__close:hover .sma-modal__close-icon::before,
body #sma-success-modal button.sma-modal__close:hover .sma-modal__close-icon::after,
body #sma-success-modal button.sma-modal__close:focus .sma-modal__close-icon::before,
body #sma-success-modal button.sma-modal__close:focus .sma-modal__close-icon::after {
  background: #2d7a45;
  background-color: #2d7a45;
}

body #sma-success-modal .sma-modal__close-icon::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

body #sma-success-modal .sma-modal__close-icon::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.sma-modal__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: #d4edcc;
  border-radius: 28px;
  flex: none;
}

.sma-modal__check {
  display: block;
  width: 26px;
  height: 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 26 26' fill='none'%3E%3Cpath d='M5.5 13.5L10.5 18.5L20.5 7.5' stroke='%232D7A45' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 26px 26px;
}

.sma-modal__eyebrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 360px;
  margin: 0;
  padding: 10.9px 0 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 500;
  font-size: 13px;
  line-height: 16px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-align: center;
  color: #2d7a45;
}

.sma-modal__title {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 360px;
  margin: 0;
  padding: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 27.8px;
  line-height: 34px;
  letter-spacing: -0.7px;
  text-align: center;
  color: #1c1c1a;
}

.sma-modal__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 360px;
  margin: 0;
  padding: 1.775px 0 17.525px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 300;
  font-size: 15px;
  line-height: 25px;
  text-align: center;
  color: #6b6860;
}

.sma-modal__code-box {
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 100%;
  max-width: 360px;
  min-height: 63px;
  padding: 14px 16px;
  gap: 8px;
  background: #ffffff;
  border: 1px dashed #2d7a45;
  border-radius: 14px;
}

.sma-modal__code {
  flex: 1 1 auto;
  margin: 0;
  padding: 0 0 1px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 18px;
  line-height: 22px;
  letter-spacing: 1.5px;
  color: #1c1c1a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Modal buttons — ID selectors beat most theme button rules (no !important) */
body #sma-success-modal #copyBtn.sma-modal__copy,
body #sma-success-modal button#copyBtn {
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 95px;
  height: 33px;
  padding: 9px 16px;
  margin: 0;
  border: 0;
  border-radius: 100px;
  background: #2d7a45;
  background-color: #2d7a45;
  background-image: none;
  box-shadow: none;
  font-family: Arial, sans-serif;
  font-weight: 400;
  font-size: 13px;
  line-height: 15px;
  letter-spacing: normal;
  text-transform: none;
  text-decoration: none;
  color: #ffffff;
  cursor: pointer;
}

body #sma-success-modal #copyBtn.sma-modal__copy:hover,
body #sma-success-modal #copyBtn.sma-modal__copy:focus,
body #sma-success-modal button#copyBtn:hover,
body #sma-success-modal button#copyBtn:focus {
  background: #2d7a45;
  background-color: #2d7a45;
  background-image: none;
  box-shadow: none;
  color: #ffffff;
  opacity: 0.92;
}

.sma-modal__fine {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 360px;
  margin: 0;
  padding: 10.9px 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: 11.8px;
  line-height: 19px;
  text-align: center;
  color: #a8a49c;
}

.sma-modal__fine a {
  color: #a8a49c;
  text-decoration: underline;
}

body #sma-success-modal #doneBtn.sma-modal__done,
body #sma-success-modal button#doneBtn {
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 360px;
  height: 47px;
  padding: 14px 20px;
  margin: 0;
  border: 1px solid rgba(28, 28, 26, 0.15);
  border-radius: 100px;
  background: transparent;
  background-color: transparent;
  background-image: none;
  box-shadow: none;
  font-family: Arial, sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 17px;
  letter-spacing: normal;
  text-transform: none;
  text-decoration: none;
  color: #1c1c1a;
  cursor: pointer;
}

body #sma-success-modal #doneBtn.sma-modal__done:hover,
body #sma-success-modal #doneBtn.sma-modal__done:focus,
body #sma-success-modal button#doneBtn:hover,
body #sma-success-modal button#doneBtn:focus {
  background: rgba(28, 28, 26, 0.04);
  background-color: rgba(28, 28, 26, 0.04);
  background-image: none;
  box-shadow: none;
  color: #1c1c1a;
  border: 1px solid rgba(28, 28, 26, 0.15);
}

@media (max-width: 480px) {
  .sma-modal__card {
    padding: 40px 20px 28px;
  }

  .sma-modal__title {
    font-size: 24px;
    line-height: 30px;
  }

  .sma-modal__code-box {
    flex-wrap: wrap;
    height: auto;
  }

  body #sma-success-modal #copyBtn.sma-modal__copy,
  body #sma-success-modal button#copyBtn {
    width: 100%;
  }
}

/* ---------- Mobile form ---------- */

@media (max-width: 768px) {
  .sma-form {
    padding: 16px;
    border-radius: 20px;
  }

  .sma-form .row > p {
    flex-direction: column !important;
    row-gap: 12px;
    column-gap: 0;
  }

  .sma-form .row .wpcf7-form-control-wrap {
    width: 100% !important;
  }

  body .sma-form form.wpcf7-form input.wpcf7-submit[type="submit"],
  body .sma-form form.wpcf7-form input.wpcf7-submit,
  body .sma-form form.wpcf7-form .wpcf7-submit {
    width: 100%;
    min-width: 0;
  }
}
