/*
 * Styles of the public site: the KOWR entry form (templates/contest.form.html.twig and the
 * form theme in templates/form/submission_theme.html.twig). Ported from the client's mock-up.
 */

:root {
  --kowr-green: #a5c727;
  --kowr-dark: #16300a;
  --kowr-action: #147d35;
  --kowr-action-hover: #0f6429;
  --kowr-required: #7f2c0e;
  --kowr-divider: #ddebc8;
  --kowr-placeholder: #9cb08c;
  --kowr-muted: #B9BCB6;
  --kowr-white: #ffffff;
  --kowr-panel-width: 67.5rem;
  --kowr-panel-inner: 59.875rem;
  --kowr-panel-padding-inline: 3.8125rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
}

body {
  min-width: 20rem;
  margin: 0;
  color: var(--kowr-dark);
  background-color: #edf6ea;
  background-image: url("../images/bg-J9Y5QLy.svg");
  background-repeat: no-repeat;
  background-position: top center;
  background-size: cover;
  background-attachment: fixed;
  font-family: "poppins", Arial, sans-serif;
  font-size: 1rem;
  padding-bottom: 10rem;
}

button,
input,
select,
textarea {
  font: inherit;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--kowr-white);
  background: var(--kowr-dark);
  border-radius: 0.375rem;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
}

.page-shell {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.page-header {
  width: min(var(--kowr-panel-width), calc(100% - 2rem));
  padding-inline: var(--kowr-panel-padding-inline);
  text-align: center;
  text-transform: uppercase;
  margin: 3.5rem auto 1rem auto;
}

.page-kicker,
.page-title {
  margin: 0;
  color: var(--kowr-dark);
  font-family: "komet", "Arial Narrow", sans-serif;
  font-weight: 300;
  text-align: left;
}

/* Logo on the left, the way back on the right, above the page title */
.page-brand {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin: 0;
  padding-left: 0.25rem;
}

.page-header:has(.page-title) .page-brand {
  margin-bottom: 1.5rem;
}

.page-logo {
  display: block;
  width: auto;
  height: 3rem;
}

.page-back {
  margin: 0;
  font-size: 0.875rem;
  letter-spacing: 0.125rem;
  text-align: left;
}

.page-back a {
  color: var(--kowr-dark);
  text-decoration: none;
}

.page-back a:hover,
.page-back a:focus-visible {
  text-decoration: underline;
}

.page-kicker {
  font-size: 1.25rem;
  line-height: 2rem;
  letter-spacing: 0.625rem;
  padding-left: 0.25rem;
}

.page-title {
  font-size: 3rem;
  line-height: 4.16rem;
  letter-spacing: 0.3125rem;
}

.form-stage {
  display: flex;
  justify-content: center;
  width: 100%;
}

.form-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(var(--kowr-panel-width), calc(100% - 2rem));
  min-height: 40rem;
  margin: 0;
  padding: 0 var(--kowr-panel-padding-inline) 2.1875rem;
  background: var(--kowr-green);
  border-radius: 2rem;
}

.section-title {
  flex: 0 0 auto;
  margin: 0 0 1rem 0;
  color: var(--kowr-dark);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.5rem;
  text-transform: uppercase;
}

.form-content {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 0;
}

.form-note {
  margin: 0;
  color: var(--kowr-white);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.25rem;
}

.panel-rule {
  width: 100%;
  height: 0.0625rem;
  margin: 0;
  color: var(--kowr-divider);
  background: var(--kowr-divider);
  border: 0;
  opacity: 1;
}

.form-label,
.form-legend {
  display: block;
  margin: 0 0 0.4375rem;
  color: var(--kowr-dark);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.25rem;
}

.form-legend {
  float: none;
  width: auto;
  padding: 0;
}

.required-marker {
  color: var(--kowr-required);
}

