/* =========================================
   Shopscan Design System — Signup Page
   ========================================= */

/* -- Design Tokens ----------------------- */
:root {
  /* Brand — Shopscan purple palette (from design system) */
  --color-brand-50:  #f3e8ff;
  --color-brand-100: #e9d5ff;
  --color-brand-200: #d8b4fe;
  --color-brand-500: #7c3aed;
  --color-brand-600: #6200ee;
  --color-brand-700: #4a00b4;

  /* Neutrals */
  --color-white:      #ffffff;
  --color-gray-50:    #f9fafb;
  --color-gray-100:   #f3f4f6;
  --color-gray-200:   #e5e7eb;
  --color-gray-300:   #d1d5db;
  --color-gray-400:   #9ca3af;
  --color-gray-500:   #6b7280;
  --color-gray-700:   #374151;
  --color-gray-900:   #111827;

  /* Semantic */
  --color-success:  #10b981;
  --color-warning:  #f59e0b;
  --color-danger:   #ef4444;

  /* Typography */
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  --font-size-xs:   0.75rem;   /* 12px */
  --font-size-sm:   0.875rem;  /* 14px */
  --font-size-md:   1rem;      /* 16px */
  --font-size-lg:   1.125rem;  /* 18px */
  --font-size-xl:   1.25rem;   /* 20px */
  --font-size-2xl:  1.5rem;    /* 24px */

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* Radius */
  --radius-sm:  0.375rem;  /* 6px */
  --radius-md:  0.5rem;    /* 8px */
  --radius-lg:  0.75rem;   /* 12px */
  --radius-xl:  1rem;      /* 16px */
  --radius-2xl: 1.5rem;    /* 24px */
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md:  0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg:  0 10px 24px -3px rgb(0 0 0 / 0.08), 0 4px 8px -4px rgb(0 0 0 / 0.05);
  --shadow-xl:  0 20px 48px -8px rgb(0 0 0 / 0.12), 0 8px 16px -8px rgb(0 0 0 / 0.06);

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-normal: 200ms ease;
}

/* -- Reset ------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-family);
  font-size: var(--font-size-md);
  color: var(--color-gray-900);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, button { outline: none; }
svg { display: block; flex-shrink: 0; }

/* -- Layout ------------------------------ */
.page {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: var(--space-6) var(--space-4);
  overflow: hidden;
}

/* Decorative background blobs */
.bg-blob {
  position: absolute;
  border-radius: var(--radius-full);
  pointer-events: none;
  z-index: 0;
}
.bg-blob--1 {
  width: 560px;
  height: 560px;
  background: radial-gradient(circle, #e9d5ff 0%, transparent 65%);
  top: -160px;
  right: -180px;
  opacity: 0.55;
}
.bg-blob--2 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, #f3e8ff 0%, transparent 65%);
  bottom: -130px;
  left: -130px;
  opacity: 0.5;
}

/* -- Card -------------------------------- */
.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: var(--color-white);
  border: 1px solid var(--color-gray-100);
  border-radius: var(--radius-2xl);
  padding: var(--space-10) var(--space-10);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* -- Brand / Logo ------------------------ */
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.brand__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #7c3aed 0%, #6200ee 100%);
  color: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 10px rgb(98 0 238 / 0.4);
}
.brand__name {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-gray-900);
  letter-spacing: -0.02em;
}

/* -- Card header ------------------------- */
.card__header {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.heading-lg {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--color-gray-900);
  letter-spacing: -0.025em;
  line-height: 1.25;
}
.text-secondary {
  font-size: var(--font-size-sm);
  color: var(--color-gray-500);
  line-height: 1.5;
}

/* -- Social button ----------------------- */
.social-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* -- Divider ----------------------------- */
.divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-gray-200);
}
.divider__text {
  font-size: var(--font-size-xs);
  font-weight: 500;
  color: var(--color-gray-400);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* -- Form -------------------------------- */
.form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.form-row--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

/* -- Field ------------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.field__error {
  font-size: var(--font-size-xs);
  color: var(--color-danger);
  min-height: 1em;
  display: none;
}
.field__error.visible {
  display: block;
}

/* -- Label ------------------------------- */
.label {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-gray-700);
}

/* -- Input ------------------------------- */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.input {
  width: 100%;
  height: 44px;
  padding: 0 var(--space-4);
  font-size: var(--font-size-sm);
  font-family: var(--font-family);
  color: var(--color-gray-900);
  background: var(--color-white);
  border: 1.5px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}
.input::placeholder {
  color: var(--color-gray-400);
}
.input:hover:not(:disabled) {
  border-color: var(--color-gray-300);
}
.input:focus {
  border-color: var(--color-brand-500);
  box-shadow: 0 0 0 3px var(--color-brand-100);
  background: var(--color-white);
}
.input.input--error {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 3px rgb(239 68 68 / 0.12);
}
.input.input--success {
  border-color: var(--color-success);
}
.input--icon-left  { padding-left: 2.5rem; }
.input--icon-right { padding-right: 2.5rem; }

