/* Modern Registration Form Design */
:root {
  --primary-color: #364f78;
  --primary-light: #4a6199;
  --primary-dark: #253757;
  --secondary-color: #f8fafc;
  --accent-color: #10b981;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;
  --error-color: #ef4444;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --spacing-xs: 0.5rem;
  --spacing-sm: 0.75rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-primary);
  padding: 0;
  margin: 0;
  min-height: 100vh;
  line-height: 1.6;
  color: var(--text-primary);
}

.card {
  width: 100%;
  background: var(--bg-primary);
  padding: var(--spacing-xl) var(--spacing-2xl);
  margin: 0;
  max-width: none;
}

h1 {
  margin: 0 0 var(--spacing-lg) 0;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary-color);
  text-align: center;
  position: relative;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
}

.logo {
  height: 3rem;
  width: auto;
  flex-shrink: 0;
}

h1::before {
  content: "";
  position: absolute;
  bottom: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--primary-color);
  border-radius: 2px;
}

h2 {
  margin: 0 0 var(--spacing-sm) 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

fieldset {
  border: none;
  margin: var(--spacing-xl) 0;
  padding: var(--spacing-lg);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

fieldset:hover {
  box-shadow: var(--shadow-sm);
}

legend {
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--text-primary);
  padding: 0 var(--spacing-sm);
  margin-bottom: var(--spacing-md);
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.section-description {
  margin-bottom: var(--spacing-lg);
  padding: var(--spacing-md);
  background: rgba(59, 130, 246, 0.05);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary-color);
}

.section-description p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

label {
  display: block;
  margin-bottom: var(--spacing-lg);
  font-weight: 500;
  color: var(--text-primary);
  position: relative;
}

input,
select,
textarea {
  width: 100%;
  padding: var(--spacing-md) var(--spacing-md);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg-primary);
  transition: all 0.2s ease;
  margin-top: var(--spacing-xs);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  transform: translateY(-1px);
}

input:hover:not(:focus),
select:hover:not(:focus),
textarea:hover:not(:focus) {
  border-color: var(--text-muted);
}

input:invalid:not(:focus) {
  border-color: var(--error-color);
}

input:valid:not(:placeholder-shown) {
  border-color: var(--success-color);
}

select:invalid:not(:focus) {
  border-color: var(--error-color);
}

select:valid {
  border-color: var(--success-color);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right var(--spacing-md) center;
  background-size: 1rem;
  padding-right: calc(var(--spacing-md) + 1.5rem);
}

textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

.error {
  color: var(--error-color);
  margin: var(--spacing-xs) 0;
  font-weight: 500;
}

.success {
  color: var(--success-color);
  margin: var(--spacing-xs) 0;
  font-weight: 500;
}

.validation-message {
  color: var(--error-color);
  font-size: 0.875rem;
  margin: var(--spacing-xs) 0 0 0;
  padding: var(--spacing-xs) var(--spacing-sm);
  background-color: rgba(239, 68, 68, 0.1);
  border-left: 3px solid var(--error-color);
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.hidden {
  display: none;
}

/* Event Info Section */
section[aria-labelledby="eventInfoTitle"] {
  background: var(--primary-color);
  color: white;
  padding: var(--spacing-lg);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-xl);
}

section[aria-labelledby="eventInfoTitle"] h2 {
  color: white;
  margin-bottom: var(--spacing-md);
}

section[aria-labelledby="eventInfoTitle"] ul {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--spacing-md) 0;
}

section[aria-labelledby="eventInfoTitle"] li {
  margin-bottom: var(--spacing-xs);
  padding-left: var(--spacing-lg);
  position: relative;
}

section[aria-labelledby="eventInfoTitle"] li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent-color);
  font-weight: bold;
}

section[aria-labelledby="eventInfoTitle"] .section-description {
  background: rgba(255, 255, 255, 0.15);
  border-left: 3px solid var(--accent-color);
  margin-bottom: 0;
}

section[aria-labelledby="eventInfoTitle"] .section-description p {
  color: rgba(255, 255, 255, 0.9);
}

section[aria-labelledby="eventInfoTitle"] a {
  color: #bfdbfe;
  text-decoration: underline;
  font-weight: 600;
  transition: color 0.2s ease;
}

section[aria-labelledby="eventInfoTitle"] a:hover {
  color: #dbeafe;
}

/* Radio Button Styling */
#flatmateChoices label,
#sharedFlatOptions label {
  display: flex;
  align-items: flex-start;
  margin-bottom: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

#flatmateChoices label:hover,
#sharedFlatOptions label:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-sm);
}