.form-control,
.form-select {
  height: 3.625rem;
  min-height: 3.625rem;
  padding: 1rem 1.1875rem;
  color: #080808;
  background-color: var(--kowr-white);
  /* border: 0.0625rem solid var(--kowr-divider); */
  border: 0;
  border-radius: 0.625rem;
  font-size: 1.0625rem;
  line-height: 1.5rem;
  box-shadow: none;
}

.form-control::placeholder {
  color: var(--kowr-placeholder);
  opacity: 1;
}

.form-control:focus,
.form-select:focus {
  color: #080808;
  background-color: var(--kowr-white);
  border-color: var(--kowr-dark);
  box-shadow: 0 0 0 0.1875rem rgba(22, 48, 10, 0.28);
}

.two-column-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 27.125rem));
  justify-content: space-between;
  column-gap: 5.625rem;
}

.field-grid {
  row-gap: 0.875rem;
}

.form-group {
  min-width: 0;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 27rem));
  justify-content: space-between;
  column-gap: 5.875rem;
}

.choice-card {
  position: relative;
  display: flex;
  min-height: 5.1875rem;
  align-items: center;
  gap: 1.625rem;
  padding: 0.875rem 1.75rem;
  color: #080808;
  background: var(--kowr-white);
  border: 0.0625rem solid transparent;
  border-radius: 0.5625rem;
  cursor: pointer;
}

.choice-input {
  position: absolute;
  width: 0.0625rem;
  height: 0.0625rem;
  opacity: 0;
}

.choice-card:focus-within {
  border-color: var(--kowr-dark);
  outline: 0.1875rem solid rgba(22, 48, 10, 0.28);
  outline-offset: 0.1875rem;
}

.choice-indicator {
  position: relative;
  flex: 0 0 1.3125rem;
  width: 1.3125rem;
  height: 1.3125rem;
}

.choice-indicator img {
  position: absolute;
  inset: 0;
  display: block;
}

.choice-input:checked ~ .choice-indicator .radio-empty,
.choice-input:not(:checked) ~ .choice-indicator .radio-selected {
  display: none;
}

.choice-copy {
  display: flex;
  flex-direction: column;
  font-size: 0.625rem;
  line-height: 0.875rem;
}

.choice-copy strong {
  font-size: 0.9375rem;
  line-height: 1.25rem;
}

.dropzone {
  position: relative;
  display: flex;
  width: 27rem;
  height: 5.1875rem;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #080808;
  background: var(--kowr-white);
  border: 0.125rem dashed #000000;
  border-radius: 0.5625rem;
  cursor: pointer;
}

.dropzone--wide {
  width: 59.875rem;
}

.dropzone-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem;
  text-align: center;
}

.dropzone-action {
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.25rem;
}

.dropzone-hint {
  margin-top: 0.3125rem;
  color: var(--kowr-muted);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1rem;
  text-transform: uppercase;
}

.dropzone:focus-within,
.dropzone.is-dragover {
  outline: 0.1875rem solid var(--kowr-dark);
  outline-offset: 0.1875rem;
}

.textarea-wrap {
  position: relative;
}

/* One line high like the inputs, growing with the text where field-sizing is supported; the counter sits on the right of the first line. */
.summary-textarea {
  display: block;
  height: auto;
  padding: 1rem 10rem 1rem 1.1875rem;
  field-sizing: content;
  resize: vertical;
}

.character-count {
  position: absolute;
  right: 0.75rem;
  bottom: 1.3125rem;
  margin: 0;
  color: #080808;
  font-size: 0.75rem;
  line-height: 1rem;
}

.form-check {
  min-height: 1.9375rem;
  margin: 0;
  padding-left: 3.4375rem;
}

.form-check .form-check-input {
  width: 2rem;
  height: 1.9375rem;
  margin-top: 0;
  background-color: var(--kowr-white);
  border: 0.0625rem solid var(--kowr-white);
  border-radius: 0;
  margin-left: -3.4375rem;
}

