
/* EA HUB Registration Manager — Frontend Styles */

/* ── CSS Custom Properties ──────────────────────────────────────────────── */
:root {
  --eahrm-primary:        #A83F43;
  --eahrm-primary-hover:rgb(172, 54, 57);
  --eahrm-accent:         rgb(230, 61, 66);
  --eahrm-accent-hover:   rgb(230, 61, 66);
  --eahrm-success:        #0f5132;
  --eahrm-success-bg:     #d1e7dd;
  --eahrm-error:          #842029;
  --eahrm-error-bg:       #f8d7da;
  --eahrm-border:         #dee2e6;
  --eahrm-bg:             #f8f9fa;
  --eahrm-white:          #ffffff;
  --eahrm-text:           #000000;
  --eahrm-muted:          #6c757d;
  --eahrm-radius:         8px;
  --eahrm-radius-lg:      12px;
  --eahrm-shadow:         0 8px 40px rgba(0, 0, 0, 0.18);
  --eahrm-transition:     0.2s ease;
  --eahrm-z-modal:        99999;
}

/* ── Trigger Button ─────────────────────────────────────────────────────── */
.eahrm-open-modal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--eahrm-primary);
  color: var(--eahrm-white);
  border: none;
  border-radius: var(--eahrm-radius);
  padding: 12px 28px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--eahrm-transition), transform var(--eahrm-transition), box-shadow var(--eahrm-transition);
  box-shadow: 0 2px 8px rgba(26, 26, 46, 0.3);
}

.eahrm-open-modal:hover,
.eahrm-open-modal:focus-visible {
  background: var(--eahrm-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(26, 26, 46, 0.4);
  outline-offset: 2px;
}

.eahrm-open-modal:active {
  transform: translateY(0);
}

/* ── Modal Overlay ──────────────────────────────────────────────────────── */
.eahrm-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--eahrm-z-modal);
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--eahrm-transition), visibility var(--eahrm-transition);
}

.eahrm-modal-overlay.eahrm-modal-open {
  opacity: 1;
  visibility: visible;
}

/* ── Modal Container ────────────────────────────────────────────────────── */
.eahrm-modal-container {
  background: var(--eahrm-white);
  border-radius: var(--eahrm-radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--eahrm-shadow);
  transform: translateY(20px) scale(0.98);
  transition: transform var(--eahrm-transition);
  overflow: hidden;
}

.eahrm-modal-overlay.eahrm-modal-open .eahrm-modal-container {
  transform: translateY(0) scale(1);
}

/* ── Modal Header ───────────────────────────────────────────────────────── */
.eahrm-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background: var(--eahrm-primary);
  color: var(--eahrm-white);
  padding: 24px 28px 20px;
  flex-shrink: 0;
}

.eahrm-modal-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #ffffff;
}

.eahrm-modal-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  line-height: 0;
  transition: color var(--eahrm-transition), background var(--eahrm-transition);
  flex-shrink: 0;
  margin-top: 2px;
}

.eahrm-modal-close:hover,
.eahrm-modal-close:focus-visible {
  color: var(--eahrm-white);
  background: rgba(255, 255, 255, 0.15);
  outline: none;
}

/* ── Progress Steps ─────────────────────────────────────────────────────── */
.eahrm-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 16px 28px;
  background: var(--eahrm-bg);
  border-bottom: 1px solid var(--eahrm-border);
  flex-shrink: 0;
}

.eahrm-progress-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--eahrm-muted);
  transition: color var(--eahrm-transition);
}

.eahrm-step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--eahrm-border);
  color: var(--eahrm-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  transition: background var(--eahrm-transition), color var(--eahrm-transition);
}

.eahrm-step-active .eahrm-step-number,
.eahrm-step-done .eahrm-step-number {
  background: var(--eahrm-primary);
  color: var(--eahrm-white);
}

.eahrm-step-active {
  color: var(--eahrm-text);
  font-weight: 600;
}

.eahrm-progress-divider {
  width: 40px;
  height: 2px;
  background: var(--eahrm-border);
  margin: 0 8px;
}

/* ── Modal Body (scrollable) ────────────────────────────────────────────── */
.eahrm-modal-body {
  overflow-y: auto;
  position: relative;
  flex: 1;
}

