/* GAON form skin.

   Two hooks, both matched with :is() so every rule below is written once:

   .gaon-form                             - the CSS class to put on any Elementor
                                            form widget that should wear this
                                            skin (Advanced > CSS Classes).
   .contact-head ~ .elementor-widget-form - the home page contact section, which
                                            is styled without needing the class
                                            at all, since the form there is
                                            always a sibling of the section head.

   Selectors carry .elementor-field-group / .elementor-field-type-submit rather
   than sitting on the field alone: Elementor's own defaults are written at that
   depth, and a shorter selector ties with them and loses on load order.

   Three declarations carry !important, all the same case: Elementor compiles a
   form widget's own Style settings into post CSS scoped to the element id -

     .elementor-2 .elementor-element.elementor-element-<id> .elementor-field-group ...

   five classes deep and unbeatable from a stylesheet unless the id is hard
   coded into it. Clearing those settings in the widget's Style tab would work
   equally well; the !important keeps the skin correct whether or not anyone
   remembers to, and on every future form that wears the class. */

:is(.gaon-form, .contact-head ~ .elementor-widget-form){
  --gform-ink: #07080A;
  --gform-line: #1E1E1E;
  /* 4.85:1 on the section's #F4F4F4. Placeholder text is text: it has to clear
     AA like any other label, which the usual grey #A9A9A9 does not. */
  --gform-hint: #6B6B6B;
  --gform-btn-bg: #1E1E1E;
  --gform-btn-ink: #CDCDCD;
  --gform-font: "Noto Sans Hebrew", system-ui, Arial, sans-serif;
  inline-size: 100%;
  margin-block-start: 40px;
}

/* Elementor's column gutter is a negative margin on the wrapper. The skin sets
   its own gaps, so the gutter has to go or the fields hang past the section. */
:is(.gaon-form, .contact-head ~ .elementor-widget-form) .elementor-form-fields-wrapper{
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin: 0 !important;
}

/* A text field stacks its label over its input, so the group is a column. */
:is(.gaon-form, .contact-head ~ .elementor-widget-form) .elementor-form .elementor-field-group{
  inline-size: 100%;
  max-inline-size: 100%;
  padding: 0;
  margin: 0;
  flex-direction: column;
  align-items: stretch;
}

/* Hidden fields still render a group wrapper; collapse it so it cannot open a
   hole in the grid. */
:is(.gaon-form, .contact-head ~ .elementor-widget-form) .elementor-field-type-hidden{
  display: none !important;
}

:is(.gaon-form, .contact-head ~ .elementor-widget-form) .elementor-field-group .elementor-field-label{
  display: block;
  margin-block-end: 4px;
  padding: 0;
  font-family: var(--gform-font);
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  color: var(--gform-ink);
  text-align: start;
}

/* The Figma field is a rule, not a box: no fill, no frame, one line under the
   text. flex is cleared because Elementor sets flex-grow on the field, and
   inside a column group that stretches the input over whatever height the grid
   row happens to be. */
:is(.gaon-form, .contact-head ~ .elementor-widget-form) .elementor-field-group .elementor-field-textual{
  inline-size: 100%;
  flex: 0 0 auto;
  min-block-size: 0;
  background-color: transparent !important;
  border: 0;
  border-block-end: 1px solid var(--gform-line);
  border-radius: 0;
  box-shadow: none;
  padding: 6px 0;
  font-family: var(--gform-font);
  font-size: 18px;
  line-height: 28px;
  color: var(--gform-ink);
  text-align: start;
  transition: border-color .15s ease;
}

:is(.gaon-form, .contact-head ~ .elementor-widget-form) .elementor-field-group .elementor-field-textual::placeholder{
  color: var(--gform-hint);
  opacity: 1;
  font-size: 16px;
}

:is(.gaon-form, .contact-head ~ .elementor-widget-form) .elementor-field-group .elementor-field-textual:hover{
  border-block-end-color: var(--gform-ink);
}

/* A colour change alone is not a focus indicator. The outline is drawn on the
   field box so it stays visible whichever way the theme paints around it. */
