/* event-form.css — PUDE Event Form */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

:root {
  --bg:        #080c0b;
  --surface:   #111714;
  --surface2:  #182019;
  --border:    rgba(255,255,255,.08);
  --green:     #3aaa8c;
  --green-dim: rgba(58,170,140,.12);
  --text:      #e8eceb;
  --text-dim:  rgba(232,236,235,.55);
  --error:     #f87171;
  --radius:    14px;
  --font-sans: 'DM Sans', sans-serif;
  --font-display: 'Outfit', sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  min-height: 100vh;
}

/* ── Header ── */
.ef-header {
  background: rgba(8,12,11,.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.ef-header__inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ef-header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ef-header__logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.ef-header__name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 2px;
  color: var(--text);
}

.ef-header__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Main ── */
.ef-main {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ── Success state ── */
.ef-success {
  text-align: center;
  padding: 80px 24px;
}

.ef-success__icon { font-size: 48px; margin-bottom: 20px; }

.ef-success__title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 12px;
}

.ef-success__text {
  color: var(--text-dim);
  margin-bottom: 28px;
}

/* ── Form ── */
.ef-form {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ── Fieldset ── */
.ef-fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ef-fieldset__legend {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--green);
  padding: 0 10px;
}

/* ── Row ── */
.ef-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Field ── */
.ef-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.ef-field--full {
  grid-column: 1 / -1;
}

/* ── Label ── */
.ef-label {
  font-size: 13px;
  font-weight: 700;
  color: rgba(232,236,235,.80);
  letter-spacing: 0.2px;
}

.ef-req { color: var(--green); }

/* ── Input ── */
.ef-input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px !important;
  padding: 11px 14px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
  width: 100%;
}

.ef-input::placeholder { color: rgba(138,163,154,.45); }

.ef-input:focus {
  border-color: rgba(58,170,140,.5);
  box-shadow: 0 0 0 3px rgba(58,170,140,.10);
}

.ef-input.is-invalid {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(248,113,113,.10);
}

.ef-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238aa39a' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.ef-select option { background: #182019; color: var(--text); }

.ef-textarea { resize: vertical; min-height: 100px; }

/* Fix date/time input icon color */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(0.6);
  cursor: pointer;
}

/* ── Radio group ── */
.ef-radio-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.ef-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px !important;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px !important;
  cursor: pointer;
  font-size: 13px !important;
  font-weight: 600;
  line-height: 1 !important;
  transition: border-color .15s, background .15s;
  user-select: none;
}

.ef-radio:has(input:checked) {
  border-color: var(--green);
  background: var(--green-dim);
  color: var(--green);
}

.ef-radio input[type="radio"] {
  appearance: none;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  transition: border-color .15s, background .15s;
}

.ef-radio:has(input:checked) input[type="radio"] {
  border-color: var(--green);
  background: var(--green);
  box-shadow: inset 0 0 0 3px var(--surface2);
}

/* ── Error message ── */
.ef-error {
  font-size: 12px;
  color: var(--error);
  min-height: 16px;
  display: block;
}

/* Don't let empty error spans consume space in the layout */
.ef-error:empty {
  display: none;
}

.ef-error-global {
  text-align: center;
  padding: 14px;
  background: rgba(248,113,113,.10);
  border: 1px solid rgba(248,113,113,.25);
  border-radius: 10px;
  color: var(--error);
  font-size: 14px;
}

/* ── Actions ── */
.ef-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 8px;
}

/* ── Buttons ── */
.ef-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: filter .18s, transform .18s, opacity .18s;
}

.ef-btn:active { transform: scale(.97); }

.ef-btn--primary {
  background: var(--green);
  color: #fff;
}

.ef-btn--primary:hover { filter: brightness(1.12); }
.ef-btn--primary:disabled { opacity: .5; cursor: not-allowed; }