#flatmateChoices input[type="radio"],
#sharedFlatOptions input[type="radio"] {
  width: auto;
  margin-right: var(--spacing-sm);
  margin-top: 0.125rem;
  accent-color: var(--primary-color);
}

#flatmateChoices input[type="radio"]:checked + *,
#sharedFlatOptions input[type="radio"]:checked + * {
  color: var(--primary-color);
  font-weight: 600;
}

/* Button Styling */
.direct-register-btn {
  background: linear-gradient(135deg, var(--accent-color) 0%, #059669 100%);
  color: white;
  border: none;
  padding: var(--spacing-md) var(--spacing-xl);
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  max-width: 500px;
  width: 100%;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-md);
  margin: 0 auto;
}

.direct-register-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.direct-register-btn:active {
  transform: translateY(0);
}

.direct-register-btn:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: var(--shadow-sm);
}

/* Payment Section */
#payment-section {
  text-align: center;
}

#payment-section:not(.hidden) {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 150px;
}

/* Payment button container */
#payment-button-container {
  max-width: 500px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.mollie-pay-button {
  background: linear-gradient(135deg, #0066FF 0%, #0052CC 100%);
  color: white;
  font-size: 16px;
  font-weight: 600;
  padding: 14px 32px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
  min-width: 250px;
  max-width: 500px;
  width: 100%;
}

.mollie-pay-button:hover:not(:disabled) {
  background: linear-gradient(135deg, #0052CC 0%, #003D99 100%);
  box-shadow: 0 6px 16px rgba(0, 102, 255, 0.4);
  transform: translateY(-1px);
}

.mollie-pay-button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 102, 255, 0.3);
}

.mollie-pay-button:disabled {
  background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
  cursor: not-allowed;
  box-shadow: none;
  opacity: 0.6;
}

/* Responsive Design */
@media (max-width: 768px) {
  .card {
    padding: var(--spacing-lg) var(--spacing-md);
  }
  
  h1 {
    font-size: 2rem;
  }
  
  .logo {
    height: 2.5rem;
  }
  
  fieldset {
    padding: var(--spacing-md);
    margin: var(--spacing-lg) 0;
  }
}

@media (min-width: 1200px) {
  .card {
    padding: var(--spacing-xl) 10%;
  }
}

/* Additional Enhancement - Form Progress Indicator */
.form-progress {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--spacing-xl);
  padding: 0 var(--spacing-md);
}

.progress-step {
  flex: 1;
  height: 4px;
  background: var(--border-color);
  margin: 0 2px;
  border-radius: 2px;
  transition: background-color 0.3s ease;
}

.progress-step.completed {
  background: var(--success-color);
}

.progress-step.active {
  background: var(--primary-color);
}

/* Improved address input styling */
#addressInput {
  position: relative;
}

#addressInput:not(.valid-address) {
  border-color: var(--error-color);
}

#addressInput.valid-address {
  border-color: var(--success-color);
}

/* Status messages */
#addrStatus,
#giftCodeStatus {
  margin-top: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
}

#giftCodeStatus.success,
#addrStatus.success {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
  border-left: 3px solid var(--success-color);
}

#giftCodeStatus.error,
#addrStatus.error {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--error-color);
  border-left: 3px solid var(--error-color);
}

/* Gift code input styling */
#giftCodeInput.gift-code-valid {
  border-color: var(--success-color) !important;
}

#giftCodeInput.gift-code-invalid {
  border-color: var(--error-color) !important;
}

/* Afterparty Section */
.afterparty-section {
  background: var(--bg-secondary);
  padding: var(--spacing-xl);
  border-radius: var(--radius-md);
  margin: var(--spacing-xl) 0;
  border: 2px solid var(--primary-color);
  box-shadow: var(--shadow-md);
}

.afterparty-section h2 {
  color: var(--primary-color);
  margin-bottom: var(--spacing-md);
  font-size: 1.625rem;
  font-weight: 600;
}

.afterparty-section .section-description {
  background: transparent;
  border-left: none;
  backdrop-filter: none;
  padding: 0;
}

.afterparty-section .section-description p {
  color: var(--text-primary);
  font-size: 1rem;
  margin-bottom: var(--spacing-lg);
}

.afterparty-section .section-description p:last-child {
  margin-bottom: 0;
}

.afterparty-button-wrapper {
  margin-top: var(--spacing-xl);
}

.afterparty-link {
  display: inline-block;
  background: var(--primary-color);
  color: white;
  padding: 0.875rem var(--spacing-xl);
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-md);
}

.afterparty-link:hover {
  background: var(--primary-light);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.afterparty-link:active {
  transform: translateY(0);
}

/* Checkbox Label Styling for Legal Consents */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  margin-bottom: var(--spacing-lg);
  padding: var(--spacing-md);
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

.checkbox-label:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-sm);
}

