:root {
  --brand: #3c4f19;
  --brand-dark: #2c3a13;
  --brand-light: #5c7527;
  --cream: #f7f5ee;
  --card: #ffffff;
  --text: #26301a;
  --muted: #6b7259;
  --error: #b3261e;
  --radius: 14px;
}

* { box-sizing: border-box; }

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

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

@keyframes popIn {
  0% { opacity: 0; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes pulseFade {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes wheatSway {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(8deg); }
}

@keyframes millSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes leafFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-3px) rotate(5deg); }
}

@keyframes grainDrift {
  from { background-position: 0 0; }
  to { background-position: 120px 120px; }
}

body {
  margin: 0;
  font-family: "Montserrat", "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
}

.topbar {
  position: relative;
  overflow: hidden;
  background: var(--brand);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.topbar::before {
  content: "";
  position: absolute;
  inset: -20px;
  background-image: radial-gradient(rgba(255, 255, 255, 0.09) 1.5px, transparent 1.5px);
  background-size: 18px 18px;
  animation: grainDrift 14s linear infinite;
  pointer-events: none;
}

.topbar > * {
  position: relative;
  z-index: 1;
}

.topbar .logo {
  height: 48px;
  width: auto;
  animation: fadeInDown 0.6s ease both, logoFloat 4s ease-in-out 0.6s infinite;
}

.topbar h1 {
  color: #fff;
  font-size: 1.25rem;
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.02em;
  animation: fadeInDown 0.6s ease 0.1s both;
}

.topbar .tagline {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0;
  animation: fadeInDown 0.6s ease 0.2s both;
}

.hero-banner {
  width: 100%;
  display: block;
  line-height: 0;
  animation: fadeSlideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-banner-img {
  width: 100%;
  height: auto;
  display: block;
}

.usp-strip {
  background: var(--card);
  border-bottom: 1px solid #e5e3d6;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 28px;
  padding: 14px 16px;
}

.usp-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--brand-dark);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  opacity: 0;
  animation: fadeSlideUp 0.5s ease both;
}

.usp-item:nth-child(1) { animation-delay: 0.15s; }
.usp-item:nth-child(2) { animation-delay: 0.28s; }
.usp-item:nth-child(3) { animation-delay: 0.41s; }

.usp-icon {
  width: 22px;
  height: 22px;
  color: var(--brand);
  flex-shrink: 0;
}

.wheat-icon {
  transform-origin: 50% 100%;
  animation: wheatSway 2.4s ease-in-out infinite;
}

.mill-icon {
  transform-origin: 50% 50%;
  animation: millSpin 7s linear infinite;
}

.leaf-icon {
  animation: leafFloat 3s ease-in-out infinite;
}

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-col,
.side-col {
  min-width: 0;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(60, 79, 25, 0.08);
}

.card.hidden {
  display: none;
}

.card.step-enter {
  animation: fadeSlideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.card h2 {
  margin: 0 0 8px;
  font-size: 1.3rem;
  color: var(--brand-dark);
}

.muted {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 20px;
  line-height: 1.4;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

input[type="tel"],
input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #d8dccb;
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="tel"]:focus,
input[type="text"]:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(60, 79, 25, 0.14);
}

.phone-input {
  display: flex;
  align-items: center;
  border: 1.5px solid #d8dccb;
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.phone-input .prefix {
  padding: 12px 10px 12px 14px;
  color: var(--muted);
  font-weight: 600;
  background: #f0efe6;
  border-right: 1.5px solid #d8dccb;
}

.phone-input input {
  border: none;
  border-radius: 0;
}

.phone-input:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(60, 79, 25, 0.14);
}

button[type="submit"] {
  width: 100%;
  margin-top: 18px;
  padding: 13px 16px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

button[type="submit"]:hover:not(:disabled) {
  background: var(--brand-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(60, 79, 25, 0.28);
}

button[type="submit"]:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
  box-shadow: none;
}

button[type="submit"]:disabled {
  background: #a7ac97;
  cursor: not-allowed;
}

button[type="submit"].is-loading {
  animation: pulseFade 1.1s ease-in-out infinite;
}

.error {
  color: var(--error);
  font-size: 0.85rem;
  margin: 12px 0 0;
  min-height: 1em;
}

.otp-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--brand);
  font-size: 0.85rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.15s ease, transform 0.15s ease;
}

.link-btn:hover:not(:disabled) {
  color: var(--brand-dark);
  transform: translateY(-1px);
}

.link-btn:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dashboard-header h2 {
  margin: 0;
}

.product-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}

.product-card {
  border: 1.5px solid #e5e3d6;
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  animation: fadeSlideUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.product-card:hover {
  box-shadow: 0 6px 18px rgba(60, 79, 25, 0.12);
  transform: translateY(-2px);
}

.product-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.product-card .product-name {
  font-weight: 600;
  font-size: 1rem;
}

.cycle-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--brand);
  background: #eef1e4;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.status-badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.status-badge.active {
  background: #e7f0d6;
  color: var(--brand-dark);
}

.status-badge.completed {
  background: var(--brand);
  color: #fff;
}

.status-badge.not_subscribed {
  background: #eee;
  color: var(--muted);
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: #eceadd;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: var(--brand-light);
  border-radius: 999px;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.progress-label {
  font-size: 0.78rem;
  color: var(--muted);
}

.tc-card {
  animation: fadeSlideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.tc-content p {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0 0 12px;
}

.tc-content code {
  background: #f0efe6;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.82em;
}

.tc-content ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.tc-content li {
  margin-bottom: 6px;
}

@media (max-width: 380px) {
  .card {
    padding: 22px 18px;
  }
}

/* Tablet: give the banner a bit more breathing room, still stacked layout */
@media (min-width: 640px) {
  .topbar {
    padding: 28px 24px;
  }

  .topbar .logo {
    height: 54px;
  }

  .topbar h1 {
    font-size: 1.4rem;
  }

  .usp-strip {
    padding: 16px 24px;
    gap: 12px 40px;
  }
}

/* Desktop: login flow on the left, T&C on the right */
@media (min-width: 900px) {
  .topbar {
    padding: 36px 24px;
  }

  .topbar .logo {
    height: 64px;
  }

  .topbar h1 {
    font-size: 1.7rem;
  }

  .topbar .tagline {
    font-size: 0.85rem;
  }

  .usp-strip {
    padding: 18px 24px;
    gap: 14px 56px;
  }

  .usp-item {
    font-size: 0.85rem;
  }

  .usp-icon {
    width: 26px;
    height: 26px;
  }

  .wrap {
    max-width: 1040px;
    padding: 48px 32px 72px;
  }

  .layout {
    flex-direction: row;
    align-items: flex-start;
    gap: 36px;
  }

  .auth-col {
    flex: 1 1 55%;
    max-width: 480px;
  }

  .side-col {
    flex: 1 1 45%;
    max-width: 460px;
    position: sticky;
    top: 32px;
  }
}