.form-check-input:checked {
  background-color: var(--kowr-action);
  border-color: var(--kowr-action);
}

.form-check-input:focus {
  border-color: var(--kowr-dark);
  box-shadow: 0 0 0 0.1875rem rgba(22, 48, 10, 0.28);
}

.form-check-label {
  color: var(--kowr-dark);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.9375rem;
}

.primary-submit,
.next-button,
.back-button {
  color: var(--kowr-white);
  background: var(--kowr-action);
  border: 0;
  font-weight: 700;
  text-decoration: none;
}

.primary-submit:hover,
.primary-submit:focus-visible,
.next-button:hover,
.next-button:focus-visible,
.back-button:hover,
.back-button:focus-visible {
  color: var(--kowr-white);
  background: var(--kowr-action-hover);
}

.primary-submit:focus-visible,
.next-button:focus-visible,
.back-button:focus-visible {
  outline: 0.1875rem solid var(--kowr-dark);
  outline-offset: 0.1875rem;
}

.primary-submit {
  display: flex;
  width: 100%;
  min-height: 3.625rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.5625rem;
  font-size: 1rem;
  letter-spacing: 0.3125rem;
}

.form-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  margin-top: 1rem;
}

.form-actions--with-back {
  justify-content: space-between;
}

.next-button,
.back-button {
  display: inline-flex;
  width: auto;
  min-height: 4rem;
  padding: 0 1.5rem 0 2.5rem;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 6.25rem;
  font-size: 1rem;
  letter-spacing: 0.3125rem;
}

.back-button {
  padding: 0 1.25rem 0 1.5rem;
  gap: 0.5rem;
  opacity: 0.7;
}

.next-button img,
.back-button img {
  display: block;
}

.next-button img {
  transform: rotate(-90deg);
}

.back-button img {
  transform: rotate(90deg);
}

.form-status {
  margin: 0.75rem 0 0;
  color: var(--kowr-dark);
  font-size: 0.875rem;
  font-weight: 700;
  text-align: center;
}

/* Success modal */
.kowr-success-modal .modal-dialog {
  max-width: 45.5rem;
}

.kowr-success-modal .modal-content {
  overflow: hidden;
  background: var(--kowr-white);
  border: 0;
  border-radius: 0.625rem;
}

.kowr-success-modal .modal-body {
  display: flex;
  min-height: 19.5rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.875rem;
  padding: 5rem 7.5rem 6.875rem;
}

.success-modal-icon {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 0.625rem;
  background: #5fa524;
  border-radius: 6.25rem;
}

.success-modal-icon img {
  display: block;
}

.success-modal-title {
  margin: 0;
  color: var(--kowr-dark);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  text-transform: uppercase;
}

/* Progress of the flow, edge to edge of the panel; the fields below keep the panel padding */
.progress-steps {
  margin: 0 calc(var(--kowr-panel-padding-inline) * -1) 2rem;
  padding: 2.25rem 1.5rem 0;
}

.progress-summary {
  margin: 0 0 0.5rem;
  color: var(--kowr-dark);
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.125rem;
}

.progress-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.progress-item {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
  color: var(--kowr-dark);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1rem;
  text-transform: uppercase;
}

.progress-item::before {
  content: "";
  display: block;
  height: 0.375rem;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 0.1875rem;
}

.progress-item--done::before,
.progress-item--current::before {
  background: var(--kowr-action);
}

.progress-item--todo {
  opacity: 0.65;
}

.progress-index {
  display: none;
}

.progress-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Field helpers */
.form-help {
  margin: 0.375rem 0 0;
  color: var(--kowr-dark);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1rem;
  opacity: 0.85;
}

.form-static {
  margin: 0;
  padding: 1rem 1.1875rem;
  color: #080808;
  background: var(--kowr-white);
  border-radius: 0.625rem;
  font-size: 1.0625rem;
  line-height: 1.5rem;
}