/* Red border for unchecked required checkboxes */
.checkbox-label:has(input[type="checkbox"][required]:not(:checked)) {
  border-color: var(--error-color);
}

/* Green border for checked required checkboxes */
.checkbox-label:has(input[type="checkbox"][required]:checked) {
  border-color: var(--success-color);
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  min-width: 1.25rem;
  height: 1.25rem;
  margin-right: var(--spacing-md);
  margin-top: 0.125rem;
  accent-color: var(--primary-color);
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-label span {
  flex: 1;
  line-height: 1.6;
}

.checkbox-label a {
  color: var(--primary-color);
  text-decoration: underline;
  font-weight: 600;
  transition: color 0.2s ease;
}

.checkbox-label a:hover {
  color: var(--primary-light);
}

.checkbox-label input[type="checkbox"]:checked ~ span {
  color: var(--text-primary);
}

/* Footer Styling */
.registration-footer {
  margin-top: var(--spacing-2xl);
  padding-top: var(--spacing-xl);
  border-top: 2px solid var(--border-color);
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

.footer-links a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--primary-light);
  text-decoration: underline;
}

.footer-separator {
  color: var(--text-muted);
  font-weight: 300;
}

.footer-copyright {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Footer responsive design */
@media (max-width: 768px) {
  .footer-links {
    flex-direction: column;
    gap: var(--spacing-xs);
  }

  .footer-separator {
    display: none;
  }
}

/* Data Notice Gate (Bottom Banner) */
.data-notice-gate {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.9) 100%);
  backdrop-filter: blur(10px);
  border-top: 3px solid var(--primary-color);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.data-notice-gate.hidden {
  display: none;
}

.data-notice-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--spacing-xl) var(--spacing-lg);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--spacing-xl);
}

.data-notice-text {
  flex: 1;
  color: white;
}

.data-notice-text h3 {
  margin: 0 0 var(--spacing-md) 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
}

.data-notice-text p {
  margin: 0 0 var(--spacing-sm) 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
}

.data-notice-text p:last-child {
  margin-bottom: 0;
}

.data-notice-text a {
  color: #60a5fa;
  text-decoration: underline;
  font-weight: 600;
  transition: color 0.2s ease;
}

.data-notice-text a:hover {
  color: #93c5fd;
}

.data-notice-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  flex-shrink: 0;
}

.data-notice-buttons button {
  padding: var(--spacing-md) var(--spacing-xl);
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
}

.btn-accept {
  background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
  color: white;
}

.btn-accept:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.btn-accept:active {
  transform: translateY(0);
}

.btn-decline {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-decline:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
}

.btn-decline:active {
  background: rgba(255, 255, 255, 0.2);
}

/* Disabled form overlay when gate is active */
body.gate-active {
  overflow: hidden;
}

body.gate-active main {
  pointer-events: none;
  user-select: none;
  opacity: 0.4;
  filter: blur(2px);
  transition: all 0.3s ease;
}

/* Responsive design for data notice gate */
@media (max-width: 768px) {
  .data-notice-content {
    flex-direction: column;
    align-items: stretch;
    padding: var(--spacing-lg) var(--spacing-md);
  }

  .data-notice-text h3 {
    font-size: 1.1rem;
  }

  .data-notice-text p {
    font-size: 0.9rem;
  }

  .data-notice-buttons {
    width: 100%;
  }

  .data-notice-buttons button {
    width: 100%;
  }
}

/* Label with icon wrapper */
.label-with-icon {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.label-with-icon label {
  margin-bottom: 0;
  display: inline;
}

.label-with-icon + select {
  margin-bottom: var(--spacing-lg);
}

/* Info Icon */
.info-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 600;
  font-style: normal;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  vertical-align: middle;
  flex-shrink: 0;
}

.info-icon:focus {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.modal-content {
  position: relative;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
  z-index: 1;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.modal-close:active {
  transform: scale(0.95);
}

.modal-body {
  padding: var(--spacing-lg);
  color: var(--text-primary);
  line-height: 1.6;
}

.modal-body p {
  margin: 0 0 var(--spacing-md) 0;
}

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

.modal-body ul {
  margin: var(--spacing-md) 0;
  padding-left: var(--spacing-lg);
}

.modal-body li {
  margin-bottom: var(--spacing-sm);
}

.modal-body li:last-child {
  margin-bottom: 0;
}

/* Responsive modal */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    max-height: 90vh;
  }

  .modal-header {
    padding: var(--spacing-md);
  }

  .modal-header h3 {
    font-size: 1.1rem;
  }

  .modal-body {
    padding: var(--spacing-md);
  }
}