/* ── Step Panels ────────────────────────────────────────────────────────── */
.eahrm-step {
  padding: 28px;
}

/* ── Form Fieldsets ─────────────────────────────────────────────────────── */
fieldset {
  border: 1px solid var(--eahrm-border);
  border-radius: var(--eahrm-radius);
  padding: 20px 20px 12px;
  margin-bottom: 20px;
}

fieldset legend {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--eahrm-muted);
  padding: 0 8px;
}

/* ── Row Layouts ────────────────────────────────────────────────────────── */
.eahrm-row {
  margin-bottom: 16px;
}

.eahrm-row:last-child {
  margin-bottom: 0;
}

.eahrm-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.eahrm-field-full {
  grid-column: 1 / -1;
}

/* ── Form Fields ────────────────────────────────────────────────────────── */
.eahrm-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.eahrm-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--eahrm-text);
}

.eahrm-field input,
.eahrm-field select,
.eahrm-field textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--eahrm-border);
  border-radius: var(--eahrm-radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--eahrm-text);
  background: var(--eahrm-white);
  transition: border-color var(--eahrm-transition), box-shadow var(--eahrm-transition);
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.eahrm-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%236c757d' d='M4 6l4 4 4-4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.eahrm-field textarea {
  resize: vertical;
  min-height: 72px;
}

.eahrm-field input:focus,
.eahrm-field select:focus,
.eahrm-field textarea:focus {
  outline: none;
  border-color: var(--eahrm-accent);
  box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.2);
}

.eahrm-field input.eahrm-invalid,
.eahrm-field select.eahrm-invalid,
.eahrm-field textarea.eahrm-invalid {
  border-color: #dc3545;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

.eahrm-field-error {
  font-size: 12px;
  color: #dc3545;
  min-height: 16px;
  display: block;
}

/* ── Required indicator ─────────────────────────────────────────────────── */
.eahrm-required {
  color: #dc3545;
  margin-left: 2px;
}

.eahrm-required-note {
  font-size: 12px;
  color: var(--eahrm-muted);
  margin: 0;
}

/* ── Price total ─────────────────────────────────────────────────────────── */
.eahrm-total-preview {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  background: var(--eahrm-bg);
  border-radius: var(--eahrm-radius);
  margin-top: 16px;
  font-size: 15px;
  color: var(--eahrm-muted);
}

.eahrm-total-preview strong {
  font-size: 20px;
  color: var(--eahrm-text);
  font-weight: 700;
}

/* ── Form Footer ────────────────────────────────────────────────────────── */
.eahrm-form-footer, .eahrm-info-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 8px;
  flex-wrap: wrap;
}

.eahrm-form-footer{
  justify-content: space-between;
} 

.eahrm-info-footer{
  
  justify-content: center;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.eahrm-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--eahrm-radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--eahrm-transition), transform var(--eahrm-transition), box-shadow var(--eahrm-transition);
  text-decoration: none;
  font-family: inherit;
}

.eahrm-btn-primary {
  background: var(--eahrm-primary);
  color: var(--eahrm-white);
  box-shadow: 0 2px 8px rgba(26, 26, 46, 0.25);
}

.eahrm-btn-primary:hover,
.eahrm-btn-primary:focus-visible {
  background: var(--eahrm-primary-hover);
  transform: translateY(-1px);
  outline-offset: 2px;
}

.eahrm-btn-ghost {
  background: transparent;
  color: var(--eahrm-muted);
  border: 1.5px solid var(--eahrm-border);
}

.eahrm-btn-ghost:hover {
  background: var(--eahrm-bg);
  color: var(--eahrm-text);
}

.eahrm-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* ── Alert / Notice ─────────────────────────────────────────────────────── */
.eahrm-alert {
  padding: 12px 16px;
  border-radius: var(--eahrm-radius);
  font-size: 14px;
  margin-top: 12px;
}

.eahrm-alert-error {
  background: var(--eahrm-error-bg);
  color: var(--eahrm-error);
  border: 1px solid #f1aeb5;
}

.eahrm-alert-success {
  background: var(--eahrm-success-bg);
  color: var(--eahrm-success);
  border: 1px solid #a3cfbb;
}

