/* ── COREnx Registration Form ── */

.cnreg-wrapper {
  max-width: 580px;
  margin: 0 auto;
  font-family: Montserrat, 'Segoe UI', Arial, sans-serif;
  color: #1a1a2e;
}

/* Form card */
.cnreg-form {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 4px 32px rgba(10, 30, 60, 0.10);
  overflow: hidden;
}

/* Header */
.cnreg-header {
  background: linear-gradient(135deg, #0f2d47 0%, #226493 100%);
  padding: 28px 32px 24px;
  color: #fff;
}

.cnreg-step-indicator {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 18px;
}

.cnreg-step {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.6);
  border: 2px solid rgba(255,255,255,0.25);
  flex-shrink: 0;
  transition: all .25s;
}

.cnreg-step.active {
  background: #fff;
  color: #0f2d47;
  border-color: #fff;
}

.cnreg-step.done {
  background: #d4541a;
  color: #fff;
  border-color: #d4541a;
}

.cnreg-step-line {
  flex: 1;
  height: 2px;
  background: rgba(255,255,255,0.2);
  margin: 0 8px;
}

.cnreg-step-line.active {
  background: rgba(255,255,255,0.6);
}

.cnreg-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 6px;
  color: #fff;
}

.cnreg-subtitle {
  font-size: 13px;
  margin: 0;
  color: rgba(255,255,255,0.75);
}

/* Body */
.cnreg-body {
  padding: 28px 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Field */
.cnreg-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cnreg-field label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.cnreg-req {
  color: #d4541a;
}

.cnreg-field input[type="text"],
.cnreg-field input[type="email"],
.cnreg-field input[type="tel"],
.cnreg-field input[type="url"] {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: #1a1a2e;
  background: #f9fafb;
  transition: border-color .2s, box-shadow .2s, background .2s;
  outline: none;
}

.cnreg-field input:focus {
  border-color: #226493;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(34, 100, 147, 0.12);
}

.cnreg-field-hint {
  font-size: 12px;
  color: #6b7280;
  min-height: 16px;
}

.cnreg-hint-ok  { color: #059669 !important; }
.cnreg-hint-err { color: #dc2626 !important; }

/* Row layout */
.cnreg-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.cnreg-field--grow { flex: 1; }
.cnreg-field--cap  { flex: 0 0 100px; }
.cnreg-field--prov { flex: 0 0 80px; }

/* P.IVA row */
.cnreg-piva-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.cnreg-piva-row input {
  flex: 1;
}

.cnreg-piva-btn {
  padding: 10px 18px;
  background: #226493;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: background .2s;
  flex-shrink: 0;
}

.cnreg-piva-btn:hover:not(:disabled) { background: #0f2d47; }
.cnreg-piva-btn:disabled { opacity: .6; cursor: default; }

/* Consents */
.cnreg-consents {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cnreg-check-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: #374151;
  line-height: 1.5;
  cursor: pointer;
}

.cnreg-check-label input[type="checkbox"] {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: #226493;
  flex-shrink: 0;
}

.cnreg-check-label a {
  color: #226493;
  text-decoration: underline;
}

/* Error box */
.cnreg-error {
  display: none;
  padding: 10px 14px;
  background: #fef2f2;
  border: 1.5px solid #fca5a5;
  border-radius: 10px;
  font-size: 13px;
  color: #dc2626;
  font-weight: 500;
}

/* Buttons */
.cnreg-btn {
  padding: 12px 24px;
  background: linear-gradient(135deg, #226493 0%, #0f2d47 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity .2s, transform .15s;
  align-self: flex-end;
}

.cnreg-btn:hover:not(:disabled) { opacity: .9; transform: translateY(-1px); }
.cnreg-btn:active:not(:disabled) { transform: translateY(0); }
.cnreg-btn:disabled { opacity: .6; cursor: default; }

.cnreg-btn--ghost {
  background: transparent;
  color: #226493;
  border: 1.5px solid #226493;
}

.cnreg-btn--ghost:hover:not(:disabled) { background: #f0f7ff; opacity: 1; }

.cnreg-btn-row {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
}

/* Spinner */
.cnreg-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: cnreg-spin .7s linear infinite;
}

.cnreg-piva-btn .cnreg-spinner {
  border-color: rgba(255,255,255,0.4);
  border-top-color: #fff;
}

@keyframes cnreg-spin { to { transform: rotate(360deg); } }

/* Success */
.cnreg-success {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 4px 32px rgba(10, 30, 60, 0.10);
  padding: 56px 32px 48px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.cnreg-success-icon {
  margin-bottom: 8px;
}

.cnreg-success-title {
  font-size: 22px;
  font-weight: 700;
  color: #0f2d47;
  margin: 0;
}

.cnreg-success-msg {
  font-size: 15px;
  color: #374151;
  line-height: 1.6;
  margin: 0;
}

/* Mobile */
@media (max-width: 600px) {
  .cnreg-header { padding: 22px 20px 20px; }
  .cnreg-body   { padding: 20px 20px 24px; }
  .cnreg-row    { grid-template-columns: 1fr; gap: 12px; }
  .cnreg-btn    { align-self: stretch; width: 100%; justify-content: center; }
  .cnreg-btn-row { flex-direction: column-reverse; }
  .cnreg-btn--ghost { width: 100%; }
  .cnreg-piva-btn { padding: 10px 14px; }
}
