/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  --color-bg: #f7f6f2;
  --color-surface: #ffffff;
  --color-border: #d4d1ca;
  --color-text: #28251d;
  --color-text-muted: #7a7974;
  --color-primary: #a12c2c;
  --color-primary-hover: #822222;
  --color-accent: #ffd700;
  --color-success: #2d7a22;
  --color-success-bg: #edf7eb;
  --color-error: #a12c2c;
  --color-error-bg: #fdf2f2;
  --color-divider: #dcd9d5;
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --font-body: "Inter", "Helvetica Neue", sans-serif;
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

input,
button {
  font: inherit;
  color: inherit;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input {
  transition:
    color var(--transition),
    background var(--transition),
    border-color var(--transition),
    box-shadow var(--transition);
}
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.hidden {
  display: none !important;
}

/* ── Backdrop & Layout ──────────────────────────────────────── */
.event-form-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10001;
  pointer-events: auto;
}

.event-form-layout {
  flex: 1;
  display: grid;
  place-items: center;
  padding: var(--space-4);
  width: 100%;
  animation: fadeIn 300ms ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes fadeOutBg {
  from {
    background-color: rgba(0, 0, 0, 0.5);
  }
  to {
    background-color: rgba(0, 0, 0, 0);
  }
}
@keyframes popup-out {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.92);
  }
}

.event-form-wrapper.leaving {
  animation: fadeOutBg 250ms ease forwards;
}
.event-form-wrapper.leaving .card {
  animation: popup-out 250ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  width: 95%;
  max-width: 500px;
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
}

.card-banner {
  width: 100%;
  height: 150px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}
.card-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}
.card-banner-txt {
  color: rgb(255, 255, 255);
  font-weight: 700;
  font-size: 18px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

@media (min-width: 410px) {
  .card-banner-txt {
    font-size: 21px;
  }
}
@media (min-width: 500px) {
  .card-banner-txt {
    font-size: 24px;
  }
}
@media (min-width: 600px) {
  .card-banner-txt {
    font-size: 18px;
  }
}
@media (min-width: 1024px) {
  .card-banner-txt {
    font-size: 20px;
  }
}
.card-content-wrapper {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex: 1;
}

@media (min-width: 600px) {
  .card {
    max-width: 800px;
    flex-direction: row;
    align-items: stretch;
  }
  .card-banner {
    width: 45%;
    height: auto;
  }
  .card-content-wrapper {
    width: 55%;
  }
}

.card-header {
  padding: var(--space-5) var(--space-5) 0 var(--space-5);
}
.card-header h1 {
  color: var(--ukraine-blue);
  text-align: center;

  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 var(--space-2) 0;
  margin-bottom: 16px;
}
.card-header p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.4;
  margin: 0;
}

/* ── Form Elements ─────────────────────────────────────────── */
.card-body {
  padding: var(--space-5);
}
.form-group-wrapper {
  margin-bottom: var(--space-4);
  position: relative;
}

label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}
label .required {
  color: var(--color-primary);
  margin-left: 2px;
}

input[type="text"],
input[type="email"],
input[type="number"] {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  font-size: var(--text-sm);
  color: var(--color-text);
  box-sizing: border-box;
}
input[type="text"]:hover,
input[type="email"]:hover,
input[type="number"]:hover {
  border-color: #a0a09a;
}
input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(161, 44, 44, 0.12);
  background: #fff;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
}

.btn-submit {
  width: 100%;
  padding: 12px;
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

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

.privacy-note {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-align: center;
  margin-top: var(--space-4);
  line-height: 1.5;
}

.field-error {
  display: block;
  color: var(--color-error);
  font-size: var(--text-xs);
  margin-top: 4px;
}

/* ── Popups ────────────────────────────────────────────────── */
.result-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 11000;
}
.result-popup-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  width: 90%;
  max-width: 380px;
  padding: var(--space-8) var(--space-6);
  text-align: center;
  animation: popup-in 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popup-in {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.result-popup-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-4);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 28px;
  line-height: 1;
}
.result-popup-card.success .result-popup-icon {
  background: var(--color-success-bg);
  color: var(--color-success);
}
.result-popup-card.error .result-popup-icon {
  background: var(--color-error-bg);
  color: var(--color-error);
}
.result-popup-title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-2);
  color: var(--color-text);
}
.result-popup-text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
}
