/**
 * cgp-forms.css
 *
 * Shared Contact Form 7 component for recharge.gr.
 *
 * Applies only to forms rendered with html_class="cgp-cf7", e.g.
 *   [contact-form-7 id="123" html_class="cgp-cf7"]
 * so the site's other CF7 forms are not affected. Every selector starts
 * with .cgp-cf7 (the <form> element) or .cgp-cf7-sent (a wrapper the page
 * script marks after a successful send).
 *
 * Visual values follow the partner sign-up form (cgp-partner-signup.css,
 * .cgp-psu): labels above fields, 48px inputs with a 10px radius, blue focus
 * ring, choice cards, consent row, 12px-radius primary button, success panel.
 *
 * Theme rules this file deliberately overrides (child theme style.css):
 *   - input[type=checkbox] { transform: scale(1.4) !important }
 *   - .wpcf7-number { width: 100px !important }
 *   - .wpcf7-not-valid-tip { position: absolute !important; … }
 *   - input.wpcf7-form-control.wpcf7-submit.has-spinner { pill, 230px max,
 *     display:block, colours … !important }
 *   - .wpcf7-list-item { margin: 5px 15px 5px 0 }
 * plus Contact Form 7's own response-output box and list-item spacing.
 *
 * Loaded on every page (the footer "Contact us" popups will use it in
 * phase 2). Used first by the business page contact section (2767 / 2810).
 *
 * @package RCH_Theme
 * 1.0.1 (2026-11-02): Contact Form 7 wraps the inline content of every
 * block in <p> (WPCF7_AUTOP), even in a template written without blank
 * lines. Those 16px paragraph margins doubled the row spacing, and the
 * submit button sat inside a <p>, so the full-width phone rule did not
 * reach it. The paragraphs now have no margin, and the one around the
 * submit button is display: contents. Checked on the live page.
 *
 * 1.0.2 (2026-11-02): Turnstile. The business page script moves the widget
 * from the top of the form to just above the actions; it gets 24px above it.
 *
 * 1.0.3 (2026-11-02): a theme hook (functions.php) now moves the Turnstile
 *   widget above the submit button in every CF7 form and marks it
 *   .cgp-turnstile-placed; spacing for forms not yet restyled added at the end.
 *
 * 1.0.4 (2026-11-02): footer "Contact us" popups (Popup Maker 231 / 1254,
 *   CF7 forms 4 / 1253): form heading (.cgp-form-head), single-column
 *   compact variant (.cgp-form-compact) and the popup window itself
 *   (no theme navy border, 18px radius, soft shadow). The popup rules are
 *   scoped to #popmake-231 and #popmake-1254 only. With Turnstile in
 *   interaction-only mode (functions.php) the widget takes no space unless
 *   Cloudflare asks the visitor to click; 16px above it when it shows.
 *
 * @version 1.0.4
 * @date    2026-11-02
 */

.cgp-cf7 {
  --cf-ink:        #0F2237;
  --cf-text:       #475569;
  --cf-soft:       #5C708A;
  --cf-action:     #1665D8;
  --cf-action-hov: #1255B8;
  --cf-focus:      #71B0F6;
  --cf-border:     #D5DEEA;
  --cf-line:       #E1E8F1;
  --cf-tint:       #F4F8FD;
  --cf-error:      #B42318;
  --cf-error-bg:   #FEF3F2;
  --cf-f-display:  'Geologica', 'Helvetica Neue', Arial, sans-serif;
  --cf-f-body:     'Helvetica Neue', Helvetica, Arial, sans-serif;

  margin: 0;
  color: var(--cf-ink);
  font-family: var(--cf-f-body);
  font-size: 16px;
  line-height: 1.55;
  text-align: left;
}
.cgp-cf7 *,
.cgp-cf7 *::before,
.cgp-cf7 *::after { box-sizing: border-box; }

/* Contact Form 7's automatic paragraphs (WPCF7_AUTOP): it wraps the inline
   content of each block in <p>. Neutralise them (1.0.1). */
.cgp-cf7 .cgp-form-fields br,
.cgp-cf7 .cgp-form-success br { display: none; }
.cgp-cf7 > p:empty { display: none; }
.cgp-cf7 .cgp-form-field > p,
.cgp-cf7 .cgp-form-sub > p,
.cgp-cf7 .cgp-form-consent > p,
.cgp-cf7 .cgp-form-success > p:first-child { margin: 0; }
.cgp-cf7 .cgp-form-actions > p:not(.cgp-form-note) { display: contents; }

/* ── Layout ── */
.cgp-cf7 .cgp-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 18px;
}
.cgp-cf7 .cgp-form-field { min-width: 0; margin: 0; }
.cgp-cf7 .cgp-form-field--wide { grid-column: 1 / -1; }

