/* =========================================================
   BASIL LAB — Authentication UI
   Works alongside your existing styles.css
   ========================================================= */

:root {
  --auth-green-deep: var(--green-deep, #214d32);
  --auth-green: var(--green, #2e5e3b);
  --auth-sage: var(--sage, #a8c3a0);
  --auth-cream: var(--cream, #f7f5ef);
  --auth-charcoal: var(--charcoal, #232521);
  --auth-muted: #6f756d;
  --auth-border: rgba(46, 94, 59, 0.18);
  --auth-shadow: 0 24px 70px rgba(28, 56, 37, 0.12);
  --auth-playfair: "Playfair Display", Georgia, serif;
  --auth-jost: "Jost", Arial, sans-serif;
}

/* ---------- Desktop navbar authentication ---------- */

.auth-signup-link {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 10px 18px !important;
  border-radius: 999px;
  background: var(--auth-green-deep);
  color: var(--auth-cream) !important;
  border: 1px solid var(--auth-green-deep);
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease !important;
}

.auth-signup-link:hover {
  transform: translateY(-1px);
  background: transparent;
  color: var(--auth-green-deep) !important;
}

.auth-login-link {
  position: relative;
}

.nav-user-item {
  max-width: 170px;
}

.nav-user-email {
  display: block;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--auth-jost);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--auth-cream);
  opacity: 0.95;
}

nav.scrolled .nav-user-email,
body.products-page .nav-user-email,
body.contact-page .nav-user-email {
  color: var(--auth-green-deep);
}

.nav-logout-btn {
  appearance: none;
  border: 1px solid var(--auth-cream);
  background: var(--auth-cream);
  color: var(--auth-green-deep);
  border-radius: 999px;
  padding: 9px 16px;
  font-family: var(--auth-jost);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 5px 18px rgba(0,0,0,0.10);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.nav-logout-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(0,0,0,0.15);
}

nav.scrolled .nav-logout-btn,
body.products-page .nav-logout-btn,
body.contact-page .nav-logout-btn {
  border-color: rgba(46, 94, 59, 0.22);
  background: var(--auth-cream);
  color: var(--auth-green-deep);
}

/* ---------- Mobile authentication ---------- */

.mobile-auth-divider {
  width: min(220px, 65vw);
  height: 1px;
  margin: 8px auto 12px;
  background: rgba(168, 195, 160, 0.28);
}

.mobile-auth-signup {
  color: var(--auth-sage) !important;
}

.mobile-user-block {
  width: min(280px, 75vw);
  margin: 12px auto 0;
  padding: 18px;
  text-align: center;
  border: 1px solid rgba(168, 195, 160, 0.2);
  border-radius: 18px;
}

.mobile-user-label {
  display: block;
  font-family: var(--auth-jost);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.62;
}

.mobile-user-email {
  display: block;
  margin: 7px 0 14px;
  font-family: var(--auth-jost);
  font-size: 0.86rem;
  word-break: break-word;
}

.mobile-logout-btn {
  width: 100%;
  border: 1px solid var(--auth-cream);
  background: var(--auth-cream);
  color: var(--auth-green-deep);
  border-radius: 999px;
  padding: 10px 14px;
  font-family: var(--auth-jost);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

/* ---------- Login / signup pages ---------- */

.auth-page {
  min-height: 100vh;
  margin: 0;
  color: var(--auth-charcoal);
  background:
    radial-gradient(circle at 15% 12%, rgba(168, 195, 160, 0.28), transparent 32%),
    radial-gradient(circle at 90% 82%, rgba(46, 94, 59, 0.10), transparent 33%),
    var(--auth-cream);
  font-family: var(--auth-jost);
}

.auth-page *,
.auth-page *::before,
.auth-page *::after {
  box-sizing: border-box;
}

.auth-topbar {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5vw;
  border-bottom: 1px solid rgba(46, 94, 59, 0.10);
}

.auth-brand {
  color: var(--auth-green-deep);
  font-family: var(--auth-playfair);
  font-size: 1.35rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.auth-back {
  color: var(--auth-green-deep);
  font-size: 0.76rem;
  font-weight: 500;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.auth-back:hover {
  opacity: 0.68;
}

.auth-shell {
  min-height: calc(100vh - 78px);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(420px, 0.7fr);
  gap: 60px;
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
  padding: 64px 5vw 76px;
}

.auth-intro {
  max-width: 610px;
}

.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 20px;
  color: var(--auth-green);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.auth-eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--auth-green);
}

.auth-title {
  margin: 0;
  color: var(--auth-green-deep);
  font-family: var(--auth-playfair);
  font-size: clamp(3rem, 6vw, 5.7rem);
  line-height: 0.96;
  font-weight: 500;
  letter-spacing: -0.045em;
}

.auth-title em {
  color: var(--auth-green);
  font-weight: 400;
}

.auth-intro-text {
  max-width: 520px;
  margin: 25px 0 0;
  color: var(--auth-muted);
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.8;
}

.auth-card {
  position: relative;
  width: 100%;
  padding: 42px;
  border: 1px solid var(--auth-border);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.64);
  box-shadow: var(--auth-shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -80px;
  top: -85px;
  border-radius: 50%;
  background: rgba(168, 195, 160, 0.18);
}

.auth-card-title {
  position: relative;
  margin: 0 0 7px;
  color: var(--auth-green-deep);
  font-family: var(--auth-playfair);
  font-size: 2rem;
  font-weight: 500;
}

.auth-card-subtitle {
  position: relative;
  margin: 0 0 30px;
  color: var(--auth-muted);
  font-size: 0.88rem;
  font-weight: 300;
  line-height: 1.6;
}

.auth-field {
  margin-bottom: 18px;
}

.auth-field label {
  display: block;
  margin: 0 0 8px 2px;
  color: var(--auth-green-deep);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.auth-input {
  width: 100%;
  height: 54px;
  border: 1px solid var(--auth-border);
  border-radius: 15px;
  outline: none;
  background: rgba(247, 245, 239, 0.76);
  color: var(--auth-charcoal);
  padding: 0 17px;
  font-family: var(--auth-jost);
  font-size: 0.94rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.auth-input::placeholder {
  color: #989c96;
}

.auth-input:focus {
  border-color: rgba(46, 94, 59, 0.58);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(46, 94, 59, 0.07);
}

.auth-submit {
  width: 100%;
  min-height: 54px;
  margin-top: 5px;
  border: 1px solid var(--auth-green-deep);
  border-radius: 999px;
  background: var(--auth-green-deep);
  color: var(--auth-cream);
  font-family: var(--auth-jost);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.auth-submit:hover {
  transform: translateY(-2px);
  background: transparent;
  color: var(--auth-green-deep);
}

.auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.auth-message {
  min-height: 23px;
  margin: 16px 0 0;
  border-radius: 12px;
  font-size: 0.82rem;
  line-height: 1.55;
}

.auth-message.error {
  color: #8d2d2d;
}

.auth-message.success {
  color: var(--auth-green);
}

.auth-switch {
  margin: 24px 0 0;
  color: var(--auth-muted);
  text-align: center;
  font-size: 0.86rem;
}

.auth-switch a {
  color: var(--auth-green-deep);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(46, 94, 59, 0.3);
}

.auth-note {
  display: flex;
  gap: 11px;
  margin-top: 25px;
  padding-top: 22px;
  border-top: 1px solid rgba(46, 94, 59, 0.1);
  color: var(--auth-muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

.auth-note-mark {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(168, 195, 160, 0.25);
  color: var(--auth-green-deep);
  font-weight: 600;
}

@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
    gap: 34px;
    max-width: 650px;
    padding-top: 44px;
  }

  .auth-intro {
    text-align: center;
    margin: 0 auto;
  }

  .auth-eyebrow {
    justify-content: center;
  }

  .auth-intro-text {
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 560px) {
  .auth-topbar {
    min-height: 68px;
    padding: 0 22px;
  }

  .auth-shell {
    min-height: calc(100vh - 68px);
    padding: 36px 18px 50px;
  }

  .auth-title {
    font-size: clamp(2.7rem, 14vw, 4.3rem);
  }

  .auth-card {
    padding: 30px 22px;
    border-radius: 24px;
  }

  .auth-card-title {
    font-size: 1.75rem;
  }

  .nav-user-item {
    display: none !important;
  }
}


/* ---------- Admin dashboard shortcut ---------- */
.admin-dashboard-link {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 9px 15px !important;
  border-radius: 999px;
  border: 1px solid var(--auth-green-deep);
  background: var(--auth-green-deep);
  color: var(--auth-cream) !important;
  white-space: nowrap;
}

.admin-dashboard-link::after { display: none !important; }
.admin-dashboard-link:hover {
  background: var(--auth-green, #2e5e3b);
  color: var(--auth-cream) !important;
}

.mobile-admin-link {
  color: var(--auth-sage) !important;
  font-weight: 600;
}


/* ---------- Customer order shortcut ---------- */
.my-orders-link {
  white-space: nowrap;
}

.mobile-menu .auth-user.mobile-auth-link:not([hidden]) {
  display: block;
}