/* ── Payment Step ───────────────────────────────────────────────────────── */
.eahrm-payment-screen {
  max-width: 480px;
  margin: 0 auto;
}

.eahrm-payment-summary {
  background: var(--eahrm-bg);
  border-radius: var(--eahrm-radius);
  padding: 20px;
  margin-bottom: 24px;
}

.eahrm-payment-summary h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--eahrm-muted);
  margin: 0 0 12px;
}

.eahrm-summary-grid {
  display: grid;
  gap: 6px;
  font-size: 14px;
}

.eahrm-summary-row {
  display: flex;
  justify-content: space-between;
}

.eahrm-summary-row .label {
  color: var(--eahrm-muted);
}

.eahrm-summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  margin-top: 12px;
  border-top: 2px solid var(--eahrm-border);
  font-size: 16px;
}

.eahrm-summary-total strong {
  font-size: 22px;
  color: var(--eahrm-text);
}

.eahrm-payment-heading {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 16px;
}

.eahrm-payment-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.eahrm-payment-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 16px;
  border: 2px solid var(--eahrm-border);
  border-radius: var(--eahrm-radius-lg);
  background: var(--eahrm-white);
  cursor: pointer;
  text-align: center;
  transition: border-color var(--eahrm-transition), box-shadow var(--eahrm-transition), transform var(--eahrm-transition);
  font-family: inherit;
}

.eahrm-payment-card:hover,
.eahrm-payment-card:focus-visible {
  border-color: var(--eahrm-primary);
  box-shadow: 0 4px 16px rgba(26, 26, 46, 0.15);
  transform: translateY(-2px);
  outline: none;
}

.eahrm-payment-card:active {
  transform: translateY(0);
}

.eahrm-payment-icon {
  color: var(--eahrm-primary);
}

.eahrm-payment-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--eahrm-text);
}

.eahrm-payment-desc {
  font-size: 12px;
  color: var(--eahrm-muted);
  line-height: 1.5;
}

.eahrm-payment-back {
  text-align: center;
  padding-top: 8px;
}

/* ── Confirmation Step ──────────────────────────────────────────────────── */
.eahrm-confirmation-screen {
  text-align: center;
  max-width: 440px;
  margin: 0 auto;
  padding: 8px 0 16px;
}

.eahrm-success-icon {
  color: #198754;
  margin-bottom: 16px;
}

.eahrm-confirmation-screen h3 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 12px;
}

.eahrm-confirmation-text {
  font-size: 15px;
  color: var(--eahrm-muted);
  margin: 0 0 20px;
  line-height: 1.6;
}

.eahrm-invoice-preview {
  text-align: left;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--eahrm-border);
  border-radius: var(--eahrm-radius);
  margin-bottom: 20px;
}

/* ── Loading Overlay ────────────────────────────────────────────────────── */
.eahrm-loading-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(2px);
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.eahrm-loading-overlay:not([hidden]) {
  display: flex;
}

.eahrm-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--eahrm-border);
  border-top-color: var(--eahrm-primary);
  border-radius: 50%;
  animation: eahrm-spin 0.75s linear infinite;
}

@keyframes eahrm-spin {
  to { transform: rotate(360deg); }
}

/* ── Accessibility ──────────────────────────────────────────────────────── */
.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .eahrm-modal-container {
    max-height: 95vh;
  }

  .eahrm-step {
    padding: 20px 16px;
  }

  .eahrm-row-2col {
    grid-template-columns: 1fr;
  }

  .eahrm-payment-options {
    grid-template-columns: 1fr;
  }

  .eahrm-progress-step .eahrm-step-label {
    display: none;
  }

  .eahrm-progress-divider {
    width: 20px;
  }

  .eahrm-form-footer, .eahrm-info-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .eahrm-btn {
    justify-content: center;
  }

  fieldset {
    padding: 16px 12px 10px;
  }
}

/* ── Event Intro ────────────────────────────────────────────────────────── */
.eahrm-event-intro {
  background: var(--eahrm-bg);
  border-radius: var(--eahrm-radius);
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--eahrm-text);
  line-height: 1.7;
}

