/* Expert application form (CF7 "Formularz ekspertów", markup: inc/expert-application-form.php). */

.ns-form {
  --ns-primary: #025188;
  --ns-primary-hover: #004272;
  --ns-ink: #1d1d1f;
  --ns-ink-80: #333333;
  --ns-ink-48: #7a7a7a;
  --ns-parchment: #f5f5f7;
  --ns-pearl: #fafafc;
  --ns-hairline: #e0e0e0;
  --ns-error: #c0392b;

  color: var(--ns-ink);
  display: flex;
  flex-direction: column;
  font-family: "Dosis", system-ui, sans-serif;
  gap: 18px;
  text-align: left;
}
.ns-form *,
.ns-form *::before,
.ns-form *::after {
  box-sizing: border-box;
}
.ns-form p {
  margin: 0;
}

.ns-form .ns-form__grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
}
.ns-form .ns-form__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}
.ns-form .ns-form__label {
  color: var(--ns-ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  padding: 0;
}
.ns-form .ns-form__req {
  color: var(--ns-primary);
  margin-left: 2px;
}
.ns-form .ns-form__hint {
  color: var(--ns-ink-48);
  font-size: 12px;
  line-height: 1.4;
}

/* Text inputs, select, textarea */
.ns-form .wpcf7-form-control-wrap {
  display: block;
}
.ns-form input[type="text"],
.ns-form input[type="email"],
.ns-form input[type="tel"],
.ns-form select,
.ns-form textarea {
  appearance: none;
  background: var(--ns-pearl);
  border: 1px solid var(--ns-hairline);
  border-radius: 11px;
  box-shadow: none;
  color: var(--ns-ink);
  font-family: inherit;
  font-size: 17px;
  height: 48px;
  line-height: 1.3;
  margin: 0;
  padding: 0 14px;
  width: 100%;
}
.ns-form select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237a7a7a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 14px center;
  background-repeat: no-repeat;
  padding-right: 40px;
}
.ns-form textarea {
  height: auto;
  min-height: 96px;
  padding: 12px 14px;
  resize: vertical;
}
.ns-form input::placeholder,
.ns-form textarea::placeholder {
  color: var(--ns-ink-48);
  opacity: 1;
}
.ns-form input:focus,
.ns-form select:focus,
.ns-form textarea:focus {
  border-color: var(--ns-primary);
  outline: 2px solid var(--ns-primary);
  outline-offset: 0;
}

/* Single checkboxes (account, consents) */
.ns-form .ns-form__check .wpcf7-list-item {
  display: block;
  margin: 0;
}
.ns-form .ns-form__check label {
  align-items: flex-start;
  cursor: pointer;
  display: flex;
  font-size: 14px;
  gap: 10px;
  line-height: 1.43;
}
.ns-form .ns-form__consents .ns-form__check label {
  color: var(--ns-ink-80);
  font-size: 12px;
  line-height: 1.45;
}
.ns-form input[type="checkbox"] {
  accent-color: var(--ns-primary);
  flex: none;
  height: 18px;
  margin: 0;
  width: 18px;
}

/* "Wysyłam formularz w celu" - every option is a selectable card */
.ns-form .ns-form__group {
  border: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  min-width: 0;
  padding: 0;
}
.ns-form .ns-form__group legend {
  margin-bottom: 8px;
}
.ns-form .wpcf7-checkbox {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ns-form .wpcf7-checkbox .wpcf7-list-item {
  display: block;
  margin: 0;
}
.ns-form .wpcf7-checkbox label {
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--ns-hairline);
  border-radius: 11px;
  cursor: pointer;
  display: flex;
  font-size: 14px;
  gap: 12px;
  line-height: 1.43;
  padding: 13px 14px;
  transition:
    background-color 0.2s,
    border-color 0.2s;
}
.ns-form .wpcf7-checkbox label:hover {
  border-color: var(--ns-primary);
}
.ns-form .wpcf7-checkbox label:has(input:checked) {
  background: var(--ns-parchment);
  border-color: var(--ns-primary);
  box-shadow: inset 0 0 0 1px var(--ns-primary);
}
.ns-form .wpcf7-checkbox input {
  margin-top: 1px;
}

/* File upload card - the native input covers the card, so a click anywhere picks a file */
.ns-form .ns-form__file {
  align-items: center;
  background: var(--ns-parchment);
  border-radius: 11px;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  gap: 0 14px;
  margin: 0;
  padding: 16px;
  position: relative;
}
.ns-form .ns-form__file:focus-within {
  box-shadow: 0 0 0 2px var(--ns-primary);
}
.ns-form .ns-form__file-icon {
  align-items: center;
  background: #fff;
  border-radius: 9999px;
  color: var(--ns-primary);
  display: flex;
  flex: none;
  height: 40px;
  justify-content: center;
  width: 40px;
}
.ns-form .ns-form__file-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ns-form .ns-form__file-title {
  font-size: 14px;
  font-weight: 600;
}
.ns-form .ns-form__file-name {
  color: var(--ns-ink-48);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ns-form .ns-form__file.is-filled .ns-form__file-name {
  color: var(--ns-ink);
}
.ns-form .ns-form__file .wpcf7-form-control-wrap {
  flex-basis: 100%;
  position: static;
}
.ns-form .ns-form__file input[type="file"] {
  cursor: pointer;
  height: 100%;
  inset: 0;
  opacity: 0;
  position: absolute;
  width: 100%;
}

/* Consents + "Rozwiń" */
.ns-form .ns-form__consents {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ns-form .ns-form__more {
  color: var(--ns-ink-80);
  font-size: 12px;
  line-height: 1.45;
  margin-top: -4px;
  padding-left: 28px;
}
.ns-form .ns-form__more summary {
  color: var(--ns-primary);
  cursor: pointer;
  display: inline-block;
  list-style: none;
}
.ns-form .ns-form__more summary::-webkit-details-marker {
  display: none;
}
.ns-form .ns-form__more summary:hover {
  text-decoration: underline;
}
.ns-form .ns-form__more p {
  margin-top: 6px;
}
.ns-form .ns-form__more .ns-form__more-close,
.ns-form .ns-form__more[open] .ns-form__more-open {
  display: none;
}
.ns-form .ns-form__more[open] .ns-form__more-close {
  display: inline;
}

/* Submit */
.ns-form input.ns-form__submit {
  appearance: none;
  background: var(--ns-primary);
  border: 0;
  border-radius: 9999px;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 17px;
  font-weight: 500;
  height: auto;
  line-height: 1.2;
  margin: 0;
  min-height: 48px;
  padding: 14px 22px;
  transition: background-color 0.2s;
  width: 100%;
}
.ns-form input.ns-form__submit:hover {
  background: var(--ns-primary-hover);
}
.ns-form input.ns-form__submit:active {
  transform: scale(0.98);
}
.ns-form input.ns-form__submit:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.ns-form .wpcf7-spinner {
  align-self: center;
  margin: -6px 0 0;
}

/* CF7 validation and the response under the form */
.ns-form .wpcf7-not-valid-tip {
  color: var(--ns-error);
  font-size: 13px;
  font-weight: 400;
  margin-top: 4px;
}
.ns-form .wpcf7-not-valid {
  border-color: var(--ns-error);
}
.wpcf7-form:has(.ns-form) .wpcf7-response-output {
  border-radius: 11px;
  font-family: "Dosis", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.43;
  margin: 16px 0 0;
  padding: 12px 14px;
}
