/* La Herbolaria — members app. Shares the design system of the public home:
   Frick Condensed for display, Consolas for everything else, flat brand
   colors, pill buttons and generously rounded cards. */

/* ---------- Fonts ---------- */
@font-face {
  font-family: "Frick Condensed";
  src: url("assets/fonts/frick-condensed.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "Consolas";
  src: url("assets/fonts/consolas-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Consolas";
  src: url("assets/fonts/consolas-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --black: #101016;
  --green: #059141;
  --green-light: #50b27a;
  --purple: #8f0386;
  --accent: #c3ce08;
  --red: #f11f0e;
  --pink: #ec889a;
  --lavender: #b1bbdb;
  --olive: #809e29;
  --cream: #f4f2ea;
  --teal: #00ba93;
  --magenta: #f769dc;
  --orange: #ea6f0a;
  --white: #ffffff;
  --muted: #5e6266;
  --line: rgba(16, 16, 22, 0.12);

  --font-display: "Frick Condensed", "Arial Narrow", Impact, sans-serif;
  --font-mono: "Consolas", "SFMono-Regular", Menlo, monospace;

  --radius-lg: 28px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(16, 16, 22, 0.12);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
}

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

body {
  background-color: var(--cream);
  color: var(--black);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 0.95;
  letter-spacing: -0.01em;
  color: var(--black);
}

.overline {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green);
}

/* ---------- Navbar ---------- */
.navbar {
  background-color: var(--black);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 72px;
}

.nav-container {
  max-width: 1240px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
}

.brand-logo {
  height: 34px;
  width: auto;
  display: block;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-email {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--lavender);
}

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 14px 24px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition:
    transform var(--transition-fast),
    filter var(--transition-fast),
    background-color var(--transition-fast);
}

.btn:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 3px solid var(--black);
  outline-offset: 2px;
}

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

.btn-primary {
  background-color: var(--accent);
  color: var(--black);
}

.btn-logout {
  background: transparent;
  color: var(--lavender);
  padding: 10px;
  font-size: 16px;
}

.btn-logout:hover:not(:disabled) {
  color: var(--white);
  filter: none;
}

.btn-block {
  width: 100%;
  padding: 18px;
}

.link {
  background: none;
  border: none;
  font: inherit;
  font-size: 13px;
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

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

/* ---------- Layout ---------- */
.main-content {
  max-width: 1240px;
  margin: 112px auto 80px auto;
  padding: 0 24px;
}

.page-header {
  margin-bottom: 36px;
}

.page-header .overline {
  margin-bottom: 12px;
}

.page-header h1 {
  font-size: clamp(44px, 7vw, 72px);
  margin-bottom: 10px;
}

.page-header h1 em {
  font-style: normal;
  color: var(--green);
}

.page-header p {
  color: var(--muted);
  max-width: 70ch;
}

/* ---------- Catalog ---------- */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.catalog-empty {
  color: var(--muted);
}

.product-card {
  background-color: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.product-image-container {
  position: relative;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--teal);
}

/* Cycle the brand's card colors so the grid reads like the home */
.product-card:nth-child(4n + 2) .product-image-container {
  background-color: var(--magenta);
}
.product-card:nth-child(4n + 3) .product-image-container {
  background-color: var(--orange);
}
.product-card:nth-child(4n + 4) .product-image-container {
  background-color: var(--accent);
}

/* Out of the flow, so the photo's own proportions cannot stretch the 4:3 box */
.product-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-placeholder {
  width: 72px;
  opacity: 0.85;
}

.product-info {
  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.product-title {
  font-size: 32px;
}

.product-desc {
  color: var(--muted);
  font-size: 13px;
  white-space: pre-line;
}

.price-value {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 28px;
  line-height: 1;
  color: var(--green);
  margin-top: auto;
}

/* ---------- Auth screen ---------- */
body.locked {
  overflow: hidden;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--cream);
  overflow-y: auto;
}

.login-card {
  width: 100%;
  max-width: 420px;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 40px 36px 36px;
  text-align: center;
  background: var(--white);
  border-radius: var(--radius-lg);
}

.auth-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-screen[hidden],
.auth-view[hidden] {
  display: none;
}

.login-card .login-mascot {
  width: 120px;
  align-self: center;
  margin-bottom: 4px;
}

.login-card .brand-logo {
  height: 30px;
  align-self: center;
}

.login-card h1 {
  font-size: 44px;
  margin-top: 8px;
}

.login-card h1 em {
  font-style: normal;
  color: var(--green);
}

.login-card p {
  color: var(--muted);
  font-size: 14px;
}

.login-card input {
  width: 100%;
  min-width: 0;
  padding: 16px 18px;
  font: inherit;
  font-size: 14px;
  border: 2px solid var(--black);
  border-radius: 999px;
  background: var(--cream);
  text-align: center;
}

.login-card input:focus {
  outline: none;
  background: var(--white);
  box-shadow: 0 0 0 3px var(--accent);
}

.field-row {
  display: flex;
  gap: 10px;
}

.honeypot {
  position: absolute;
  left: -9999px;
}

.auth-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.login-status:empty {
  display: none;
}

.login-status {
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
}

.login-status.error {
  color: var(--red);
}

/* ---------- Responsive ---------- */
@media (max-width: 576px) {
  .user-email {
    display: none;
  }
  .login-card {
    padding: 32px 24px;
  }
  .field-row {
    flex-direction: column;
    gap: 14px;
  }
}
