/* 
Copyright (c) 2025 Bionite Engineering Sp. z o.o.
All rights reserved.

This CSS file defines the styling for the contact form, including layout, typography, 
form validation, file upload preview, and success/error messages.
*/

/* Hidden file input */
#attachment {
  display: none;
}

/* Form wrapper styling */
.form-wrapper {
  margin: 0 auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

/* Form title styling */
.form-title {
  text-align: center;
}

/* Contact form layout */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25em;
}

/* GDPR consent frame styling */
.consent-frame {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1.25em;
}

/* Checkbox styling */
.ion-checkbox-label {
  width: 1.5em;
  height: 1.5em;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.ion-checkbox-label input[type="checkbox"] {
  display: none;
}

.checkbox-icon {
  font-size: 1.5em;
  color: #000;
  pointer-events: none;
}

/* GDPR consent text styling */
.consent-text {
  font-weight: 400;
  font-family: "Geist", sans-serif;
  color: #000;
  margin: 0;
}

.consent-text a {
  text-decoration: underline;
  text-underline-offset: 0.25em;
  color: inherit;
}

.form-submit {
  position: relative;
  display: flex;
  justify-content: center;
  flex-direction: column;
}

/* Submit button styling */
.custom-button {
  left: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  background: #ccd615;
  border-radius: 2em;
  border: none;
  cursor: pointer;
  isolation: isolate;
  position: relative;
  z-index: 0;
  transition: 0.2s;
  margin: 0 auto;
}

.custom-button:hover {
  transform: scale(1.1);
}

.custom-button .button-text {
  color: black;
  position: relative;
  color: inherit;
  visibility: visible;
}

.custom-button.loading {
  background: #999; /* Gray background for loading state */
  cursor: wait; /* Change cursor to indicate waiting */
  position: relative; /* Ensure positioning for the pseudo-element */
}

.custom-button.loading .button-text {
  visibility: hidden; /* Hide the original text without affecting layout */
}

.custom-button.loading .button-text::before {
  content: "Wysyłanie..."; /* Display "Wysyłanie" text */
  visibility: visible;
  position: absolute; /* Position the pseudo-element */
  top: 50%; /* Center vertically */
  left: 50%; /* Center horizontally */
  transform: translate(-50%, -50%); /* Adjust for centering */
  color: #fff; /* Ensure the text is visible */
  font-weight: 500; /* Match the button's font style */
  font-size: 1em; /* Match the button's font size */
}

/* Button text styling */
.button-text {
  font-style: normal;
  font-weight: 500;
  font-size: 1.25em;
  color: #000000;
  text-align: center;
  z-index: 1;
}

/* Form row layout */
.row {
  display: flex;
  gap: 1.5em;
}

/* Form group styling */
.form-group {
  display: flex;
  flex-direction: column;
  flex: 1;
  font-family: "Geist", sans-serif;
}

.form-group label {
  font-family: "Geist", sans-serif;
  font-weight: 500;
  color: #000;
}

.form-group input,
.form-group textarea {
  border: 0.1em solid #000;
  border-radius: 1em;
  font-family: "Geist", sans-serif;
  resize: vertical;
}

/* File upload field styling */
.file-upload-field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75em;
  border: 0.1em solid #000;
  border-radius: 1em;
  width: 100%;
  cursor: pointer;
  font-family: "Geist", sans-serif;
  color: #000;
  box-sizing: border-box;
  overflow: hidden;
}

/* Style for the file size info text */
.file-size-info {
  margin-left: auto; /* Push the text to the right */
  color: #666; /* Gray color for less emphasis */
  white-space: nowrap; /* Prevent wrapping */
}

.file-upload-field:hover {
  background-color: #ccd615;
  border-color: #ccd615;
  color: #fff;
}

.file-upload-field:hover .upload-icon {
  color: #fff;
}

.upload-icon {
  font-size: 1.5em;
  color: #ccd615;
  pointer-events: none; /* Prevents cursor interaction */
}

.file-label {
  user-select: none;
  pointer-events: none; /* Prevents click interception */
}

.file-upload-field input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 1;
  cursor: pointer;
  z-index: 2;
}

/* File preview styling */
.upload-preview {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  padding-left: 0.75em;
  gap: 0.45em;
  transition: margin-top 0.2s ease;
}

.upload-preview.has-files {
  margin-top: 0.75em;
}

/* Individual file styling */
.upload-file {
  display: flex;
  align-items: center;
  border: 0.1em solid #000;
  border-radius: 1em;
  justify-content: space-between;
  background-color: #fff;
  transition: all 0.2s ease;
  cursor: pointer;
}