.cgp-cf7 .cgp-form-label {
  display: block;
  margin: 0 0 8px;
  padding: 0;
  font-family: var(--cf-f-display);
  font-size: .86rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--cf-ink);
}
.cgp-cf7 .cgp-form-req { color: var(--cf-action); }
.cgp-cf7 .cgp-form-opt {
  font-family: var(--cf-f-body);
  font-weight: 400;
  color: var(--cf-soft);
}

/* Two small fields side by side (AC / DC station counts). */
.cgp-cf7 .cgp-form-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
}
.cgp-cf7 .cgp-form-sublabel {
  display: block;
  margin: 0 0 6px;
  font-size: .82rem;
  line-height: 1.4;
  color: var(--cf-soft);
}

/* ── Inputs ── */
.cgp-cf7 .wpcf7-form-control-wrap { display: block; position: relative; }

.cgp-cf7 .wpcf7-form-control.cgp-form-input {
  display: block;
  width: 100% !important;          /* theme: .wpcf7-number { width:100px !important } */
  max-width: none;
  min-height: 48px;
  margin: 0;
  padding: 11px 14px;
  border: 1.5px solid var(--cf-border);
  border-radius: 10px;
  background: #fff;
  color: var(--cf-ink);
  font-family: var(--cf-f-body);
  font-size: 1rem;
  line-height: 1.4;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
.cgp-cf7 .wpcf7-form-control.cgp-form-input[type="number"] { -moz-appearance: textfield; }
.cgp-cf7 textarea.wpcf7-form-control.cgp-form-input { min-height: 112px; resize: vertical; }
.cgp-cf7 .wpcf7-form-control.cgp-form-input::placeholder { color: #94A3B8; opacity: 1; }
.cgp-cf7 .wpcf7-form-control.cgp-form-input:hover { border-color: #B8C6D8; }
.cgp-cf7 .wpcf7-form-control.cgp-form-input:focus {
  outline: none;
  border-color: var(--cf-action);
  box-shadow: 0 0 0 3px rgba(22, 101, 216, .18);
}
.cgp-cf7 .wpcf7-form-control.cgp-form-input.wpcf7-not-valid { border-color: var(--cf-error); }
.cgp-cf7 .wpcf7-form-control.cgp-form-input.wpcf7-not-valid:focus { box-shadow: 0 0 0 3px rgba(180, 35, 24, .15); }

/* Validation message: in the flow under the field (theme makes it absolute). */
.cgp-cf7 .wpcf7-not-valid-tip {
  position: static !important;
  display: block;
  left: auto;
  top: auto;
  margin: 6px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  font-size: .84rem;
  line-height: 1.4;
  color: var(--cf-error);
}

/* ── Choice cards (checkbox group, e.g. intended use) ── */
.cgp-cf7 .wpcf7-checkbox.cgp-form-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.cgp-cf7 .cgp-form-choices .wpcf7-list-item {
  display: block;
  margin: 0;
}
.cgp-cf7 .cgp-form-choices .wpcf7-list-item > label {
  position: relative;
  display: block;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.cgp-cf7 .cgp-form-choices input[type="checkbox"] {
  position: absolute;
  top: 50%;
  left: 16px;
  width: 18px;
  height: 18px;
  margin: -9px 0 0;
  accent-color: var(--cf-action);
  transform: none !important;      /* theme: scale(1.4) !important */
  cursor: pointer;
  outline: none !important;        /* focus is drawn on the card */
}
.cgp-cf7 .cgp-form-choices .wpcf7-list-item-label {
  display: flex;
  align-items: center;
  height: 100%;
  min-height: 52px;
  padding: 13px 14px 13px 44px;
  border: 1.5px solid var(--cf-border);
  border-radius: 12px;
  background: #fff;
  font-family: var(--cf-f-display);
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--cf-ink);
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.cgp-cf7 .cgp-form-choices .wpcf7-list-item-label::before,
.cgp-cf7 .cgp-form-choices .wpcf7-list-item-label::after { content: none; }
.cgp-cf7 .cgp-form-choices label:hover .wpcf7-list-item-label { border-color: var(--cf-focus); }
.cgp-cf7 .cgp-form-choices input:checked + .wpcf7-list-item-label {
  border-color: var(--cf-action);
  background: var(--cf-tint);
  box-shadow: 0 0 0 1px var(--cf-action);
}
.cgp-cf7 .cgp-form-choices input:focus-visible + .wpcf7-list-item-label {
  outline: 3px solid var(--cf-focus);
  outline-offset: 2px;
}

/* ── Consent (acceptance) ── */
.cgp-cf7 .cgp-form-consent {
  margin: 28px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--cf-line);
}
.cgp-cf7 .wpcf7-acceptance .wpcf7-list-item { display: block; margin: 0; }
.cgp-cf7 .wpcf7-acceptance label {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 12px;
  align-items: start;
  margin: 0;
  font-size: .92rem;
  line-height: 1.55;
  color: var(--cf-text);
  cursor: pointer;
}
.cgp-cf7 .wpcf7-acceptance input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--cf-action);
  transform: none !important;      /* theme: scale(1.4) !important */
  cursor: pointer;
}
.cgp-cf7 .wpcf7-acceptance .wpcf7-list-item-label::before,
.cgp-cf7 .wpcf7-acceptance .wpcf7-list-item-label::after { content: none; }
.cgp-cf7 .wpcf7-acceptance a {
  color: var(--cf-action);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cgp-cf7 .wpcf7-acceptance a:hover { color: var(--cf-action-hov); }
.cgp-cf7 .cgp-form-consent .wpcf7-not-valid-tip { margin-left: 32px; }

/* ── Actions ── */
.cgp-cf7 .cgp-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  position: relative;
  margin: 24px 0 0;
}
/* Captcha widget, wherever Contact Form 7 inserts it (top of the form by
   default; the business page script moves it above the actions). */
.cgp-cf7 .wpcf7-turnstile,
.cgp-cf7 .cf-turnstile { flex-basis: 100%; max-width: 100%; margin: 0; }
.cgp-cf7 > .wpcf7-turnstile,
.cgp-cf7 > .cf-turnstile { margin: 0 0 20px; }
.cgp-cf7 .cgp-form-fields > .wpcf7-turnstile,
.cgp-cf7 .cgp-form-fields > .cf-turnstile { margin: 16px 0 0; }

.cgp-cf7 input.wpcf7-form-control.wpcf7-submit.has-spinner,
.cgp-cf7 input.wpcf7-form-control.wpcf7-submit {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 0;
  max-width: none;
  min-height: 50px;
  margin: 0 !important;
  padding: 12px 28px !important;
  border: 0 !important;
  border-radius: 12px !important;
  background-color: var(--cf-action) !important;
  color: #fff !important;
  font-family: var(--cf-f-display);
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.3;
  text-transform: none;
  box-shadow: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color .18s;
}
.cgp-cf7 input.wpcf7-form-control.wpcf7-submit.has-spinner:hover,
.cgp-cf7 input.wpcf7-form-control.wpcf7-submit:hover { background-color: var(--cf-action-hov) !important; }
.cgp-cf7 input.wpcf7-form-control.wpcf7-submit:focus-visible { outline: 3px solid var(--cf-focus); outline-offset: 3px; }
.cgp-cf7 input.wpcf7-form-control.wpcf7-submit:disabled { opacity: .7; cursor: progress; }
.cgp-cf7 .wpcf7-spinner { order: 3; margin: 0; }   /* after the note, not between button and note */

.cgp-cf7 .cgp-form-note {
  margin: 0;
  font-family: var(--cf-f-body);
  font-size: .8rem;
  line-height: 1.4;
  color: var(--cf-soft);
}

/* ── Response message (errors; success uses the panel below) ── */
.wpcf7 form.cgp-cf7 .wpcf7-response-output {
  margin: 20px 0 0;
  padding: 12px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--cf-tint);
  font-size: .92rem;
  line-height: 1.5;
  color: var(--cf-text);
}
.wpcf7 form.cgp-cf7.invalid .wpcf7-response-output,
.wpcf7 form.cgp-cf7.unaccepted .wpcf7-response-output,
.wpcf7 form.cgp-cf7.failed .wpcf7-response-output,
.wpcf7 form.cgp-cf7.aborted .wpcf7-response-output,
.wpcf7 form.cgp-cf7.spam .wpcf7-response-output {
  background: var(--cf-error-bg);
  color: var(--cf-error);
}