.character-count--limit {
  color: var(--kowr-required);
  font-weight: 700;
}

.dropzone-shell {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.dropzone-clear {
  align-self: flex-start;
  padding: 0;
  color: var(--kowr-dark);
  background: none;
  border: 0;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: underline;
}

.form-group + .form-group,
.details-grid > * + *,
.summary-fields > * + * {
  margin-top: 1rem;
}

.two-column-grid > .form-group + .form-group {
  margin-top: 0;
}

.two-column-grid {
  row-gap: 1rem;
}

/* Common step layout */
.form-panel .form-note {
  margin-top: 0;
}

.form-panel .panel-rule--top {
  margin-top: 1.25rem;
  margin-bottom: 2rem;
}

.form-panel .panel-rule--bottom {
  margin-top: 3rem;
}

.category-group,
.authors-group,
.co-authors-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.details-grid {
  margin-top: 1.5rem;
}

.upload-grid {
  margin-top: 1rem;
}

/* The checkbox sits level with the drop zone it reveals */
.illustration-toggle {
  align-self: center;
}

.co-authors-group {
  margin-top: 2rem;
}

.form-panel .consent-intro {
  margin: 2.5rem 0 1.75rem;
}

.consent-list {
  display: grid;
  row-gap: 1.75rem;
}

.consent-list .form-check-label {
  line-height: 1.4;
}

/* Separates the optional promotional consent from the required declarations above it */
.form-panel .consent-rule {
  margin: 2rem 0;
}

.submit-area {
  margin-top: 2.5rem;
}

.submit-note {
  margin: 0.375rem 0 0;
  color: var(--kowr-dark);
  font-size: 0.875rem;
  font-style: italic;
  font-weight: 300;
  text-align: center;
}

/* Footer and notice pages */
.page-footer {
  width: min(var(--kowr-panel-width), calc(100% - 2rem));
  margin: 1.5rem auto 0;
  padding-inline: var(--kowr-panel-padding-inline);
  color: var(--kowr-dark);
  font-size: 0.875rem;
  text-align: center;
}

.page-footer p {
  margin: 0 0 0.5rem;
}

.page-footer a {
  color: var(--kowr-dark);
  font-weight: 700;
}

/* The organiser on the left, the documents on the right, under the contact line */
.footer-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 0.0625rem solid var(--kowr-divider);
}

.footer-organiser {
  text-align: left;
}

.footer-links {
  flex: 0 0 auto;
  text-align: right;
}

.form-panel--notice {
  min-height: 0;
  justify-content: center;
  padding-top: 3.4375rem;
  text-align: center;
}

.notice-text {
  margin: 0.5rem 0 0;
  color: var(--kowr-dark);
  font-size: 1.125rem;
}

/* Closing sentence on /after: larger and bold, with the panel's own top and bottom padding matched. */
.notice-lead {
  color: var(--kowr-dark);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.45;
}

.form-panel--notice:has(.notice-lead) {
  padding-bottom: 3.4375rem;
}

/* Server-side validation feedback (Symfony form errors) */
.form-alert {
  margin: 0 0 1.5rem;
  padding: 1rem 1.25rem;
  color: var(--kowr-white);
  background: var(--kowr-required);
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 700;
}

.form-alert p {
  margin: 0;
}

.form-alert p + p {
  margin-top: 0.5rem;
}

.invalid-feedback {
  margin-top: 0.375rem;
  color: var(--kowr-required);
  font-size: 0.8125rem;
  font-weight: 700;
}

.form-control.is-invalid,
.form-select.is-invalid,
.was-validated .form-control:invalid,
.was-validated .form-select:invalid {
  border: 0.125rem solid var(--kowr-required);
  background-image: none;
}

.dropzone:has(.is-invalid),
.was-validated .dropzone:has(:invalid),
.choice-card:has(.is-invalid),
.was-validated .choice-card:has(:invalid) {
  border-color: var(--kowr-required);
}

