:root {
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.1);
  --radius: 8px;
  --radius-lg: 12px;
}

main {
  position: relative;
}

main::before,
main::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 1024px;
  background-image: url("../images/submit-light.png");
  background-size: cover;
  pointer-events: none;
  z-index: -1;
}

main::before {
  top: 0;
}

main::after {
  bottom: -70px;
  transform: rotate(-180deg);
}

@media screen and (max-width: 768px) {
  main::after {
    bottom: -155px;
  }
}

#particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 600px;
  pointer-events: none;
  z-index: -1;
}

.submission-section {
  padding-bottom: 10rem;
}

.submission-section form {
  padding-top: 3rem;
}

.form-card {
  margin-inline: auto;
  background: transparent;
  backdrop-filter: blur(19px);
  border-radius: 1rem;
  padding: 2.25rem 2rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(15, 23, 42, 0.9);

  color: var(--light);
  width: 100%;
  max-width: 700px;
}

.input-hint {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

.preview-text {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.form-section {
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  padding-bottom: 2rem;
  margin-bottom: 2rem;
}

.form-section:last-of-type {
  border-bottom: none;
  padding-bottom: 1rem;
}

.form-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.form-row--2 .form-group {
  flex: 1;
}

.form-row--2 {
  display: flex;
  gap: 1rem;
}

.form-section-title {
  color: var(--light);
  font-size: var(--font-p);
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 1rem;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
select,
textarea {
  width: 100%;
  border-radius: 0.875rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background-color: rgba(15, 23, 42, 0.5);
  color: var(--light);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  line-height: 1.5;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 1),
    0 10px 30px rgba(15, 23, 42, 0.7);
  font: inherit;
}

textarea {
  min-height: 7rem;
  resize: vertical;
}

select,
input[list] {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.75rem;
  background-image: url("data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M5 7.5L10 12.5L15 7.5' stroke='%23E5E7EB' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 16px 16px;
}

select::-ms-expand,
input[list]::-ms-expand {
  display: none;
}

input[list]::-webkit-calendar-picker-indicator {
  opacity: 0;
  display: none;
  width: 0;
  height: 0;
  pointer-events: none;
}

input[list]:focus::-webkit-calendar-picker-indicator {
  opacity: 0;
}
input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="url"]::placeholder,
input[type="password"]::placeholder {
  color: rgba(255, 255, 255, 0.4);
  opacity: 1;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(26, 26, 26, 0.1);
}

.file-upload {
  border: 1px dashed rgba(148, 163, 184, 0.4);
  border-radius: 0.875rem;
  padding: 1.25rem 1.5rem;
  text-align: center;
  background: radial-gradient(
    circle at top left,
    rgba(15, 23, 42, 0.9),
    rgba(15, 23, 42, 0.7)
  );
  color: var(--light);
  box-shadow:
    0 18px 60px rgba(15, 23, 42, 0.8),
    0 0 0 1px rgba(15, 23, 42, 1);
}

.file-upload p {
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  color: rgba(226, 232, 240, 0.86);
}

.file-upload input[type="file"] {
  color: rgba(226, 232, 240, 0.9);
  font-size: 0.9rem;
}

.file-upload input[type="file"]::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.55rem 1.25rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.95);
  color: rgba(248, 250, 252, 0.96);
  cursor: pointer;
  font-weight: 500;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    transform 0.1s ease;
}

.file-upload input[type="file"]::file-selector-button:hover {
  background: rgba(15, 23, 42, 1);
  border-color: rgba(148, 163, 184, 0.85);
}

.file-upload input[type="file"]::file-selector-button:active {
  transform: scale(0.97);
}

/* Dynamic Rows */
.member-row,
.link-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  align-items: center;
}

.group-members {
  display: none;
  margin-top: 1.5rem;
  padding: 1.5rem;
}

.group-members.visible {
  display: block;
}

.member-row {
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.member-row .form-row--2 {
  width: 100%;
  align-items: center;
}

/* inputs fill remaining space */
.member-row .form-row--2 input {
  flex: 1 1 0;
  min-width: 0;
}

.member-row .form-row--2 .btn-remove {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;

  display: flex;
  align-items: center;
  justify-content: center;
}

.member-row input[type="email"] {
  flex: 0 0 calc(100% - 32px - 1rem);
  min-width: 0;
}

.link-row input:first-child {
  flex: 0 0 180px;
}

.link-row input:nth-child(2) {
  flex: 1;
}

/* Remove link (trash icon) */
.btn-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(148, 163, 184, 0.8);
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.1s ease;
}

.btn-remove:hover {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(239, 68, 68, 0.7);
  color: #fca5a5;
}

.btn-remove:active {
  transform: scale(0.96);
}

.btn-add-link {
  background: none;
  border: none;
  color: var(--color-primary);
  cursor: pointer;
  padding: 0.5rem 0;
  font-size: 0.95rem;
}

.btn-add-link:hover {
  text-decoration: underline;
}

button {
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

button#submit_form_button {
  display: block;
  margin-left: auto;
}

/* Alerts */
.alert {
  font-weight: 500;
  text-align: left;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.alert-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.alert-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

/* SUBMITTED */
main.submitted {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  overflow: hidden;
}

body.page-submitted {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

body.page-submitted footer {
  margin-top: auto;
}

.submitted-section {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: min-content;
  padding-block: 4rem;
  overflow: hidden;
}

.submitted-section h1 {
  margin-bottom: 1.2rem;
}

.submitted-section p {
  max-width: 600px;
}

.submitted-section .btn-group {
  margin-top: 2rem;
}

/* ── Custom Autocomplete ─────────────────────────────── */
.autocomplete-wrapper {
  position: relative;
  width: 100%;
}

.autocomplete-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 100;
  list-style: none;
  margin: 0;
  padding: 0.4rem;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 0.75rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  max-height: 280px;
  overflow-y: auto;
}

.autocomplete-dropdown.is-open {
  display: block;
}

.autocomplete-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.6rem 0.85rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.autocomplete-item:hover,
.autocomplete-item.is-active {
  background: rgba(148, 163, 184, 0.1);
}

.autocomplete-item__name {
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(248, 250, 252, 0.95);
}

.autocomplete-item__email {
  font-size: 0.78rem;
  color: rgba(148, 163, 184, 0.8);
}

.autocomplete-selected-hint {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: rgba(148, 163, 184, 0.9);
  padding-left: 0.25rem;
}

.form-card.peer-nominee h2 {
  font-size: var(--font-h3);
  margin-bottom: 2rem;
}

.form-card.peer-nominee ul {
  padding-left: 2rem;
  margin-bottom: 3rem;
}
