/* === SellSync Sign-Up — Blue & white brand === */
:root {
  --brand-blue: #2979FF;
  --brand-blue-dark: #007bff;
  --brand-blue-hover: #1a6ef5;
  --brand-blue-soft: #e8f2ff;
  --brand-blue-glow: rgba(41, 121, 255, 0.18);
  --text-dark: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  width: 100%;
  font-family: 'Segoe UI', system-ui, sans-serif;
  background-color: #ffffff;
  color: var(--text-dark);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.signup-container {
  display: flex;
  min-height: 100vh;
  flex-wrap: wrap;
}

/* --- Left panel (brand) --- */
.left-panel {
  flex: 1 1 42%;
  min-height: 40vh;
  background: linear-gradient(160deg, #ffffff 0%, #f5f9ff 40%, #e8f2ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  position: relative;
  overflow: hidden;
}

.left-panel::before {
  content: '';
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(41, 121, 255, 0.14) 0%, transparent 68%);
  top: -120px;
  right: -80px;
  pointer-events: none;
}

.left-panel::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(41, 121, 255, 0.08) 0%, transparent 70%);
  bottom: -60px;
  left: -40px;
  pointer-events: none;
}

.brand-content {
  text-align: center;
  max-width: 360px;
  position: relative;
  z-index: 1;
}

.brand-logo {
  width: 160px;
  height: 160px;
  object-fit: contain;
  display: block;
  margin: 0 auto 20px;
  opacity: 0;
  animation: logoFadeIn 0.8s ease-out forwards;
}

.brand-content h1 {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 700;
  margin: 0 0 14px;
  letter-spacing: -0.03em;
  color: var(--text-dark);
  opacity: 0;
  animation: fadeUp 0.6s ease-out 0.6s forwards;
}

.brand-content h1 span {
  color: var(--brand-blue);
}

.value-statement {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin: 0 0 36px;
  font-weight: 500;
  line-height: 1.5;
  opacity: 0;
  animation: fadeUp 0.6s ease-out 0.85s forwards;
}

/* Step progress on brand panel */
.step-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  opacity: 0;
  animation: fadeUp 0.6s ease-out 1.1s forwards;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 72px;
}

.progress-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  background: #fff;
  border: 2px solid var(--border);
  color: var(--text-muted);
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.progress-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.25s ease;
}

.progress-line {
  width: 40px;
  height: 2px;
  background: var(--border);
  margin-bottom: 24px;
  flex-shrink: 0;
  transition: background-color 0.25s ease;
}

.progress-step.active .progress-dot {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #fff;
  box-shadow: 0 4px 14px rgba(41, 121, 255, 0.35);
}

.progress-step.active .progress-label {
  color: var(--brand-blue);
}

.progress-step.completed .progress-dot {
  background: var(--brand-blue-soft);
  border-color: var(--brand-blue);
  color: var(--brand-blue);
}

.progress-step.completed .progress-label {
  color: var(--text-dark);
}

.progress-step.completed + .progress-line {
  background: var(--brand-blue);
}

