/* Source #1034: YOBB - Forms Global v2 */
/* ==================================================
   YOBB – FORMS GLOBAL V6 / VALKOINEN BRÄNDITYYLI

   Testiversio kaikille YOBBin omille lomakkeille.

   Värit:
   - kaikki taustapinnat: Secondary = Valkoinen
   - tehosteet ja painikkeet: Primary = Vihreä
   - teksti: Text = Musta
   - Accent = Kerma vain vihreiden painikkeiden tekstivärinä

   Sisältää myös kirjautumislomakkeen yhteiset tyylit:
   .yobb-login-shell
   .yobb-login-card
   .yobb-login-form
================================================== */


/* ==================================================
   0. YHTEISET MUUTTUJAT
================================================== */

:root {
  --yobb-form-primary:
    var(--e-global-color-primary, #2C9934);

  --yobb-form-white:
    var(--e-global-color-secondary, #FFFFFF);

  --yobb-form-text:
    var(--e-global-color-text, #000000);

  --yobb-form-cream:
    var(--e-global-color-accent, #FFFAEA);

  --yobb-form-grey:
    #C5C5C5;

  --yobb-form-heading-font:
    var(
      --e-global-typography-primary-font-family,
      "Fredoka"
    );

  --yobb-form-body-font:
    var(
      --e-global-typography-text-font-family,
      "Inter"
    );
}


/* ==================================================
   1. LOMAKKEEN ULKOKEHYS
================================================== */

.yobb-form-wrap {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 28px;

  border: 4px dotted var(--yobb-form-text);
  border-radius: 24px;

  background: var(--yobb-form-white);
  color: var(--yobb-form-text);

  box-sizing: border-box;
}

.yobb-form,
.yobb-form *,
.yobb-form *::before,
.yobb-form *::after {
  box-sizing: border-box;
}

.yobb-form {
  display: grid;
  width: 100%;
  gap: 18px;

  color: var(--yobb-form-text);

  font-family:
    var(--yobb-form-body-font),
    sans-serif;

  font-size:
    var(--e-global-typography-text-font-size);

  font-weight:
    var(--e-global-typography-text-font-weight);

  line-height:
    var(--e-global-typography-text-line-height);
}


/* ==================================================
   2. VALINNAINEN LOMAKEHERO
================================================== */

.yobb-form-hero,
.yobb-submit-job-hero {
  max-width: 760px;
  margin: 0 0 26px;
}

.yobb-form-eyebrow,
.yobb-submit-job-eyebrow {
  margin: 0 0 8px;

  color: var(--yobb-form-primary);

  font-family:
    var(--yobb-form-heading-font),
    sans-serif;

  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
}

.yobb-form-hero h1,
.yobb-submit-job-hero h1 {
  margin: 0 0 10px;

  color: var(--yobb-form-text);

  font-family:
    var(--yobb-form-heading-font),
    sans-serif;

  font-size: clamp(34px, 4vw, 46px);
  font-weight: 700;
  line-height: 1.03;
}

.yobb-form-hero > p:last-child,
.yobb-submit-job-hero > p:last-child {
  margin: 0;

  color:
    color-mix(
      in srgb,
      var(--yobb-form-text) 68%,
      transparent
    );

  font-family:
    var(--yobb-form-body-font),
    sans-serif;

  font-size: 15px;
  font-weight: 500;
  line-height: 1.55;
}


/* ==================================================
   3. LOMAKEOSIOT
================================================== */

.yobb-form-section {
  display: grid;
  width: 100%;
  gap: 18px;
  margin: 0;
  padding: 24px;

  border: 1px solid
    color-mix(
      in srgb,
      var(--yobb-form-text) 11%,
      transparent
    );

  border-radius: 20px;

  background: var(--yobb-form-white);
  color: var(--yobb-form-text);

  box-shadow:
    0 8px 22px
    color-mix(
      in srgb,
      var(--yobb-form-text) 5%,
      transparent
    );
}

.yobb-form-section-header {
  display: grid;
  gap: 5px;

  margin: 0 0 2px;
  padding-bottom: 16px;

  border-bottom: 1px solid
    color-mix(
      in srgb,
      var(--yobb-form-text) 9%,
      transparent
    );
}

.yobb-form-heading,
.yobb-form-section h2,
.yobb-form-section h3,
.yobb-form-section h4 {
  margin: 0;
  padding: 0;

  color: var(--yobb-form-text);

  font-family:
    var(--yobb-form-heading-font),
    sans-serif;

  font-weight: 700;
  line-height: 1.1;
}

.yobb-form-heading,
.yobb-form-section h3 {
  font-size: clamp(21px, 3vw, 27px);
}

.yobb-form-section h2 {
  font-size: clamp(25px, 4vw, 34px);
}

.yobb-form-section h4 {
  font-size: 19px;
}

.yobb-form-section-description {
  margin: 0;

  color:
    color-mix(
      in srgb,
      var(--yobb-form-text) 65%,
      transparent
    );

  font-family:
    var(--yobb-form-body-font),
    sans-serif;

  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}


/* ==================================================
   4. KENTTÄRYHMÄT JA GRIDIT
================================================== */

.yobb-form-fields {
  display: grid;
  gap: 16px;
}

.yobb-form-grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 16px;
}

.yobb-form-grid-3 {
  display: grid;
  grid-template-columns:
    repeat(3, minmax(0, 1fr));

  gap: 16px;
}

.yobb-form-field {
  display: grid;
  min-width: 0;
  gap: 7px;
  margin: 0;
}

.yobb-form-field-full {
  grid-column: 1 / -1;
}


/* ==================================================
   5. LABELIT JA OHJETEKSTIT
================================================== */

.yobb-form-label,
.yobb-form-field > label,
.yobb-form-field > span:first-child,
.yobb-choice-label {
  display: block;
  margin: 0;

  color: var(--yobb-form-text);

  font-family:
    var(--yobb-form-heading-font),
    sans-serif;

  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.yobb-form-required {
  color: var(--yobb-form-primary);
}

.yobb-form-help,
.yobb-form-description {
  margin: 0;

  color:
    color-mix(
      in srgb,
      var(--yobb-form-text) 64%,
      transparent
    );

  font-family:
    var(--yobb-form-body-font),
    sans-serif;

  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
}


/* ==================================================
   6. TEKSTIKENTÄT, TEXTAREA JA SELECT
================================================== */

.yobb-form input[type="text"],
.yobb-form input[type="email"],
.yobb-form input[type="password"],
.yobb-form input[type="tel"],
.yobb-form input[type="url"],
.yobb-form input[type="number"],
.yobb-form input[type="date"],
.yobb-form input[type="time"],
.yobb-form input[type="search"],
.yobb-form textarea,
.yobb-form select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 50px;
  margin: 0;
  padding: 13px 15px;

  border: 1px solid
    color-mix(
      in srgb,
      var(--yobb-form-text) 18%,
      transparent
    );

  border-radius: 12px;
  outline: none;

  background: var(--yobb-form-white);
  color: var(--yobb-form-text);

  box-shadow: none;

  font-family:
    var(--yobb-form-body-font),
    sans-serif;

  font-size: 15px;
  font-weight: 400;
  line-height: 1.35;

  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.yobb-form textarea {
  min-height: 130px;
  resize: vertical;
}

.yobb-form select {
  cursor: pointer;
}

.yobb-form input::placeholder,
.yobb-form textarea::placeholder {
  color:
    color-mix(
      in srgb,
      var(--yobb-form-text) 46%,
      transparent
    );

  opacity: 1;
}

.yobb-form input:hover,
.yobb-form textarea:hover,
.yobb-form select:hover {
  border-color: var(--yobb-form-primary);
}

.yobb-form input:focus,
.yobb-form textarea:focus,
.yobb-form select:focus {
  border-color: var(--yobb-form-primary);

  box-shadow:
    0 0 0 3px
    color-mix(
      in srgb,
      var(--yobb-form-primary) 18%,
      transparent
    );
}

.yobb-form input:disabled,
.yobb-form textarea:disabled,
.yobb-form select:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}


/* ==================================================
   7. CHECKBOX- JA RADIOKORTIT
================================================== */

.yobb-choice-field {
  display: grid;
  gap: 10px;
}

.yobb-choice-grid {
  display: grid;
  grid-template-columns:
    repeat(auto-fit, minmax(145px, 1fr));

  gap: 10px;
}

.yobb-choice-card {
  position: relative;
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;

  margin: 0;
  padding: 11px 14px;
  overflow: hidden;

  border: 1px solid
    color-mix(
      in srgb,
      var(--yobb-form-text) 14%,
      transparent
    );

  border-radius: 12px;

  background: var(--yobb-form-white);
  color: var(--yobb-form-text);

  cursor: pointer;
  text-align: center;

  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.yobb-choice-card:hover {
  border-color: var(--yobb-form-primary);
  transform: translateY(-1px);
}

.yobb-choice-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.yobb-choice-card span {
  position: relative;
  z-index: 1;

  color: inherit;

  font-family:
    var(--yobb-form-heading-font),
    sans-serif;

  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
}

.yobb-choice-card:has(input:checked),
.yobb-choice-card.is-selected {
  border-color: var(--yobb-form-primary);

  background: var(--yobb-form-primary);
  color: var(--yobb-form-white);
}

.yobb-choice-card:has(input:focus-visible) {
  box-shadow:
    0 0 0 3px
    color-mix(
      in srgb,
      var(--yobb-form-primary) 18%,
      transparent
    );
}


/* ==================================================
   8. PERINTEISET CHECKBOXIT JA RADIOT
================================================== */

.yobb-check-row,
.yobb-radio-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;

  margin: 0;

  cursor: pointer;
}

.yobb-check-row input[type="checkbox"],
.yobb-radio-row input[type="radio"] {
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;

  margin: 1px 0 0;
  padding: 0;

  accent-color: var(--yobb-form-primary);
  cursor: pointer;
}

.yobb-check-row span,
.yobb-radio-row span {
  color: var(--yobb-form-text);

  font-family:
    var(--yobb-form-body-font),
    sans-serif;

  font-size: 14px;
  line-height: 1.4;
}


/* ==================================================
   9. TOGGLE-KORTTI
================================================== */

.yobb-toggle-card {
  justify-content: flex-start;
  text-align: left;
}

.yobb-toggle-card span {
  padding-left: 30px;
}

.yobb-toggle-card span::before {
  content: "";

  position: absolute;
  top: 50%;
  left: 0;

  width: 22px;
  height: 22px;

  border: 1px solid
    color-mix(
      in srgb,
      var(--yobb-form-text) 30%,
      transparent
    );

  border-radius: 7px;

  background: var(--yobb-form-white);

  transform: translateY(-50%);
}

.yobb-toggle-card:has(input:checked) span::before {
  border-color: var(--yobb-form-white);
  background: var(--yobb-form-white);
}


/* ==================================================
   10. TIEDOSTON LATAUS
================================================== */

.yobb-file-field {
  display: grid;
  gap: 10px;
}

.yobb-file-input {
  position: relative;
  display: grid;
  min-height: 116px;
  place-items: center;

  padding: 18px;

  border: 3px dotted var(--yobb-form-text);
  border-radius: 16px;

  background: var(--yobb-form-white);
  color: var(--yobb-form-text);

  cursor: pointer;
  text-align: center;
}

.yobb-file-input:hover {
  border-color: var(--yobb-form-primary);
}

.yobb-file-input input[type="file"] {
  width: 100%;
  min-height: auto;
  padding: 0;

  border: 0;
  border-radius: 0;

  background: transparent;
  box-shadow: none;

  color:
    color-mix(
      in srgb,
      var(--yobb-form-text) 70%,
      transparent
    );

  cursor: pointer;
}

.yobb-file-input
input[type="file"]::file-selector-button {
  min-height: 42px;
  margin-right: 12px;
  padding: 0 16px;

  border: 1px solid var(--yobb-form-primary);
  border-radius: 11px;

  background: var(--yobb-form-primary);
  color: var(--yobb-form-cream);

  font-family:
    var(--yobb-form-heading-font),
    sans-serif;

  font-weight: 700;

  cursor: pointer;
}

.yobb-file-input
input[type="file"]::file-selector-button:hover {
  opacity: 0.92;
}


/* ==================================================
   11. MEDIAN ESIKATSELU
================================================== */

.yobb-media-preview {
  width: min(100%, 360px);
  aspect-ratio: 9 / 16;
  overflow: hidden;

  border: 3px dotted var(--yobb-form-text);
  border-radius: 18px;

  background: var(--e-global-color-text);
}

.yobb-media-preview[hidden] {
  display: none;
}

.yobb-media-preview-inner {
  width: 100%;
  height: 100%;
}

.yobb-media-preview img,
.yobb-media-preview video {
  display: block;
  width: 100%;
  height: 100%;

  object-fit: contain;
  background: var(--e-global-color-text);
}


/* ==================================================
   12. PÄÄ- JA TOISSIJAISET NAPIT
================================================== */

.yobb-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.yobb-form-submit,
.yobb-form-button,
.yobb-form-button-secondary {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;

  margin: 0;
  padding: 12px 22px;

  border: 1px solid var(--yobb-form-primary);
  border-radius: 12px;

  font-family:
    var(--yobb-form-heading-font),
    sans-serif;

  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-decoration: none !important;

  cursor: pointer;

  transition:
    background 160ms ease,
    color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease,
    opacity 160ms ease;
}

.yobb-form-submit,
.yobb-form-button {
  background: var(--yobb-form-primary) !important;
  color: var(--yobb-form-cream) !important;
}

.yobb-form-button-secondary {
  background: transparent !important;
  color: var(--yobb-form-primary) !important;
}

.yobb-form-submit:hover,
.yobb-form-button:hover,
.yobb-form-button-secondary:hover {
  border-color: var(--yobb-form-primary);

  background: var(--yobb-form-primary) !important;
  color: var(--yobb-form-cream) !important;

  transform: translateY(-1px);
}

.yobb-form-submit:focus-visible,
.yobb-form-button:focus-visible,
.yobb-form-button-secondary:focus-visible {
  outline: none;

  box-shadow:
    0 0 0 3px
    color-mix(
      in srgb,
      var(--yobb-form-primary) 22%,
      transparent
    );
}

.yobb-form-submit:disabled,
.yobb-form-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}


/* ==================================================
   13. VIESTIT
================================================== */

.yobb-form-message {
  width: 100%;
  padding: 14px 16px;

  border: 1px solid var(--yobb-form-primary);
  border-radius: 12px;

  background: var(--yobb-form-white);
  color: var(--yobb-form-text);

  font-family:
    var(--yobb-form-body-font),
    sans-serif;

  font-size: 14px;
  line-height: 1.5;
}

.yobb-form-message p {
  margin: 0;
}

.yobb-form-success {
  border-color: var(--yobb-form-primary);

  background: var(--yobb-form-primary);
  color: var(--yobb-form-cream);
}

.yobb-form-error {
  border-color: var(--yobb-form-text);

  background: var(--yobb-form-white);
  color: var(--yobb-form-text);
}

.yobb-form-field-error,
.yobb-choice-field.yobb-field-error {
  padding: 10px;

  border: 2px solid var(--yobb-form-text);
  border-radius: 12px;

  background: var(--yobb-form-white);
}


/* ==================================================
   14. LATAUSTILA
================================================== */

.yobb-form.is-loading {
  pointer-events: none;
  opacity: 0.68;
}

.yobb-form-submit.is-loading::after {
  content: "";

  width: 16px;
  height: 16px;

  border: 2px solid
    color-mix(
      in srgb,
      var(--yobb-form-cream) 45%,
      transparent
    );

  border-top-color: var(--yobb-form-cream);
  border-radius: 50%;

  animation: yobb-form-spin 700ms linear infinite;
}

@keyframes yobb-form-spin {
  to {
    transform: rotate(360deg);
  }
}


/* ==================================================
   15. KIRJAUTUMISLOMAKE
   Poistaa ylimääräisen sisälaatikon tunteen.
================================================== */

.yobb-card.yobb-login-form-card {
  width: min(100%, 680px) !important;
  margin-inline: auto !important;
}

.yobb-login-shell {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 28px;

  border: 4px dotted var(--yobb-form-text);
  border-radius: 24px;

  background: var(--yobb-form-white);
  color: var(--yobb-form-text);

  box-sizing: border-box;
}

.yobb-login-card {
  width: 100%;
  margin: 0;
  padding: 0;

  border: 0 !important;
  border-radius: 0 !important;

  background: transparent !important;
  box-shadow: none !important;
}

.yobb-login-header {
  display: grid;
  gap: 5px;

  margin: 0 0 22px;
  padding: 0 0 16px;

  border-bottom: 1px solid
    color-mix(
      in srgb,
      var(--yobb-form-text) 12%,
      transparent
    );
}

.yobb-login-brand {
  color: var(--yobb-form-primary);

  font-family:
    var(--yobb-form-heading-font),
    sans-serif;

  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.yobb-login-title {
  margin: 0 !important;

  color: var(--yobb-form-text) !important;

  font-family:
    var(--yobb-form-heading-font),
    sans-serif !important;

  font-size: clamp(30px, 4vw, 40px) !important;
  font-weight: 700 !important;
  line-height: 1.05;
}

.yobb-login-intro {
  margin: 2px 0 0;

  color:
    color-mix(
      in srgb,
      var(--yobb-form-text) 67%,
      transparent
    );

  font-family:
    var(--yobb-form-body-font),
    sans-serif;

  font-size: 14px;
  line-height: 1.5;
}

.yobb-login-form {
  gap: 16px;
}

.yobb-login-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;

  margin-top: 4px;
}

.yobb-login-actions
:is(
  .yobb-login-main-button,
  .yobb-login-register-button
) {
  min-width: 150px;

  font-family:
    var(--yobb-form-heading-font),
    sans-serif !important;

  font-size: 14px !important;
  font-weight: 700 !important;
}

.yobb-login-main-button {
  border-color: var(--yobb-form-primary) !important;

  background: var(--yobb-form-primary) !important;
  color: var(--yobb-form-cream) !important;
}

.yobb-login-register-button {
  border-color: var(--yobb-form-primary) !important;

  background: transparent !important;
  color: var(--yobb-form-primary) !important;
}

.yobb-login-register-button:hover {
  background: var(--yobb-form-primary) !important;
  color: var(--yobb-form-cream) !important;
}

.yobb-login-links {
  margin: 0;
}

.yobb-login-links a,
.yobb-login-links a:visited {
  color: var(--yobb-form-primary) !important;

  font-family:
    var(--yobb-form-body-font),
    sans-serif;

  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.yobb-login-links a:hover {
  text-decoration: underline;
}


/* ==================================================
   16. TABLETTI
================================================== */

@media (max-width: 980px) {

  .yobb-form-wrap,
  .yobb-login-shell {
    padding: 22px;
  }

  .yobb-form-grid-3 {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }
}


/* ==================================================
   17. MOBIILI
================================================== */

@media (max-width: 767px) {

  .yobb-form-wrap,
  .yobb-login-shell {
    padding: 16px;

    border-width: 3px;
    border-radius: 20px;
  }

  .yobb-form {
    gap: 14px;
  }

  .yobb-form-hero,
  .yobb-submit-job-hero {
    margin-bottom: 20px;
  }

  .yobb-form-hero h1,
  .yobb-submit-job-hero h1 {
    font-size: 34px;
  }

  .yobb-form-section {
    gap: 16px;

    padding: 18px;

    border-radius: 17px;
  }

  .yobb-form-grid,
  .yobb-form-grid-3 {
    grid-template-columns: 1fr;
  }

  .yobb-choice-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .yobb-form-actions,
  .yobb-login-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .yobb-form-submit,
  .yobb-form-button,
  .yobb-form-button-secondary,
  .yobb-login-actions
  :is(
    .yobb-login-main-button,
    .yobb-login-register-button
  ) {
    width: 100%;
  }
}


/* ==================================================
   18. ERITTÄIN KAPEA MOBIILI
================================================== */

@media (max-width: 420px) {

  .yobb-form-section {
    padding: 15px;
  }

  .yobb-choice-grid {
    grid-template-columns: 1fr;
  }

  .yobb-choice-card {
    justify-content: flex-start;
    text-align: left;
  }
}