.success-modal-reference {
  margin: 0;
  color: var(--kowr-dark);
  font-size: 1rem;
  text-align: center;
}

@media (max-width: 74.99rem) {
  .page-title {
    font-size: 2.5rem;
    line-height: 3.5rem;
  }
}

@media (max-width: 61.99rem) {
  :root {
    --kowr-panel-padding-inline: 2rem;
  }

  .page-shell {
    min-height: 100vh;
    overflow: hidden auto;
    padding-bottom: 4rem;
  }

  .page-header {
    position: relative;
    top: auto;
    padding: 2rem var(--kowr-panel-padding-inline) 0;
  }

  .page-kicker {
    font-size: 1rem;
    letter-spacing: 0.45rem;
  }

  .page-title {
    font-size: 2.25rem;
    line-height: 3rem;
  }

  .form-stage {
    padding-top: 1.5rem;
  }

  .form-panel {
    min-height: 0;
    padding: 0 var(--kowr-panel-padding-inline) 2.5rem;
    border-radius: 1.5rem;
  }

  .form-panel--notice {
    padding-top: 2.5rem;
  }

  .form-panel--notice:has(.notice-lead) {
    padding-bottom: 2.5rem;
  }

  .two-column-grid,
  .choice-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }

  .progress-steps {
    padding-inline: 1rem;
  }

  .consent-list {
    row-gap: 1.5rem;
  }

  .dropzone,
  .dropzone--wide {
    width: 100%;
  }

  .form-actions {
    margin-top: 2.5rem;
  }
}

@media (max-width: 35.99rem) {
  :root {
    --kowr-panel-padding-inline: 1rem;
  }

  .page-header {
    padding: 1.5rem var(--kowr-panel-padding-inline) 0;
  }

  .page-kicker {
    font-size: 0.75rem;
    line-height: 1.5rem;
    letter-spacing: 0.25rem;
  }

  .page-title {
    font-size: 1.75rem;
    line-height: 2.375rem;
    letter-spacing: 0.15625rem;
  }

  .form-stage {
    padding-top: 1rem;
  }

  .form-panel {
    width: calc(100% - 1rem);
    padding: 0 var(--kowr-panel-padding-inline) 1.75rem;
    border-radius: 1rem;
  }

  .form-panel--notice {
    padding-top: 1.75rem;
  }

  .form-panel--notice:has(.notice-lead) {
    padding-bottom: 1.75rem;
  }

  .section-title {
    font-size: 1.0625rem;
  }

  .form-control,
  .form-select {
    height: 3.25rem;
    min-height: 3.25rem;
    padding: 0.75rem 0.875rem;
    font-size: 1rem;
  }

  /* Too narrow for the counter beside the text: it moves below the last line. */
  .summary-textarea {
    height: auto;
    padding-right: 1rem;
    padding-bottom: 1.5rem;
  }

  .character-count {
    bottom: 0.375rem;
  }

  .choice-card {
    padding-inline: 1rem;
  }

  .dropzone-action {
    font-size: 0.8125rem;
  }

  .dropzone-hint {
    font-size: 0.625rem;
  }

  .form-check {
    padding-left: 2.75rem;
  }

  .form-check .form-check-input {
    margin-left: -2.75rem;
  }

  .form-check-label {
    line-height: 1.4rem;
  }

  .primary-submit {
    padding-inline: 1rem;
    font-size: 0.875rem;
    letter-spacing: 0.1875rem;
  }

  .kowr-success-modal .modal-dialog {
    margin-inline: 0.5rem;
  }

  .kowr-success-modal .modal-body {
    min-height: 19.5rem;
    padding: 3rem 1.5rem;
  }

  .page-brand,
  .footer-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-links {
    text-align: left;
  }

  .form-actions,
  .form-actions--with-back {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 1rem;
  }

  .next-button,
  .back-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
