/* =============================================
   Customer Registration Form – form.css
   ============================================= */

:root {
  --cr-accent:       #2563EB;
  --cr-accent-hover: #1d4ed8;
  --cr-radius:       12px;
  --cr-gap:          18px;
  --cr-font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --cr-border:       #d1d5db;
  --cr-border-focus: #2563EB;
  --cr-bg:           #f8fafc;
  --cr-card-bg:      #ffffff;
  --cr-text:         #111827;
  --cr-muted:        #6b7280;
  --cr-error-bg:     #fef2f2;
  --cr-error-border: #fca5a5;
  --cr-error-text:   #dc2626;
  --cr-success-bg:   #f0fdf4;
  --cr-success-border:#86efac;
  --cr-success-text: #16a34a;
}

/* Wrapper */
.cr-wrapper {
  min-height: 60vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
  background: var(--cr-bg);
  font-family: var(--cr-font);
}

/* Card */
.cr-card {
  width: 100%;
  max-width: 520px;
  background: var(--cr-card-bg);
  border-radius: 20px;
  box-shadow:
    0 1px 3px rgba(0,0,0,.06),
    0 8px 24px rgba(0,0,0,.08),
    0 0 0 1px rgba(0,0,0,.04);
  overflow: hidden;
}

/* Header */
.cr-header {
  background: var(--cr-accent);
  padding: 40px 40px 32px;
  text-align: center;
}

.cr-logo-ring {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  border: 2px solid rgba(255,255,255,.45);
  margin-bottom: 16px;
  color: #fff;
}
.cr-logo-ring svg { width: 30px; height: 30px; }

.cr-title {
  margin: 0 0 6px;
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.4px;
}
.cr-subtitle {
  margin: 0;
  color: rgba(255,255,255,.8);
  font-size: 14px;
}

/* Alerts */
.cr-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 20px;
  font-size: 14px;
  line-height: 1.5;
  border-left: 4px solid transparent;
}
.cr-alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.cr-alert--error   { background: var(--cr-error-bg);   border-color: var(--cr-error-text);   color: var(--cr-error-text); }
.cr-alert--success { background: var(--cr-success-bg); border-color: var(--cr-success-text); color: var(--cr-success-text); }

/* Form body */
.cr-form {
  padding: 32px 40px 28px;
  display: flex;
  flex-direction: column;
  gap: var(--cr-gap);
}

.cr-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--cr-gap);
}

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

.cr-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--cr-text);
  letter-spacing: 0.01em;
}
.cr-optional {
  font-weight: 400;
  color: var(--cr-muted);
}

.cr-field input[type="text"],
.cr-field input[type="email"],
.cr-field input[type="tel"],
.cr-field input[type="password"] {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  font-size: 15px;
  font-family: var(--cr-font);
  color: var(--cr-text);
  background: #fafafa;
  border: 1.5px solid var(--cr-border);
  border-radius: 8px;
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
  -webkit-appearance: none;
}

.cr-field input:focus {
  border-color: var(--cr-border-focus);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* Password with toggle */
.cr-password-wrap {
  position: relative;
}
.cr-password-wrap input {
  padding-right: 44px;
}
.cr-toggle-pw {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--cr-muted);
  line-height: 0;
}
.cr-toggle-pw:hover { color: var(--cr-text); }
.cr-toggle-pw svg { width: 18px; height: 18px; }

/* Strength bar */
.cr-strength-bar {
  height: 3px;
  background: #e5e7eb;
  border-radius: 99px;
  overflow: hidden;
}
.cr-strength-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  transition: width .3s ease, background .3s ease;
}
.cr-strength-label {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  min-height: 18px;
}

/* Checkbox */
.cr-field--checkbox { gap: 0; }
.cr-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--cr-muted);
  line-height: 1.5;
}
.cr-checkbox-label input[type="checkbox"] { display: none; }
.cr-checkmark {
  flex-shrink: 0;
  margin-top: 2px;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--cr-border);
  border-radius: 4px;
  background: #fafafa;
  position: relative;
  transition: border-color .15s, background .15s;
}
.cr-checkbox-label input:checked ~ .cr-checkmark {
  background: var(--cr-accent);
  border-color: var(--cr-accent);
}
.cr-checkbox-label input:checked ~ .cr-checkmark::after {
  content: '';
  position: absolute;
  left: 4px; top: 1px;
  width: 5px; height: 9px;
  border: 2px solid #fff;
  border-top: none; border-left: none;
  transform: rotate(45deg);
}
.cr-checkbox-label a { color: var(--cr-accent); }

/* Submit */
.cr-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 20px;
  background: var(--cr-accent);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  font-family: var(--cr-font);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background .18s, transform .12s, box-shadow .18s;
  margin-top: 4px;
}
.cr-submit:hover {
  background: var(--cr-accent-hover);
  box-shadow: 0 4px 14px rgba(37,99,235,.35);
  transform: translateY(-1px);
}
.cr-submit:active { transform: translateY(0); }
.cr-submit-arrow { width: 18px; height: 18px; transition: transform .2s; }
.cr-submit:hover .cr-submit-arrow { transform: translateX(3px); }

/* Login link */
.cr-login-link {
  margin: 0;
  padding: 20px 40px;
  text-align: center;
  font-size: 14px;
  color: var(--cr-muted);
  border-top: 1px solid #f1f3f5;
}
.cr-login-link a {
  color: var(--cr-accent);
  font-weight: 600;
  text-decoration: none;
}
.cr-login-link a:hover { text-decoration: underline; }

/* Already logged in */
.cr-already-logged-in {
  text-align: center;
  padding: 32px;
  color: var(--cr-muted);
  font-family: var(--cr-font);
}

/* Responsive */
@media (max-width: 540px) {
  .cr-header    { padding: 32px 24px 24px; }
  .cr-form      { padding: 24px 20px 20px; }
  .cr-login-link{ padding: 16px 20px; }
  .cr-row       { grid-template-columns: 1fr; }
  .cr-alert     { padding: 12px 16px; }
}

/* Password hint */
.cr-hint {
  margin: 0;
  font-size: 12px;
  color: var(--cr-muted);
  line-height: 1.5;
}
.cr-hint strong { color: #374151; }

/* Inline error (JS-injected) */
.cr-inline-error {
  border-radius: 8px;
  margin-bottom: 4px;
}

/* Per-field inline errors */
.cr-field-error {
  display: block;
  min-height: 0;
  font-size: 12px;
  color: var(--cr-error-text);
  line-height: 1.4;
  margin-top: 2px;
}
.cr-field--invalid input,
.cr-field--invalid .cr-password-wrap input {
  border-color: var(--cr-error-text) !important;
}
.cr-field--invalid input:focus {
  box-shadow: 0 0 0 3px rgba(220,38,38,.12) !important;
}

/* reCAPTCHA notice */
.cr-recaptcha-notice {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--cr-muted);
  text-align: center;
  line-height: 1.5;
}
.cr-recaptcha-notice a { color: var(--cr-muted); }