.ef-btn--outline {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.ef-btn--outline:hover {
  border-color: rgba(255,255,255,.2);
  color: var(--text);
}

/* ── File input ── */
.ef-field--full {
  grid-column: 1 / -1;
}

.ef-file-input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Main image: wrapper establishes the stacking context */
.ef-file-wrap {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
}

.ef-file-label {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px 18px;
  border: 2px dashed rgba(58,170,140,.45);
  border-radius: 10px;
  background: rgba(58,170,140,.05);
  color: rgba(232,236,235,.35);
  font-size: .85rem;
  cursor: pointer;
  transition: border-color .2s, background .2s, color .2s;
  position: relative;
  z-index: 0;
}
.ef-file-label:hover {
  border-color: rgba(58,170,140,.4);
  background: rgba(58,170,140,.05);
  color: var(--text-dim);
}
.ef-file-label.has-file {
  border-style: solid;
  border-color: rgba(58,170,140,.5);
  color: var(--text);
}

.ef-file-icon { font-size: 1rem; flex-shrink: 0; opacity: .5; }
.ef-file-label.has-file .ef-file-icon { opacity: 1; }

/* Preview — overlays the label absolutely */
.ef-img-preview {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid rgba(58,170,140,.5);
}
.ef-img-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ef-img-remove {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(0,0,0,.65);
  border: none;
  color: #fff;
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: .85rem;
  line-height: 28px;
  text-align: center;
  transition: background .2s;
  z-index: 2;
}
.ef-img-remove:hover { background: #c0392b; }

/* ── Extra images grid ── */
.ef-hint {
  font-weight: 400;
  font-size: .75rem;
  color: var(--text-dim);
  margin-left: 6px;
}

.ef-extra-imgs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 4px;
}

.ef-extra-slot {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
}

/* Invisible spacer so aspect-ratio resolves the slot height */
.ef-extra-sizer {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  visibility: hidden;
  pointer-events: none;
}

.ef-extra-slot .ef-file-input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

.ef-extra-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 2px dashed rgba(58,170,140,.35);
  border-radius: 10px;
  background: rgba(58,170,140,.04);
  color: rgba(232,236,235,.4);
  font-size: .72rem;
  cursor: pointer;
  transition: border-color .2s, background .2s, color .2s;
  text-align: center;
  z-index: 0;
}
.ef-extra-label:hover {
  border-color: rgba(58,170,140,.55);
  background: rgba(58,170,140,.09);
  color: var(--text-dim);
}
.ef-extra-label.has-file {
  border-style: solid;
  border-color: rgba(58,170,140,.55);
  color: var(--text);
}
.ef-extra-plus {
  font-size: 1.6rem;
  line-height: 1;
  font-weight: 300;
}
.ef-extra-label.has-file .ef-extra-plus { display: none; }
.ef-extra-num {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.ef-extra-preview {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid rgba(58,170,140,.55);
}
.ef-extra-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 480px) {
  .ef-extra-imgs { grid-template-columns: repeat(3, 1fr); }
}

/* ── T&C checkbox row ── */
.ef-tc-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.ef-tc-label {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  font-size: .9rem;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}

.ef-tc-label > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1;
}

/* Hide native checkbox, use a custom one */
.ef-tc-check {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  flex-shrink: 0;
  flex-basis: 20px;
  margin: 0;          /* kill browser default margins */
  padding: 0;
  align-self: center;
  border: 2px solid rgba(58,170,140,.5);
  border-radius: 5px;
  background: var(--surface2);
  cursor: pointer;
  position: relative;
  transition: border-color .15s, background .15s;
}
.ef-tc-check:hover {
  border-color: var(--green);
}
.ef-tc-check:checked {
  background: var(--green);
  border-color: var(--green);
}
.ef-tc-check:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 6px;
  height: 10px;
  border: 2px solid #080c0b;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.ef-tc-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--green);
  font-size: .9rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .15s;
}
.ef-tc-link:hover { color: var(--text); }

/* ── Modal ── */
.ef-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.8);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.ef-modal-backdrop[hidden] { display: none; }

.ef-modal {
  background: var(--surface);
  border: 1px solid rgba(58,170,140,.2);
  border-radius: 14px;
  width: 100%;
  max-width: 640px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 32px 80px rgba(0,0,0,.7), 0 0 0 1px rgba(58,170,140,.06);
}

.ef-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.ef-modal__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.ef-modal__close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.ef-modal__close:hover {
  background: rgba(255,255,255,.07);
  color: var(--text);
}

.ef-modal__body {
  overflow-y: auto;
  padding: 22px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: .88rem;
  line-height: 1.7;
  color: var(--text-dim);

  /* Custom scrollbar — Webkit */
  scrollbar-width: thin;
  scrollbar-color: rgba(58,170,140,.4) transparent;
}
.ef-modal__body::-webkit-scrollbar {
  width: 6px;
}
.ef-modal__body::-webkit-scrollbar-track {
  background: var(--surface2);
  border-radius: 10px;
}
.ef-modal__body::-webkit-scrollbar-thumb {
  background: rgba(58,170,140,.4);
  border-radius: 10px;
}
.ef-modal__body::-webkit-scrollbar-thumb:hover {
  background: rgba(58,170,140,.7);
}

.ef-modal__body p strong { color: var(--text); }

.ef-modal__footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
  background: var(--surface2);
  border-radius: 0 0 14px 14px;
}

/* ── Upload progress bar ── */
.ef-progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
}

.ef-progress-track {
  flex: 1;
  height: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.ef-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--green);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.ef-progress-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
  min-width: 80px;
  text-align: right;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .ef-row { grid-template-columns: 1fr; }
  .ef-fieldset { padding: 20px 16px; }
  .ef-main { padding: 24px 16px 60px; }
  .ef-actions { flex-direction: column-reverse; }
  .ef-btn { justify-content: center; }
  .ef-modal { max-height: 90vh; border-radius: 10px; }
  .ef-modal__header, .ef-modal__body, .ef-modal__footer { padding-left: 16px; padding-right: 16px; }
  .ef-tc-row { padding: 16px; }
}
