@font-face {
  font-family: 'LucidaFax';
  src: url('/fonts/LucidaFax.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'LucidaFax';
  src: url('/fonts/LucidaFaxBold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

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

:root {
  --purple: #5C3570;
  --purple-dark: #4a2a5a;
  --purple-light: #f1eaf6;
  --white: #ffffff;
  --text: #1a1a1a;
  --text-muted: #555;
  --border: #ddd4ea;
  --error: #c0392b;
  --success: #2e7d32;
}

html {
  font-size: 16px;
}

body {
  font-family: 'LucidaFax', Georgia, serif;
  background: var(--white);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Event Header ─────────────────────────────────────────────────────────── */
.event-header {
  background: var(--purple);
  color: var(--white);
  position: relative;
  overflow: hidden;
  padding: 48px 32px 56px;
}

.event-header::before {
  /* decorative arch – echoes z2g architectural motif */
  content: '';
  position: absolute;
  bottom: -1px;
  left: 32px;
  width: 72px;
  height: 80px;
  background: var(--white);
  border-radius: 36px 36px 0 0;
}

.header-inner {
  max-width: 560px;
  margin: 0 auto;
  padding-left: 40px; /* clear of arch */
}

.company-name {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 16px;
}

.event-title {
  font-size: clamp(36px, 8vw, 56px);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 20px;
}

.event-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.event-meta p {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.4;
}

.event-meta .date {
  font-weight: 600;
  font-size: 16px;
  color: var(--white);
}

/* ── Form Section ─────────────────────────────────────────────────────────── */
.form-section {
  flex: 1;
  padding: 48px 32px 64px;
}

.form-inner {
  max-width: 560px;
  margin: 0 auto;
}

.form-inner h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.form-inner .form-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* ── Invitation text ──────────────────────────────────────────────────────── */
.invitation {
  margin-bottom: 40px;
  padding-bottom: 36px;
  border-bottom: 1px solid #ece6f3;
}

.invitation p {
  font-size: 15px;
  color: var(--purple);
  line-height: 1.7;
  margin-bottom: 14px;
}

.invitation p:last-child {
  margin-bottom: 0;
}

.invitation .greeting {
  font-weight: 700;
}

.invitation .deadline {
  font-weight: 700;
}

.invitation .signatures {
  margin-top: 20px;
}

/* ── Form Controls ────────────────────────────────────────────────────────── */
.field {
  margin-bottom: 20px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}

label .required {
  color: var(--purple);
  margin-left: 2px;
}

input[type="text"],
input[type="email"],
select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-family: 'LucidaFax', Georgia, serif;
  font-size: 15px;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(107, 63, 160, 0.12);
}

input[type="text"].error,
input[type="email"].error,
select.error {
  border-color: var(--error);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235C3570' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

/* ── Submit Button ────────────────────────────────────────────────────────── */
.submit-btn {
  width: 100%;
  padding: 14px 24px;
  background: var(--purple);
  color: var(--white);
  border: none;
  border-radius: 6px;
  font-family: 'LucidaFax', Georgia, serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  margin-top: 8px;
  letter-spacing: 0.2px;
}

.submit-btn:hover:not(:disabled) {
  background: var(--purple-dark);
}

.submit-btn:active:not(:disabled) {
  transform: scale(0.99);
}

.submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* ── Messages ─────────────────────────────────────────────────────────────── */
.message {
  border-radius: 6px;
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.5;
  margin-top: 20px;
  display: none;
}

.message.visible {
  display: block;
}

.message.success {
  background: #e8f5e9;
  color: var(--success);
  border: 1.5px solid #a5d6a7;
}

.message.error {
  background: #fdecea;
  color: var(--error);
  border: 1.5px solid #f5c6c2;
}

.message.success strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
}

/* ── Success State ────────────────────────────────────────────────────────── */
#form-container.hidden {
  display: none;
}

#success-view {
  display: none;
  text-align: center;
  padding: 16px 0;
}

#success-view.visible {
  display: block;
}

.success-icon {
  width: 56px;
  height: 56px;
  background: var(--purple-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.success-icon svg {
  color: var(--purple);
}

#success-view h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}

#success-view p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 24px 32px;
  font-size: 12px;
  color: #aaa;
  border-top: 1px solid #f0f0f0;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 520px) {
  .event-header {
    padding: 36px 24px 48px;
  }

  .header-inner {
    padding-left: 0;
    padding-top: 12px;
  }

  .event-header::before {
    left: auto;
    right: 24px;
    width: 56px;
    height: 64px;
    border-radius: 28px 28px 0 0;
  }

  .form-section {
    padding: 36px 24px 48px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }
}
