/* Modern “tailwind-like” register page (clean + subtle) */
:root {
  --capk-green: #1a7a4a;
  --capk-green-dk: #145e38;
  --capk-gold: #c9a227;

  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-600: #475569;
  --slate-900: #0f172a;

  --ring: rgba(26, 122, 74, 0.22);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.10);
}

/* Page layout */
.app-container {
  background: radial-gradient(1200px 600px at 20% -10%, rgba(201, 162, 39, 0.12), transparent 55%),
              radial-gradient(1000px 520px at 90% 10%, rgba(26, 122, 74, 0.10), transparent 50%),
              linear-gradient(180deg, var(--slate-50), var(--slate-100));
  min-height: 100vh;
  padding: 1.25rem 0.75rem 2rem;
  position: relative;
  overflow-x: hidden;
}

.app-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(15, 23, 42, 0.06);
  z-index: 10;
}

/* Enhanced Header */
.header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
}

.header-title {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.header-subtitle {
  color: #64748b;
  font-size: 1.125rem;
  font-weight: 500;
}

/* Registration form: same content width as hero / breadcrumb (no extra horizontal inset beyond .container) */
.registration-container {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0.75rem 0 3rem;
  position: relative;
}

@media (min-width: 768px) {
  .registration-container {
    padding-top: 1rem;
  }
}

/* Vertical rhythm between all major form blocks */
.registration-container form.registration-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.registration-container form.registration-form > .card,
.registration-container form.registration-form > .form-section,
.registration-container form.registration-form > .registration-form-actions {
  margin-bottom: 0;
}

/* Make the top breadcrumb/header feel like a modern hero card */
.public-register-hero {
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  position: relative;
  overflow: hidden;
}
.public-register-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 280px at 20% 0%, rgba(201, 162, 39, 0.12), transparent 55%),
    radial-gradient(900px 280px at 85% 0%, rgba(26, 122, 74, 0.10), transparent 55%);
  pointer-events: none;
}
.public-register-hero > * {
  position: relative;
  z-index: 1;
}
.public-register-hero .breadcrumb a {
  color: rgba(26, 122, 74, 0.95);
  font-weight: 600;
}
.public-register-hero .breadcrumb .active {
  color: rgba(15, 23, 42, 0.55);
}

/* Cards (scope to this page only) */
.registration-container .card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 0;
  overflow: hidden;
  position: relative;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.registration-container .card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.registration-container .card-header {
  border: 0;
  background: transparent !important;
  padding: 1rem 1.25rem !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.registration-container .card-header h5 {
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--slate-900);
}

.card-header i {
  font-size: 1.125rem;
}

.registration-container .card-body {
  padding: 1.25rem;
  background: transparent;
}

