/* =============================================
   kreamart Sign Up Page — Stylesheet
   Font: DM Sans (body) + Sora (headings)
   ============================================= */

/* ── Variables ─────────────────────────────── */
:root {
  --orange:        #F97316;
  --orange-hover:  #EA6A0A;
  --navy:          #1B2A4A;
  --navy-mid:      #243560;
  --navy-dark:     #111D35;
  --white:         #FFFFFF;
  --off-white:     #F8F9FB;
  --text-primary:  #1A1A2E;
  --text-muted:    #7A8399;
  --border:        #E4E8F0;
  --input-bg:      #F5F7FA;
  --error:         #EF4444;
  --success:       #22C55E;
  --radius-sm:     6px;
  --radius-md:     12px;
  --radius-lg:     20px;
  --shadow-card:   0 24px 64px rgba(0,0,0,0.14), 0 4px 16px rgba(0,0,0,0.08);
  --shadow-btn:    0 4px 14px rgba(249,115,22,0.38);
  --font-body:     'DM Sans', sans-serif;
  --font-display:  'Sora', sans-serif;
  --transition:    0.2s ease;
}

/* ── Reset ─────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--off-white);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* ── Page Background ────────────────────────── */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: linear-gradient(135deg, #dce8ff 0%, #f0e8ff 40%, #ffe8d6 100%);
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.45;
  animation: blobFloat 8s ease-in-out infinite alternate;
}

.blob-1 {
  width: 520px;
  height: 520px;
  background: #a5c8ff;
  top: -120px;
  left: -100px;
}

.blob-2 {
  width: 420px;
  height: 420px;
  background: #ffc6a0;
  bottom: -100px;
  right: -80px;
  animation-delay: -4s;
}

@keyframes blobFloat {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(24px,32px) scale(1.06); }
}

/* ── Card Wrapper ───────────────────────────── */
.card-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 820px;
  padding: 24px;
  animation: cardIn 0.6s cubic-bezier(0.22,1,0.36,1) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Card ───────────────────────────────────── */
.card {
  display: flex;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  background: var(--white);
  min-height: 500px;
}

/* ── LEFT PANEL (Promo / Welcome) ───────────── */
.panel-left {
  width: 280px;
  flex-shrink: 0;
  background: linear-gradient(145deg, var(--navy-mid) 0%, var(--navy-dark) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 32px 28px 40px;
  position: relative;
  overflow: hidden;
  text-align: center;
}

/* Decorative shapes */
.promo-deco {
  position: absolute;
  pointer-events: none;
}

.deco-circle-lg {
  width: 210px;
  height: 210px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.07);
  bottom: -70px;
  left: -70px;
  animation: rotateSlowly 18s linear infinite;
}

.deco-circle-sm {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.06);
  top: -40px;
  right: -40px;
  animation: rotateSlowly 12s linear infinite reverse;
}

.deco-triangle-1 {
  width: 0;
  height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-bottom: 32px solid rgba(255,255,255,0.07);
  top: 110px;
  left: 32px;
  animation: floatY 5s ease-in-out infinite alternate;
}

.deco-triangle-2 {
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-bottom: 22px solid rgba(255,255,255,0.05);
  bottom: 110px;
  right: 28px;
  animation: floatY 7s ease-in-out infinite alternate-reverse;
}

@keyframes rotateSlowly {
  to { transform: rotate(360deg); }
}

@keyframes floatY {
  from { transform: translateY(0); }
  to   { transform: translateY(14px); }
}

/* Logo */
.promo-logo {
  align-self: flex-start;
}

.logo-mark {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--orange);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(249,115,22,0.45);
}

.logo-mark-orange {
  background: var(--orange);
}

/* Promo content */
.promo-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.promo-heading {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.promo-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  line-height: 1.65;
  margin-bottom: 8px;
}

/* Login redirect button */
.btn-login-redirect {
  display: inline-block;
  padding: 10px 32px;
  border: 1.5px solid rgba(255,255,255,0.35);
  border-radius: 999px;
  background: transparent;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.btn-login-redirect:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.6);
  transform: translateY(-2px);
}