@keyframes logoFadeIn {
  0%   { opacity: 0; transform: scale(0.92); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes fadeUp {
  0%   { opacity: 0; transform: translateY(14px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* --- Right panel (form) --- */
.right-panel {
  flex: 1 1 58%;
  min-height: 60vh;
  background-color: #ffffff;
  color: var(--text-dark);
  padding: 48px 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid var(--border);
}

.signup-card {
  width: 100%;
  max-width: 440px;
  opacity: 0;
  animation: fadeUp 0.7s ease-out 0.35s forwards;
}

/* --- Form header --- */
.signup-header {
  margin-bottom: 28px;
}

.form-title {
  font-size: 1.85rem;
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.25;
  color: var(--text-dark);
  letter-spacing: -0.02em;
}

.form-subtitle {
  font-size: 0.975rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* --- Form message --- */
.form-message {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.95rem;
  margin-bottom: 20px;
  display: none;
}

.form-message.visible {
  display: block;
}

.form-message.success {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.form-message.error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* --- Steps --- */
.step {
  display: block;
}

.step[hidden] {
  display: none !important;
}

.step-label {
  font-size: 0.85rem;
  color: var(--brand-blue);
  margin: 0 0 20px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.step-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0 0 20px;
  line-height: 1.5;
}

/* --- Form fields --- */
form {
  display: flex;
  flex-direction: column;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.925rem;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.field input:not([type="radio"]),
.field select {
  width: 100%;
  padding: 13px 16px;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: #fafbfc;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.field input:not([type="radio"])::placeholder {
  color: #9ca3af;
}

.field input:not([type="radio"]):hover,
.field select:hover {
  border-color: #d1d5db;
  background: #fff;
}

.field input:not([type="radio"]):focus,
.field select:focus {
  border-color: var(--brand-blue);
  background: #fff;
  box-shadow: 0 0 0 4px var(--brand-blue-glow);
}

.field input:not([type="radio"]).error,
.field select.error {
  border-color: #dc2626;
  background: #fffafa;
}

.field input:not([type="radio"]).error:focus,
.field select.error:focus {
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}

.field select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

/* Password wrapper + show/hide toggle */
.password-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
}

.password-wrap input {
  padding-right: 48px;
  flex: 1;
}

.toggle-password {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: calc(100% - 8px);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.toggle-password:hover {
  color: var(--brand-blue);
  background: var(--brand-blue-soft);
}

.toggle-password:focus {
  outline: none;
  color: var(--brand-blue);
}

/* Eye icons */
.icon-eye,
.icon-eye-off {
  display: inline-block;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.icon-eye {
  width: 22px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 50% 50% 0 0;
  margin-top: -4px;
}

.icon-eye::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.icon-eye-off {
  width: 22px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 50% 50% 0 0;
  margin-top: -4px;
  display: none;
}

.icon-eye-off::after {
  content: '';
  position: absolute;
  width: 28px;
  height: 2px;
  background: currentColor;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
  border-radius: 1px;
}

.toggle-password[aria-pressed="true"] .icon-eye {
  display: none;
}

.toggle-password[aria-pressed="true"] .icon-eye-off {
  display: inline-block;
}

.field-error {
  display: block;
  font-size: 0.85rem;
  color: #dc2626;
  margin-top: 6px;
  min-height: 1.2em;
}

/* --- Role options --- */
.role-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}

.role-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 10px 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: #fafbfc;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  user-select: none;
  flex: 1;
  min-width: 0;
  justify-content: center;
}

.role-option:hover {
  border-color: #d1d5db;
  background: #fff;
}

.role-option input {
  width: 18px;
  height: 18px;
  min-width: 18px;
  accent-color: var(--brand-blue);
  cursor: pointer;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
}

.role-option input:checked + span {
  color: var(--brand-blue);
}

.role-option:has(input:checked) {
  border-color: var(--brand-blue);
  background: var(--brand-blue-soft);
}

/* --- Buttons --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-blue-dark) 100%);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  margin-top: 8px;
  min-height: 48px;
  position: relative;
  overflow: hidden;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(41, 121, 255, 0.35);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:focus {
  outline: none;
  box-shadow: 0 0 0 4px var(--brand-blue-glow);
}

.btn-primary:disabled {
  cursor: not-allowed;
  opacity: 0.8;
}

.btn-loader {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-primary.loading .btn-text {
  visibility: hidden;
  position: absolute;
}

.btn-primary.loading .btn-loader {
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Step 3: Skip + Save */
.step3-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.btn-skip {
  width: 100%;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
  min-height: 48px;
}

.btn-skip:hover {
  border-color: #d1d5db;
  color: var(--text-dark);
  background: #f9fafb;
}

.btn-skip:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.06);
}

/* --- Google Sign-Up Section --- */
.google-signup-section {
  margin-bottom: 28px;
}

.g_id_signin {
  width: 100% !important;
  margin-bottom: 20px;
}

.g_id_signin > iframe {
  width: 100% !important;
  border-radius: 10px !important;
}

.divider {
  position: relative;
  text-align: center;
  margin: 24px 0;
}

.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background-color: var(--border);
}

.divider span {
  background-color: #fff;
  padding: 0 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
  position: relative;
  z-index: 1;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background-color: var(--brand-blue-soft);
  border-radius: 12px;
  margin-bottom: 24px;
  border: 2px solid rgba(41, 121, 255, 0.2);
}

.user-picture {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--brand-blue);
}

.user-details {
  flex: 1;
}

.user-name {
  margin: 0 0 4px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
}

.user-email {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.google-continue-btn {
  white-space: nowrap;
  padding: 12px 20px;
}

/* --- Footer --- */
.signup-footer {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.trust-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 16px;
}

.login-prompt {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
}

.login-prompt a {
  color: var(--brand-blue);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.login-prompt a:hover {
  color: var(--brand-blue-hover);
  text-decoration: underline;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .signup-container {
    flex-direction: column;
  }

  .left-panel {
    min-height: auto;
    padding: 40px 24px 32px;
    border-bottom: 1px solid var(--border);
  }

  .brand-logo {
    width: 120px;
    height: 120px;
    margin-bottom: 14px;
  }

  .brand-content h1 {
    font-size: 2rem;
    margin-bottom: 8px;
  }

  .value-statement {
    font-size: 1rem;
    margin-bottom: 28px;
  }

  .step-progress {
    gap: 0;
  }

  .progress-step {
    min-width: 60px;
  }

  .progress-line {
    width: 24px;
  }

  .progress-label {
    font-size: 0.72rem;
  }

  .right-panel {
    min-height: auto;
    padding: 32px 24px 40px;
    border-left: none;
    align-items: flex-start;
  }

  .form-title {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .field input:not([type="radio"]),
  .field select {
    padding: 14px 16px;
    min-height: 48px;
  }

  .role-options {
    flex-direction: column;
  }

  .role-option {
    justify-content: flex-start;
  }

  .user-info {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .google-continue-btn {
    width: 100%;
  }
}
