:root {
  --reg-primary: #8d316f;
  --reg-primary-dark: #6b2454;
  --reg-gold: #f0c14b;
  --reg-ink: #1a1220;
  --reg-muted: #6b5f72;
  --reg-border: rgba(141, 49, 111, 0.14);
  --reg-surface: #faf7f9;
  --reg-radius: 14px;
  --reg-shadow: 0 12px 40px rgba(26, 18, 32, 0.1);
}

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

body.reg-body {
  margin: 0;
  min-height: 100vh;
  font-family: 'DM Sans', system-ui, sans-serif;
  background: linear-gradient(160deg, #faf7f9 0%, #f3eaf0 45%, #ebe2ea 100%);
  color: var(--reg-ink);
}

.reg-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.reg-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.reg-logo {
  height: 4.5rem;
  width: auto;
  object-fit: contain;
  margin-bottom: 1rem;
}

.reg-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--reg-muted);
}

.reg-title {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  color: var(--reg-primary);
  letter-spacing: -0.02em;
}

.reg-subtitle {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  color: var(--reg-muted);
}

.reg-card {
  background: #fff;
  border: 1px solid var(--reg-border);
  border-radius: calc(var(--reg-radius) + 4px);
  box-shadow: var(--reg-shadow);
  overflow: hidden;
}

.reg-card-top {
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, var(--reg-primary-dark), var(--reg-primary));
  color: #fff;
  text-align: center;
}

.reg-card-top p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.92;
}

.reg-card-body {
  padding: 1.5rem;
}

.reg-alert {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.reg-alert-success {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.reg-alert-error {
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.reg-alert-error ul,
.reg-card .alert-danger ul {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.reg-card .alert {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.reg-card .alert-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.reg-tabs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 4px;
  margin-bottom: 1.5rem;
  background: var(--reg-surface);
  border-radius: 999px;
  border: 1px solid var(--reg-border);
}

.reg-tab {
  flex: 1;
  padding: 0.65rem 1rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--reg-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.reg-tab.active {
  background: linear-gradient(135deg, var(--reg-primary), var(--reg-primary-dark));
  color: #fff;
  box-shadow: 0 4px 12px rgba(141, 49, 111, 0.35);
}

.reg-tab:not(.active):hover {
  color: var(--reg-primary);
}

.reg-form.hidden {
  display: none;
}

.reg-section {
  margin-bottom: 1.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--reg-border);
}

.reg-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.reg-section-title {
  margin: 0 0 1rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--reg-primary);
}

.reg-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.reg-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.reg-field-full {
  grid-column: 1 / -1;
}

.reg-field label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--reg-muted);
}

.reg-input {
  width: 100%;
  min-height: 42px;
  padding: 0.5rem 0.75rem;
  border: 1px solid #e5dfe8;
  border-radius: 10px;
  font: inherit;
  font-weight: 500;
  color: var(--reg-ink);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.reg-input:focus {
  outline: none;
  border-color: var(--reg-primary);
  box-shadow: 0 0 0 3px rgba(141, 49, 111, 0.12);
}

.reg-textarea {
  min-height: 88px;
  resize: vertical;
}

.reg-hint {
  font-size: 0.78rem;
  color: var(--reg-muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.reg-hint-warn {
  color: #b45309;
}

.reg-notice {
  padding: 0.75rem 0.9rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  font-size: 0.82rem;
  color: #92400e;
  margin-bottom: 0.5rem;
}

.reg-signature-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.reg-signature-canvas {
  width: 100%;
  height: 150px;
  touch-action: none;
  border: 2px dashed #e5dfe8;
  border-radius: 12px;
  background: #fff;
  cursor: crosshair;
}

.reg-btn-clear {
  align-self: flex-start;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--reg-border);
  border-radius: 8px;
  background: #fff;
  color: var(--reg-muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.reg-btn-clear:hover {
  border-color: #ef4444;
  color: #ef4444;
}

.reg-submit {
  margin-top: 1.5rem;
}

.reg-btn-submit {
  width: 100%;
  padding: 0.85rem 1.5rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--reg-primary), var(--reg-primary-dark));
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(141, 49, 111, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.reg-btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(141, 49, 111, 0.45);
}

.reg-btn-submit.employee {
  background: linear-gradient(135deg, #6b2454, #4a1839);
}

.reg-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--reg-muted);
}

.reg-footer a {
  color: var(--reg-primary);
  font-weight: 600;
  text-decoration: none;
}

.reg-footer a:hover {
  text-decoration: underline;
}

input[type="text"]:not(.numeric-only),
textarea.reg-input {
  text-transform: uppercase;
}

@media (max-width: 640px) {
  .reg-grid {
    grid-template-columns: 1fr;
  }

  .reg-page {
    padding: 1.25rem 1rem 2rem;
  }

  .reg-card-body {
    padding: 1.25rem;
  }
}