/* ── Success panel (shown instead of the fields after a send) ── */
.cgp-cf7 .cgp-form-success {
  display: none;
  padding: 24px 12px;
  text-align: center;
}
.cgp-cf7 .cgp-form-success:focus { outline: none; }
.cgp-cf7 .cgp-form-success-icon {
  position: relative;
  display: inline-block;
  width: 56px;
  height: 56px;
  margin: 0 0 16px;
  border-radius: 16px;
  background: var(--cf-tint);
}
.cgp-cf7 .cgp-form-success-icon::after {
  content: '';
  position: absolute;
  top: 17px;
  left: 21px;
  width: 12px;
  height: 20px;
  border: solid var(--cf-action);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}
.cgp-cf7 .cgp-form-success-title {
  margin: 0 0 10px;
  font-family: var(--cf-f-display);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.02em;
  color: var(--cf-ink);
}
.cgp-cf7 .cgp-form-success-text {
  max-width: 520px;
  margin: 0 auto;
  font-family: var(--cf-f-body);
  color: var(--cf-text);
}

/* Sent: Contact Form 7 marks the form .sent; the page script also marks a
   wrapper .cgp-cf7-sent, which survives Contact Form 7's own reset. */
.cgp-cf7.sent .cgp-form-fields,
.cgp-cf7-sent .cgp-cf7 .cgp-form-fields,
.cgp-cf7-sent .cgp-cf7 .wpcf7-turnstile,
.cgp-cf7-sent .cgp-cf7 .cf-turnstile,
.wpcf7 form.cgp-cf7.sent .wpcf7-response-output,
.cgp-cf7-sent .wpcf7 form.cgp-cf7 .wpcf7-response-output { display: none; }
.cgp-cf7.sent .cgp-form-success,
.cgp-cf7-sent .cgp-cf7 .cgp-form-success { display: block; }