:is(.gaon-form, .contact-head ~ .elementor-widget-form) .elementor-field-group .elementor-field-textual:focus,
:is(.gaon-form, .contact-head ~ .elementor-widget-form) .elementor-field-group .elementor-field-textual:focus-visible{
  outline: 2px solid var(--gform-ink);
  outline-offset: 3px;
  border-block-end-color: var(--gform-ink);
  box-shadow: none;
}

:is(.gaon-form, .contact-head ~ .elementor-widget-form) .elementor-field-required .elementor-field-label:after{
  content: "*";
  margin-inline-start: 3px;
  color: var(--gform-ink);
}

/* Consent ---------------------------------------------------------------
   The acceptance text is the field's real label, so the outer one is dropped
   rather than duplicated. Checkbox and text are aligned with flex and a small
   top offset on the box instead of a relative nudge: the offset then holds if
   the text ever wraps to two lines or the type scale changes.

   The asterisk rule above is scoped away from this group on purpose - the
   sentence already ends in a full stop and a floating * after it reads as a
   typo. The field is still required. */

:is(.gaon-form, .contact-head ~ .elementor-widget-form) .elementor-field-type-acceptance > .elementor-field-label{
  display: none;
}

:is(.gaon-form, .contact-head ~ .elementor-widget-form) .elementor-field-type-acceptance .elementor-field-option{
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

:is(.gaon-form, .contact-head ~ .elementor-widget-form) .elementor-field-type-acceptance input[type="checkbox"]{
  flex: none;
  inline-size: 18px;
  block-size: 18px;
  margin: 0;
  margin-block-start: 3px;
  accent-color: var(--gform-line);
  cursor: pointer;
}
:is(.gaon-form, .contact-head ~ .elementor-widget-form) .elementor-field-type-acceptance input[type="checkbox"]:focus-visible{
  outline: 2px solid var(--gform-ink);
  outline-offset: 2px;
}

:is(.gaon-form, .contact-head ~ .elementor-widget-form) .elementor-field-type-acceptance label{
  font-family: var(--gform-font);
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  color: var(--gform-ink);
  cursor: pointer;
}

:is(.gaon-form, .contact-head ~ .elementor-widget-form) .elementor-field-type-acceptance a{
  color: #000000;
  text-decoration: underline;
  text-underline-offset: 2px;
}
:is(.gaon-form, .contact-head ~ .elementor-widget-form) .elementor-field-type-acceptance a:focus-visible{
  outline: 2px solid var(--gform-ink);
  outline-offset: 2px;
}

/* Button ----------------------------------------------------------------
   The submit group is put back to a row. It has to be written one class deeper
   than the field-group rule above, not shorter: a column group with
   align-items:stretch is exactly what was pulling the button across the whole
   form, and the generic rule was out-specifying the fix. */

:is(.gaon-form, .contact-head ~ .elementor-widget-form) .elementor-form .elementor-field-group.elementor-field-type-submit{
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
}

/* Sized by its label rather than stretched. Elementor's
   .elementor-button-align-stretch also pins flex-basis to 100%, which width
   alone does not undo, so the flex shorthand is reset here too. */
:is(.gaon-form, .contact-head ~ .elementor-widget-form) .elementor-field-type-submit .elementor-button[type="submit"]{
  inline-size: auto;
  flex: 0 0 auto;
  min-inline-size: 248px;
  min-block-size: 0;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px 30px;
  border: 0;
  border-radius: 11.56px;
  background-color: var(--gform-btn-bg);
  /* 10.5:1 - the Figma pairing clears AAA as drawn, so it is kept as is. */
  color: var(--gform-btn-ink);
  font-family: var(--gform-font);
  font-size: 21.44px;
  line-height: 1.2;
  font-weight: 400;
  white-space: nowrap;
  filter: drop-shadow(5.78px 4.624px 14.392px rgba(0, 0, 0, .03));
  transition: background-color .2s ease;
}
:is(.gaon-form, .contact-head ~ .elementor-widget-form) .elementor-field-type-submit .elementor-button[type="submit"]:hover,
:is(.gaon-form, .contact-head ~ .elementor-widget-form) .elementor-field-type-submit .elementor-button[type="submit"]:focus{
  background-color: #000000;
  color: var(--gform-btn-ink);
}
:is(.gaon-form, .contact-head ~ .elementor-widget-form) .elementor-field-type-submit .elementor-button[type="submit"]:focus-visible{
  outline: 2px solid var(--gform-ink);
  outline-offset: 3px;
}

:is(.gaon-form, .contact-head ~ .elementor-widget-form) .elementor-field-type-submit .elementor-button-content-wrapper{
  inline-size: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
:is(.gaon-form, .contact-head ~ .elementor-widget-form) .elementor-field-type-submit .elementor-button-text{
  color: var(--gform-btn-ink);
  white-space: nowrap;
}

/* The same diagonal arrow the company cards use, drawn as a mask so it takes
   the button's own colour and cannot drift from it. */
:is(.gaon-form, .contact-head ~ .elementor-widget-form) .elementor-field-type-submit .elementor-button[type="submit"]:after{
  content: "";
  flex: none;
  inline-size: 13px;
  block-size: 13px;
  margin-inline-start: auto;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26'%3E%3Cpath d='M19.5 6.5 L7 19 M7 11.5 V19 H14.5' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26'%3E%3Cpath d='M19.5 6.5 L7 19 M7 11.5 V19 H14.5' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* Messages -------------------------------------------------------------- */

:is(.gaon-form, .contact-head ~ .elementor-widget-form) .elementor-message{
  font-family: var(--gform-font);
  font-size: 16px;
  line-height: 24px;
  margin-block-start: 16px;
}
:is(.gaon-form, .contact-head ~ .elementor-widget-form) .elementor-message.elementor-message-success{ color: #1B5E20; }
:is(.gaon-form, .contact-head ~ .elementor-widget-form) .elementor-message.elementor-message-danger{ color: #B3261E; }

/* Desktop grid ----------------------------------------------------------
   Two equal columns across the full section width; consent and then the button
   each get their own full width row. The Figma frame parks the fields in a
   narrow cluster at 23% of the width with the button beside them, which leaves
   half the section empty and squeezes the button label onto two lines - so the
   layout follows the standard two-up form instead. Placement is by field id
   rather than nth-child, and the :has() guard means a form whose fields are not
   named yet stacks instead of collapsing into the wrong cells. */

@media (min-width: 768px){
  :is(.gaon-form, .contact-head ~ .elementor-widget-form) .elementor-form-fields-wrapper:has(.elementor-field-group-subject){
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 30px;
    row-gap: 32px;
  }
  :is(.gaon-form, .contact-head ~ .elementor-widget-form) .elementor-field-group-name{    grid-area: 1 / 1; }
  :is(.gaon-form, .contact-head ~ .elementor-widget-form) .elementor-field-group-email{   grid-area: 1 / 2; }
  :is(.gaon-form, .contact-head ~ .elementor-widget-form) .elementor-field-group-phone{   grid-area: 2 / 1; }
  :is(.gaon-form, .contact-head ~ .elementor-widget-form) .elementor-field-group-subject{ grid-area: 2 / 2; }
  :is(.gaon-form, .contact-head ~ .elementor-widget-form) .elementor-field-group-privacy{
    grid-column: 1 / -1;
    margin-block-start: 8px;
  }
  :is(.gaon-form, .contact-head ~ .elementor-widget-form) .elementor-form-fields-wrapper:has(.elementor-field-group-subject) .elementor-field-type-submit{
    grid-column: 1 / -1;
  }
  :is(.gaon-form, .contact-head ~ .elementor-widget-form) .elementor-message{
    grid-column: 1 / -1;
    margin-block-start: 0;
  }
}

@media (max-width: 767px){
  :is(.gaon-form, .contact-head ~ .elementor-widget-form) .elementor-field-type-submit .elementor-button[type="submit"]{
    inline-size: 100%;
    flex: 1 1 auto;
    min-inline-size: 0;
    padding: 18px 22px;
    font-size: 18px;
  }
}