.eahrm-event-intro p {
  margin: 0 0 8px;
  color: var(--eahrm-text);
  font-weight: 400;
  font-size: 16px;
}

.eahrm-event-intro p a {
  color: var(--eahrm-primary);
}

.eahrm-fees-box {
  background: #fff;
  border: 1px solid var(--eahrm-border);
  border-radius: var(--eahrm-radius);
  padding: 12px 16px;
  margin: 10px 0;
  font-weight: 400;
  font-size: 16px;
}

.eahrm-fees-box strong {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--eahrm-text);
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 16px;
  padding: 0px 16px;
}

.eahrm-fees-box ol {
  padding-left: 18px;
  margin: 0;
  list-style: circle;
}

.eahrm-fees-box li {
  margin-bottom: 4px;
  color: var(--eahrm-text);
}

/* ── Field Group (replaces fieldset layout) ─────────────────────────────── */
.eahrm-field-group {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--eahrm-bg);
}

.eahrm-field-group:last-of-type {
  border-bottom: none;
}

.eahrm-field-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--eahrm-text);
  margin-bottom: 10px;
  line-height: 1.5;
}

.eahrm-field-hint {
  display: block;
  font-size: 12px;
  font-weight: 400;
  font-style: italic;
  color: var(--eahrm-muted);
  margin-top: 2px;
}

.eahrm-field-group input[type="text"],
.eahrm-field-group input[type="email"],
.eahrm-field-group input[type="tel"],
.eahrm-field-group input[type="number"],
.eahrm-field-group select,
.eahrm-field-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--eahrm-border);
  border-radius: var(--eahrm-radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--eahrm-text);
  background: var(--eahrm-white);
  transition: border-color var(--eahrm-transition), box-shadow var(--eahrm-transition);
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.eahrm-field-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%236c757d' d='M4 6l4 4 4-4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.eahrm-field-group textarea {
  resize: vertical;
  min-height: 80px;
}

.eahrm-field-group input:focus,
.eahrm-field-group select:focus,
.eahrm-field-group textarea:focus {
  outline: none;
  border-color: var(--eahrm-accent);
  box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.2);
}

.eahrm-field-group input.eahrm-invalid,
.eahrm-field-group select.eahrm-invalid,
.eahrm-field-group textarea.eahrm-invalid {
  border-color: #dc3545;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

/* ── Radio Group ────────────────────────────────────────────────────────── */
.eahrm-radio-group,
.eahrm-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.eahrm-radio-label,
.eahrm-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--eahrm-text);
  padding: 8px 12px;
  border-radius: var(--eahrm-radius);
  border: 1.5px solid var(--eahrm-border);
  background: var(--eahrm-white);
  transition: border-color var(--eahrm-transition), background var(--eahrm-transition);
  line-height: 1.4;
}

.eahrm-radio-label:hover,
.eahrm-checkbox-label:hover {
  border-color: var(--eahrm-accent);
  background: #f0f7ff;
}

.eahrm-radio-label input[type="radio"],
.eahrm-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--eahrm-primary);
  cursor: pointer;
}

.eahrm-radio-label:has(input:checked),
.eahrm-checkbox-label:has(input:checked) {
  border-color: var(--eahrm-primary);
  background: #f0f4ff;
}

/* ── Fieldset reset inside field-group ──────────────────────────────────── */
.eahrm-field-group fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

.eahrm-field-group fieldset legend {
  font-size: 14px;
  font-weight: 600;
  color: var(--eahrm-text);
  margin-bottom: 10px;
  padding: 0;
  line-height: 1.5;
  float: none;
  width: 100%;
}

/* ── Conditional fields ─────────────────────────────────────────────────── */
.eahrm-conditional[hidden] {
  display: none;
}

/* ── Form footer ────────────────────────────────────────────────────────── */
.eahrm-form-footer, .eahrm-form-footer {
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Step padding ───────────────────────────────────────────────────────── */
#eahrm-step-form.eahrm-step {
  padding: 24px 28px;
}

@media (max-width: 600px) {
  #eahrm-step-form.eahrm-step {
    padding: 16px;
  }
  .eahrm-radio-label,
  .eahrm-checkbox-label {
    font-size: 13px;
  }
}