/* ── Smaller screens ── */
@media (max-width: 720px) {
  .cgp-cf7 .cgp-form-grid { grid-template-columns: 1fr; gap: 18px; }
  .cgp-cf7 .wpcf7-checkbox.cgp-form-choices { grid-template-columns: 1fr; gap: 10px; }
  .cgp-cf7 input.wpcf7-form-control.wpcf7-submit.has-spinner,
  .cgp-cf7 input.wpcf7-form-control.wpcf7-submit { flex: 1 1 100%; width: 100%; }
  .cgp-cf7 .wpcf7-spinner { position: absolute; top: 13px; right: 14px; }
  .cgp-cf7 .cgp-form-note { flex-basis: 100%; text-align: center; }
}

/* ── Form heading (popups) ── */
.cgp-cf7 .cgp-form-head { margin: 0 0 20px; }
.cgp-cf7 .cgp-form-head > p { margin: 0; }
.cgp-cf7 .cgp-form-title {
  font-family: var(--cf-f-display);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.015em;
  color: var(--cf-ink);
}
.cgp-cf7 .cgp-form-head .cgp-form-lede {
  margin-top: 6px;
  font-size: .92rem;
  line-height: 1.5;
  color: var(--cf-soft);
}
.cgp-cf7.sent .cgp-form-head,
.cgp-cf7-sent .cgp-cf7 .cgp-form-head { display: none; }

/* ── Compact variant: one column, full-width button (narrow popups) ── */
.cgp-cf7 .cgp-form-compact .cgp-form-grid { grid-template-columns: 1fr; gap: 16px; }
.cgp-cf7 .cgp-form-compact textarea.wpcf7-form-control.cgp-form-input { min-height: 88px; }
.cgp-cf7 .cgp-form-compact .cgp-form-consent { margin-top: 20px; padding-top: 16px; }
.cgp-cf7 .cgp-form-compact .cgp-form-actions { margin-top: 20px; }
.cgp-cf7 .cgp-form-compact input.wpcf7-form-control.wpcf7-submit.has-spinner,
.cgp-cf7 .cgp-form-compact input.wpcf7-form-control.wpcf7-submit { flex: 1 1 100%; width: 100%; }
.cgp-cf7 .cgp-form-compact .wpcf7-spinner { position: absolute; top: 13px; right: 14px; }
.cgp-cf7 .cgp-form-compact .cgp-form-note { display: none; }   /* asterisks say it; keeps the popup short */

/* ── Popup window for the footer "Contact us" forms ── */
/* Above the site header (theme: .pum-overlay { z-index: 10 !important }). */
#pum-231.pum-overlay,
#pum-1254.pum-overlay { z-index: 100001 !important; }
#popmake-231.pum-container,
#popmake-1254.pum-container {
  padding: 32px 28px 28px;
  border: 0 !important;                                   /* theme: 4px navy !important */
  border-radius: 18px;
  box-shadow: 0 16px 48px rgba(15, 34, 55, .18) !important;
  background: #fff;
}
#popmake-231 .pum-content,
#popmake-1254 .pum-content { color: #0F2237; }
#popmake-231 .pum-content > p:empty,
#popmake-1254 .pum-content > p:empty { display: none; }
#popmake-231 .pum-content + .pum-close,
#popmake-1254 .pum-content + .pum-close {
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  font-size: 18px;
  line-height: 32px;
  color: #5C708A;
  background: #F4F8FD;
  box-shadow: none;
}
#popmake-231 .pum-content + .pum-close:hover,
#popmake-1254 .pum-content + .pum-close:hover { color: #0F2237; background: #E8EFF8; }
#popmake-231 .cgp-form-head,
#popmake-1254 .cgp-form-head { padding-right: 40px; }   /* room for the close button */

/* Turnstile in forms not yet restyled (footer popups etc.); see functions.php. */
.wpcf7 form:not(.cgp-cf7) .cf-turnstile.cgp-turnstile-placed { margin: 16px 0 8px; }

@media (prefers-reduced-motion: reduce) {
  .cgp-cf7 * { transition: none !important; }
}