.btn-login-redirect:active {
  transform: translateY(0);
}

/* ── RIGHT PANEL (Sign Up Form) ─────────────── */
.panel-right {
  flex: 1;
  padding: 36px 40px 36px;
  display: flex;
  flex-direction: column;
  background: var(--white);
}

.brand-top {
  display: none; /* hidden on desktop; shown on mobile */
  margin-bottom: 20px;
}

.form-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  text-align: center;
}

/* Google button */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--white);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.btn-google:hover {
  background: var(--off-white);
  border-color: #c8d0de;
  transform: translateY(-1px);
}

.btn-google:active {
  transform: translateY(0);
}

.google-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 12px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Form Fields ────────────────────────────── */
.signup-form {
  display: flex;
  flex-direction: column;
}

.field-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 13px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
}

.input-wrap input {
  width: 100%;
  padding: 11px 40px 11px 38px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--input-bg);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.input-wrap input::placeholder {
  color: var(--text-muted);
}

.input-wrap input:focus {
  border-color: var(--orange);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.12);
}

.input-wrap input.is-error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.10);
}

.field-error {
  font-size: 11.5px;
  color: var(--error);
  margin-top: 4px;
  min-height: 15px;
  padding-left: 2px;
  animation: errorIn 0.2s ease;
}

@keyframes errorIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Password toggle */
.toggle-pw {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color var(--transition);
}

.toggle-pw:hover {
  color: var(--text-primary);
}

.eye-icon {
  width: 16px;
  height: 16px;
}

/* ── Password Strength ──────────────────────── */
.strength-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  margin-top: -4px;
  opacity: 0;
  transition: opacity var(--transition);
}

.strength-wrap.visible {
  opacity: 1;
}

.strength-bar {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.35s ease, background 0.35s ease;
}

.strength-label {
  font-size: 11px;
  font-weight: 500;
  min-width: 44px;
  text-align: right;
  color: var(--text-muted);
  transition: color var(--transition);
}

/* ── Terms Checkbox ─────────────────────────── */
.terms-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkbox-custom {
  width: 17px;
  height: 17px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  background: var(--input-bg);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition);
  position: relative;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
  background: var(--orange);
  border-color: var(--orange);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
  content: '';
  display: block;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translate(-1px, -1px);
}

.terms-text {
  font-size: 13px;
  color: var(--text-muted);
}

.terms-link {
  color: var(--orange);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}

.terms-link:hover {
  color: var(--orange-hover);
  text-decoration: underline;
}

/* ── Sign Up Button ─────────────────────────── */
.btn-signup {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--orange);
  color: #fff;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-btn);
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  overflow: hidden;
}

.btn-signup::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 100%);
  pointer-events: none;
}

.btn-signup:hover {
  background: var(--orange-hover);
  box-shadow: 0 6px 20px rgba(249,115,22,0.46);
  transform: translateY(-1px);
}

.btn-signup:active {
  transform: translateY(0);
}

.btn-signup:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

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

.btn-spinner.visible {
  display: block;
}

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

/* Login hint */
.login-hint {
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 14px;
}

.login-hint a {
  color: var(--orange);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}

.login-hint a:hover {
  color: var(--orange-hover);
  text-decoration: underline;
}

/* ── Toast ──────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy-dark);
  color: #fff;
  font-size: 13.5px;
  font-family: var(--font-body);
  padding: 11px 22px;
  border-radius: 999px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 999;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success { background: #15803d; }
.toast.error   { background: #b91c1c; }

/* ── Responsive ─────────────────────────────── */
@media (max-width: 640px) {
  .card {
    flex-direction: column-reverse;
  }

  .panel-left {
    width: 100%;
    min-height: 200px;
    padding: 28px 28px 32px;
    justify-content: center;
    gap: 16px;
  }

  .promo-logo {
    display: none;
  }

  .brand-top {
    display: flex;
  }

  .panel-right {
    padding: 28px 24px 24px;
  }
}