/* Input icons */
.input-icon {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gray-400);
  pointer-events: none;
  transition: color var(--transition-fast);
}
.input-icon--left  { left: var(--space-3); }
.input-icon--right { right: var(--space-3); }
.input:focus ~ .input-icon--left,
.input-icon--left:has(+ .input:focus) { color: var(--color-brand-500); }
.input-icon--btn {
  pointer-events: auto;
  cursor: pointer;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
}
.input-icon--btn:hover {
  color: var(--color-gray-600);
  background: var(--color-gray-100);
}
.input-icon--btn:focus-visible {
  outline: 2px solid var(--color-brand-500);
  outline-offset: 1px;
}

/* -- Password strength ------------------- */
.password-strength {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-1);
  min-height: 1.25rem;
}
.password-strength__bars {
  display: flex;
  gap: var(--space-1);
  flex: 1;
}
.strength-bar {
  flex: 1;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--color-gray-200);
  transition: background var(--transition-normal);
}
.strength-bar.active-1 { background: var(--color-danger); }
.strength-bar.active-2 { background: var(--color-warning); }
.strength-bar.active-3 { background: #84cc16; }
.strength-bar.active-4 { background: var(--color-success); }
.password-strength__label {
  font-size: var(--font-size-xs);
  font-weight: 500;
  color: var(--color-gray-400);
  white-space: nowrap;
  min-width: 48px;
  text-align: right;
}
.password-strength__label.s1 { color: var(--color-danger); }
.password-strength__label.s2 { color: var(--color-warning); }
.password-strength__label.s3 { color: #65a30d; }
.password-strength__label.s4 { color: var(--color-success); }

/* -- Checkbox ---------------------------- */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
  user-select: none;
}
.checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.checkbox-custom {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 1.5px solid var(--color-gray-300);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}
.checkbox-custom::after {
  content: '';
  display: block;
  width: 10px;
  height: 6px;
  border-left: 2px solid var(--color-white);
  border-bottom: 2px solid var(--color-white);
  transform: rotate(-45deg) scale(0);
  transition: transform var(--transition-fast);
  margin-top: -1px;
}
.checkbox:checked + .checkbox-custom {
  background: var(--color-brand-600);
  border-color: var(--color-brand-600);
}
.checkbox:checked + .checkbox-custom::after {
  transform: rotate(-45deg) scale(1);
}
.checkbox:focus-visible + .checkbox-custom {
  box-shadow: 0 0 0 3px var(--color-brand-100);
  border-color: var(--color-brand-500);
}
.checkbox-label:hover .checkbox-custom {
  border-color: var(--color-brand-400, #818cf8);
}
.checkbox-text {
  font-size: var(--font-size-sm);
  color: var(--color-gray-600, #4b5563);
  line-height: 1.5;
}

/* -- Link -------------------------------- */
.link {
  color: var(--color-brand-600);
  font-weight: 500;
  transition: color var(--transition-fast);
}
.link:hover { color: var(--color-brand-700); text-decoration: underline; }
.link--bold  { font-weight: 600; }

/* -- Buttons ----------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 44px;
  padding: 0 var(--space-6);
  font-size: var(--font-size-sm);
  font-weight: 600;
  font-family: var(--font-family);
  border-radius: var(--radius-lg);
  transition: background var(--transition-fast), border-color var(--transition-fast),
              color var(--transition-fast), box-shadow var(--transition-fast),
              transform var(--transition-fast), opacity var(--transition-fast);
  white-space: nowrap;
}
.btn:focus-visible {
  outline: 2px solid var(--color-brand-500);
  outline-offset: 2px;
}
.btn:active { transform: translateY(1px); }

/* Primary */
.btn--primary {
  background: linear-gradient(135deg, #7c3aed 0%, #6200ee 100%);
  color: var(--color-white);
  box-shadow: 0 1px 2px rgb(98 0 238 / 0.25), inset 0 1px 0 rgb(255 255 255 / 0.1);
}
.btn--primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #6d28d9 0%, #4a00b4 100%);
  box-shadow: 0 4px 16px rgb(98 0 238 / 0.35);
}
.btn--primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* Outline */
.btn--outline {
  background: var(--color-white);
  border: 1.5px solid var(--color-gray-200);
  color: var(--color-gray-700);
  box-shadow: var(--shadow-sm);
}
.btn--outline:hover:not(:disabled) {
  border-color: var(--color-gray-300);
  background: var(--color-gray-50);
  box-shadow: var(--shadow-md);
}

/* Full width */
.btn--full { width: 100%; }

/* Social button */
.btn--social {
  font-weight: 500;
  letter-spacing: 0;
}

/* Spinner */
.spin {
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* -- Card footer ------------------------- */
.card__footer {
  font-size: var(--font-size-sm);
  color: var(--color-gray-500);
  text-align: center;
  line-height: 1.5;
}

/* -- Responsive -------------------------- */
@media (max-width: 480px) {
  .card {
    padding: var(--space-8) var(--space-6);
    border-radius: var(--radius-xl);
  }
  .form-row--split {
    grid-template-columns: 1fr;
  }
}