/* Form sections (register page: extra rhythm vs container edge) */
.form-section {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 18px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.registration-container .form-section {
  padding: 1.5rem clamp(1.1rem, 3vw, 2rem);
  margin-bottom: 0;
}

/* SIG multi-select dropdown is portaled to body — avoid clipping Tom Select */
.registration-container .form-section.form-section--sig {
  overflow: visible;
}

.registration-container .form-section .section-title {
  margin-bottom: 1rem;
}

.registration-container .form-capk-group {
  margin-bottom: 1.125rem;
}

.registration-container .form-capk-group:last-child {
  margin-bottom: 0;
}

/* Submit row */
.registration-container .registration-form-actions {
  margin-top: 0;
  padding: 1.75rem clamp(0.5rem, 2vw, 1rem) 0.5rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.form-section:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.form-section::before {
  content: none;
}

.section-title {
  color: var(--slate-900);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.10);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
}

.section-title i {
  color: var(--capk-green);
  font-size: 1.05rem;
}

/* Form controls */
.form-label {
  font-weight: 600;
  color: var(--slate-600);
  font-size: 0.8125rem;
  margin-bottom: 0.35rem;
  letter-spacing: 0.01em;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
select,
textarea {
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 12px;
  padding: 0.65rem 0.9rem;
  font-size: 0.875rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  background: rgba(248, 250, 252, 0.8);
  font-weight: 500;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="tel"]:hover,
input[type="date"]:hover,
input[type="number"]:hover,
select:hover,
textarea:hover {
  border-color: rgba(15, 23, 42, 0.24);
  background: rgba(248, 250, 252, 0.95);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(26, 122, 74, 0.55);
  box-shadow: 0 0 0 4px var(--ring);
  background: #fff;
}

/* Primary button (ensure visible, consistent, modern) */
.btn-capk-primary {
  background: linear-gradient(180deg, rgba(26, 122, 74, 1), rgba(20, 94, 56, 1)) !important;
  border: 1px solid rgba(20, 94, 56, 1) !important;
  color: #fff !important;
  box-shadow: 0 10px 24px rgba(26, 122, 74, 0.18);
}
.btn-capk-primary:hover {
  filter: brightness(0.98);
  box-shadow: 0 12px 28px rgba(26, 122, 74, 0.22);
}
.btn-capk-primary:focus {
  box-shadow: 0 0 0 4px var(--ring), 0 10px 24px rgba(26, 122, 74, 0.18);
}

.col-md-6 {
  flex: 0 0 50%;
  max-width: 50%;
}

.col-md-8 {
  flex: 0 0 66.666667%;
  max-width: 66.666667%;
}

.col-md-12 {
  flex: 0 0 100%;
  max-width: 100%;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  border-color: var(--cap-k-green);
  outline: none;
  box-shadow: 0 0 0 4px rgba(26, 122, 74, 0.1);
  transform: translateY(-1px);
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="tel"]:hover,
input[type="date"]:hover,
input[type="number"]:hover,
select:hover,
textarea:hover {
  border-color: #cbd5e1;
}

/* Enhanced Button */
.btn-success {
  background: var(--gradient-primary);
  border: none;
  padding: 1rem 2.5rem;
  font-weight: 700;
  font-size: 1.125rem;
  box-shadow: var(--shadow-md);
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn-success::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn-success:hover::before {
  left: 100%;
}

.btn-success:hover {
  background: linear-gradient(135deg, var(--cap-k-green-dark), var(--cap-k-green));
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: white;
}

.btn-success:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* Declarations & Consent — high-contrast custom checkboxes (public register only) */
.registration-container .consent-declarations .consent-form-check {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin: 0;
  padding: 1.2rem 1.35rem;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  overflow: visible;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.registration-container .consent-declarations .consent-form-check:hover {
  border-color: rgba(26, 122, 74, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 4px 18px rgba(15, 23, 42, 0.06);
}

.registration-container .consent-declarations .consent-form-check__label {
  margin: 0;
  padding: 0;
  flex: 1;
  cursor: pointer;
  font-size: 0.9375rem;
  line-height: 1.45;
  font-weight: 600;
  color: var(--gray-800, #1e293b);
}

.registration-container .consent-declarations .consent-form-check__label strong {
  font-weight: 800;
  color: var(--gray-900, #0f172a);
}

.registration-container .consent-declarations .consent-item__hint {
  margin-top: 0.65rem;
  margin-left: 0;
}

/* Unchecked = clear empty box; checked = green + bold white tick */
.registration-container .consent-declarations .form-check-input {
  --consent-check: #1a7a4a;
  width: 1.375rem;
  height: 1.375rem;
  margin: 0.15rem 0 0 0;
  flex-shrink: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  border: 2px solid #64748b;
  border-radius: 6px;
  background-color: #fff;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 0;
  transition: border-color 0.12s ease, background-color 0.12s ease, box-shadow 0.12s ease;
}

.registration-container .consent-declarations .form-check-input:hover {
  border-color: var(--consent-check);
  box-shadow: 0 0 0 3px rgba(26, 122, 74, 0.12);
}

.registration-container .consent-declarations .form-check-input:focus {
  outline: none;
}

.registration-container .consent-declarations .form-check-input:focus-visible {
  border-color: var(--consent-check);
  box-shadow: 0 0 0 3px rgba(26, 122, 74, 0.25);
}

.registration-container .consent-declarations .form-check-input:checked {
  background-color: var(--consent-check);
  border-color: var(--consent-check);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' d='M5 10.5 8.5 14 15 7'/%3e%3c/svg%3e");
  background-size: 14px 14px;
}

.registration-container .consent-declarations .form-check-input.form-check-input-lg {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 7px;
  border-width: 2px;
}

.registration-container .consent-declarations .form-check-input.form-check-input-lg:checked {
  background-size: 16px 16px;
}

/* Enhanced Alerts */
.alert {
  border: none;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  font-weight: 500;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.alert::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.alert-success {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  color: var(--cap-k-green);
  border: 1px solid #bbf7d0;
}

.alert-success::before {
  background: var(--cap-k-green);
}

.alert-danger {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  color: #dc2626;
  border: 1px solid #fecaca;
}

.alert-danger::before {
  background: #dc2626;
}

.alert-warning {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  color: #d97706;
  border: 1px solid #fed7aa;
}

.alert-warning::before {
  background: #d97706;
}

.alert-info {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.alert-info::before {
  background: #2563eb;
}

/* Enhanced Validation Feedback */
.invalid-feedback {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #dc2626;
  font-weight: 500;
  background: #fef2f2;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  border-left: 3px solid #dc2626;
}

.form-text {
  font-size: 0.8125rem;
  color: #64748b;
  margin-top: 0.5rem;
  font-weight: 500;
  background: #f8fafc;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  border-left: 3px solid #e2e8f0;
}

/* Enhanced Row and Column Spacing */
.row {
  margin-bottom: 1rem;
}

.col-md-4, .col-md-6 {
  margin-bottom: 1rem;
}

/* Enhanced Form Groups */
.mb-3 {
  margin-bottom: 1rem;
}

/* Compact Form Layout */
.card-body .row:not(:last-child) {
  margin-bottom: 1.25rem;
}

.form-section .row:not(:last-child) {
  margin-bottom: 1.25rem;
}

/* Micro-interactions */
.form-control:hover,
.form-select:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* Enhanced Responsive Design */
@media (max-width: 768px) {
  .app-container {
    padding: 1rem 0.5rem;
  }
  
  .header {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
  }
  
  .header-title {
    font-size: 2rem;
  }
  
  .header-subtitle {
    font-size: 1rem;
  }
  
  .card {
    margin-bottom: 1.5rem;
  }
  
  .card-body {
    padding: 1.5rem;
  }
  
  .form-section {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
  }
  
  .section-title {
    font-size: 1.25rem;
  }
  
  .form-check {
    padding: 1rem;
  }
  
  .btn-success {
    padding: 0.875rem 2rem;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 1rem;
  }
  
  .header-title {
    font-size: 1.75rem;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  .form-section {
    padding: 1rem;
  }
  
  .section-title {
    font-size: 1.125rem;
  }
  
  .form-check {
    padding: 0.75rem;
  }
  
  .form-check-label {
    font-size: 0.875rem;
  }
  
  .btn-success {
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
  }
}

/* Loading Animation */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slide-up {
  opacity: 0;
  transform: translateY(30px);
  animation: slideUp 0.6s ease-out forwards;
}

/* Enhanced Focus States */
.form-control:focus,
.form-select:focus {
  border-color: var(--cap-k-green);
  box-shadow: 0 0 0 4px rgba(26, 122, 74, 0.1);
  transform: translateY(-1px);
}

/* Enhanced Disabled States */
.form-control:disabled,
.form-select:disabled {
  background-color: #f8fafc;
  opacity: 0.6;
  cursor: not-allowed;
}

/* Enhanced Error States */
.form-control.is-invalid,
.form-select.is-invalid {
  border-color: #dc2626;
  background-color: #fef2f2;
}

.form-control.is-valid,
.form-select.is-valid {
  border-color: var(--cap-k-green);
  background-color: #f0fdf4;
}

/* Signature Container Styling */
.signature-container {
  border: 2px dashed #e2e8f0;
  border-radius: 8px;
  background: #fafafa;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  position: relative;
  cursor: crosshair;
  transition: all 0.3s ease;
}

.signature-container:hover {
  border-color: var(--cap-k-green);
  background: #f8fafc;
}

.signature-canvas {
  display: block;
  width: 100%;
  min-height: 160px;
  height: 200px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
}

.signature-canvas:hover {
  border-color: var(--cap-k-green);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 0 3px rgba(26, 122, 74, 0.1);
}

.signature-canvas.signing {
  cursor: crosshair;
}

.signature-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.clear-signature {
  background: var(--gradient-secondary);
  border: none;
  color: white;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.clear-signature:hover {
  background: linear-gradient(135deg, var(--cap-k-gold-light), var(--cap-k-gold));
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* SIG checkboxes (public registration) */
.sig-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.sig-checkbox-wrap .sig-form-check {
  padding-left: 0;
  margin-bottom: 0;
}
.sig-checkbox-wrap .sig-form-check label {
  margin-left: 0;
  font-weight: 500;
  cursor: pointer;
}

