/* =============================================
   KreaMart Login Page — Stylesheet
   Font: DM Sans (body) + Sora (headings)
   ============================================= */

/* ── Variables ─────────────────────────────── */
:root {
  --orange:        #F97316;
  --orange-hover:  #EA6A0A;
  --orange-light:  #FFF4ED;
  --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: 480px;
}

/* ── Left Panel ─────────────────────────────── */
.panel-left {
  flex: 1;
  padding: 44px 40px 40px;
  display: flex;
  flex-direction: column;
  background: var(--white);
}

.brand-top {
  margin-bottom: 28px;
}

/* Logo mark */
.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--orange);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(249, 115, 22, 0.35);
}

/* Form title */
.form-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 22px;
  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: 18px 0;
  color: var(--text-muted);
  font-size: 12px;
}

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

/* ── Login Form ─────────────────────────────── */
.login-form {
  display: flex;
  flex-direction: column;
}

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

.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: 16px;
  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;
}

/* Forgot password */
.forgot-link {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  text-align: right;
  margin-bottom: 18px;
  display: block;
  transition: color var(--transition);
}

.forgot-link:hover {
  color: var(--orange);
}

/* Login button */
.btn-login {
  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-login::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 100%);
  pointer-events: none;
}

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

.btn-login:active {
  transform: translateY(0);
  box-shadow: var(--shadow-btn);
}

.btn-login: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); }
}

/* Sign-up hint */
.signup-hint {
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 16px;
}

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

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

/* ── Right Panel ─────────────────────────────── */
.panel-right {
  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: center;
  padding: 40px 32px;
  position: relative;
  overflow: hidden;
  text-align: center;
}

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

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

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

.deco-triangle {
  width: 0;
  height: 0;
  border-radius: 0;
  border-left: 22px solid transparent;
  border-right: 22px solid transparent;
  border-bottom: 38px solid rgba(255,255,255,0.05);
  top: 60px;
  left: 30px;
  animation: floatY 6s ease-in-out infinite alternate;
}

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

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

/* Right panel logo */
.promo-logo {
  margin-bottom: 28px;
}

.logo-mark-light {
  background: var(--orange);
  box-shadow: 0 6px 18px rgba(249, 115, 22, 0.5);
}

/* Promo heading */
.promo-heading {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.25;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.promo-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  margin-bottom: 28px;
}

/* Sign up button */
.btn-signup {
  padding: 10px 28px;
  border: 1.5px solid rgba(255,255,255,0.3);
  border-radius: 999px;
  background: transparent;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  backdrop-filter: blur(6px);
}

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

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

/* ── 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;
  }

  .panel-right {
    width: 100%;
    padding: 36px 32px;
    min-height: 200px;
  }

  .panel-left {
    padding: 32px 24px 28px;
  }

  .promo-heading {
    font-size: 22px;
  }
}