@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #f59e0b;
  --background: #f8fafc;
  --surface: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --success: #10b981;
  --danger: #ef4444;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  --radius: 12px;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--background);
  color: var(--text-primary);
}

/* ── Navbar ── */
nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-links a.active {
  color: var(--primary);
  font-weight: 600;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.cart-icon {
  position: relative;
  cursor: pointer;
  font-size: 1.4rem;
  color: var(--text-primary);
  text-decoration: none;
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 5rem 2rem;
  text-align: center;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.2rem;
  opacity: 0.9;
  margin-bottom: 2rem;
}

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--secondary);
  color: white;
}

.btn-primary:hover {
  background: #d97706;
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: white;
  border: 2px solid white;
  margin-left: 1rem;
}

.btn-outline:hover {
  background: white;
  color: var(--primary);
}

/* ── Product Card ── */
.product-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  animation: fadeIn 0.4s ease forwards;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.12);
}

.product-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.product-info {
  padding: 1rem;
}

.product-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.product-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
}

.btn-add {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.4rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-add:hover {
  background: var(--primary-dark);
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--success);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 500;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s;
  z-index: 999;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ── Footer ── */
footer {
  background: var(--text-primary);
  color: white;
  text-align: center;
  padding: 2rem;
  margin-top: 4rem;
  font-size: 0.9rem;
  opacity: 0.9;
}

/* ── Animations ── */
html {
  scroll-behavior: smooth;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Hamburger Menu ── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0.25rem;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s;
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--surface);
    flex-direction: column;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    gap: 1rem;
    z-index: 99;
  }

  .nav-links.open {
    display: flex;
  }
}
/* ── Dark Mode ── */
body.dark {
  --primary: #60a5fa;
  --primary-dark: #3b82f6;
  --background: #0f172a;
  --surface: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --border: #334155;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.4);
}

/* Dark mode toggle button */
.dark-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}

.dark-toggle:hover {
  background: var(--border);
}

/* ══════════════════════════════════════
   AUTH PAGE
   ══════════════════════════════════════ */

.auth-wrapper {
  min-height: calc(100vh - 70px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--background);
}

/* ── Left Panel ── */
.auth-visual {
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #3b82f6 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  position: relative;
  overflow: hidden;
}

.auth-visual::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  top: -150px;
  right: -150px;
}

.auth-visual::after {
  content: '';
  position: absolute;
  width: 350px;
  height: 350px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  bottom: -80px;
  left: -80px;
}

.auth-visual-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: white;
}

.auth-visual-logo {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 3px;
  background: white;
  color: #2563eb;
  padding: 10px 24px;
  border-radius: 12px;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.auth-visual-tagline {
  font-size: 1rem;
  font-weight: 500;
  opacity: 0.85;
  margin-bottom: 2.5rem;
  letter-spacing: 1px;
}

.auth-features {
  list-style: none;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-features li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  opacity: 0.9;
}

.auth-features li span.icon {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ── Right Panel ── */
.auth-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

.auth-card h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.auth-card .subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

/* ── Tabs ── */
.auth-tabs {
  display: flex;
  background: var(--background);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 2rem;
  border: 1px solid var(--border);
}

.auth-tab {
  flex: 1;
  padding: 0.6rem 1rem;
  border: none;
  background: transparent;
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 7px;
  transition: all 0.2s ease;
}

.auth-tab.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* ── Form ── */
.auth-panel {
  display: none;
  animation: fadeUp 0.25s ease;
}

.auth-panel.active {
  display: block;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  margin-bottom: 1.1rem;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  letter-spacing: 0.3px;
}

.input-wrap {
  position: relative;
}

.input-wrap .input-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  pointer-events: none;
}

.input-wrap input {
  width: 100%;
  padding: 0.7rem 0.9rem 0.7rem 2.5rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.88rem;
  color: var(--text-primary);
  background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.input-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.input-wrap input::placeholder {
  color: #b0bec5;
}

.toggle-pw {
  position: absolute;
  right: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-secondary);
  padding: 0;
  line-height: 1;
}

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.4rem;
  font-size: 0.82rem;
}

.form-options label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  color: var(--text-secondary);
}

.form-options a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.form-options a:hover {
  text-decoration: underline;
}

.btn-auth {
  width: 100%;
  padding: 0.8rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

.btn-auth:hover {
  background: var(--primary-dark);
  box-shadow: 0 6px 18px rgba(37,99,235,0.4);
}

.btn-auth:active {
  transform: scale(0.98);
}

/* ── Divider ── */
.divider {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 1.4rem 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

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

/* ── Social Buttons ── */
.social-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-family: 'Poppins', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.btn-social:hover {
  border-color: var(--primary);
  background: #eff6ff;
}

/* ── Terms ── */
.terms-note {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 1.2rem;
  line-height: 1.5;
}

.terms-note a {
  color: var(--primary);
  text-decoration: none;
}

/* ── Password strength ── */
.strength-bar {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  height: 4px;
}

.strength-bar span {
  flex: 1;
  border-radius: 2px;
  background: var(--border);
  transition: background 0.3s;
}

.strength-label {
  font-size: 0.72rem;
  margin-top: 4px;
  color: var(--text-secondary);
}

/* ── Toast ── */
.auth-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--success);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  transition: transform 0.35s cubic-bezier(.34,1.56,.64,1);
  z-index: 999;
  white-space: nowrap;
}

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

/* ── Auth Dark Mode ── */
body.dark .input-wrap input {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

body.dark .btn-social {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

body.dark .btn-social:hover {
  background: #1e3a5f;
}

body.dark .auth-tabs {
  background: #1e293b;
  border-color: #334155;
}

body.dark .auth-tab.active {
  background: #0f172a;
}

/* ── Auth Responsive ── */
@media (max-width: 768px) {
  .auth-wrapper {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    padding: 2rem;
    min-height: 200px;
  }

  .auth-features {
    display: none;
  }

  .auth-visual-tagline {
    margin-bottom: 0;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ── Demo Hint ── */
.demo-hint {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  font-size: 0.8rem;
  color: #1e40af;
  line-height: 1.6;
}

.demo-hint code {
  cursor: pointer;
  background: #dbeafe;
  padding: 1px 5px;
  border-radius: 4px;
}

.demo-hint span {
  font-size: 0.72rem;
  opacity: 0.7;
  display: block;
  margin-top: 2px;
}

body.dark .demo-hint {
  background: #1e3a5f;
  border-color: #1d4ed8;
  color: #93c5fd;
}

body.dark .demo-hint code {
  background: #1e40af;
}