.upload-file .lime-dot {
  width: 0.75em;
  height: 0.75em;
  border-radius: 50%;
  background-color: #ccd615;
  flex-shrink: 0;
}

.upload-file:hover {
  background-color: #ff0033;
  border-color: #ff0033;
  color: #fff;
}

.upload-file:hover .lime-dot {
  background-color: #fff;
  mask: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" fill="white" xmlns="http://www.w3.org/2000/svg"><path d="M5 12h14" stroke="black" stroke-width="2" stroke-linecap="round"/></svg>')
    no-repeat center;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" fill="white" xmlns="http://www.w3.org/2000/svg"><path d="M5 12h14" stroke="black" stroke-width="2" stroke-linecap="round"/></svg>')
    no-repeat center;
  width: 0.75em;
  height: 0.75em;
  border-radius: 0;
}

.file-left {
  display: flex;
  align-items: center;
  gap: 1em; /* odstęp między kropką a nazwą pliku */
}

/* Error message styling */
.error-message {
  color: #e00;
  margin-top: 0;
  display: none;
  align-self: center;
}

.error-message.active {
  display: block;
}

/* Validation styling */
input.invalid {
  border-color: red;
  background-color: #fff5f5;
}

textarea.invalid {
  border-color: red;
  background-color: #ffe5e5;
}

.ion-checkbox-label.invalid {
  outline: 0.15em solid red;
  outline-offset: 0;
  border-radius: 0.2em;
}

.consent-text.invalid {
  color: #e00;
}

/* Success message styling */
.success-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5em;
  width: 100%;
  height: 100%;
  text-align: center;
}

.success-message .form-title {
  font-size: 2.5em;
  font-weight: 700;
  color: #000;
  margin: 0;
}

.success-message .success-text {
  font-size: 1.5em;
  line-height: 1.5em;
  font-weight: 400;
  color: #000;
  margin: 0;
}

/* Blocking layer styling */
.blocking-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black */
  z-index: 9999; /* Ensure it is above all other elements */
  display: none; /* Hidden by default */
  pointer-events: none; /* Prevent interactions */
}

/* When active, enable pointer events */
.blocking-layer.active {
  display: block;
  pointer-events: all; /* Block all interactions */
}

.grecaptcha-badge {
  visibility: hidden;
}

@media (min-width: 1026px) {
  .form-wrapper {
    width: 70%;
    padding: 0 10%;
    gap: 3em;
    margin: 0 auto;
  }

  .consent-text {
    font-size: 0.95em;
    line-height: 1.75em;
  }

  .form-submit {
    margin-top: 0.5em;
  }

  .custom-button {
    font-size: 1em;
    padding: 0.75em 2em;
  }

  .form-group label {
    font-size: 1em;
    margin-bottom: 0.25em;
  }

  .row {
    flex-direction: row;
  }

  .form-group input,
  .form-group textarea {
    padding: 0.75em 1em;
    font-size: 1em;
  }

  textarea {
    min-height: 5em;
  }

  .file-upload-field {
    padding: 0 1.5em;
    height: 3em;
    font-size: 1em;
  }

  .file-size-info {
    font-size: 0.8em;
  }

  .upload-file {
    padding: 0.75em 1.25em;
    font-size: 0.85em;
  }

  .error-message {
    font-size: 0.85em;
    margin-bottom: 1em;
  }
}

@media (max-width: 1025px) {
  .form-wrapper {
    width: 90%;
    padding: 0;
    gap: 3em;
    margin: 0 auto;
  }

  .consent-text {
    font-size: 1.125em;
    line-height: 1.5em;
  }

  .form-submit {
    margin-top: 1.25em;
  }

  .custom-button {
    font-size: 1em;
    padding: 1em 2.5em;
  }

  .form-group label {
    font-size: 1.2em;
    margin-bottom: 0.375em;
  }

  .row {
    flex-direction: column;
  }

  .form-group input,
  .form-group textarea {
    padding: 0.75em 1.25em;
    font-size: 1.125em;
  }

  textarea {
    min-height: 5em;
  }

  .file-upload-field {
    padding: 0 1.25em;
    height: 2.85em;
    font-size: 1.2em;
  }

  .file-size-info {
    font-size: 0.85em;
  }

  .upload-file {
    padding: 0.75em 1.25em;
    font-size: 1.125em;
  }

  .error-message {
    font-size: 1.125em;
    margin-bottom: 1em;
  }
}
