/* ==========================================================================
   SHANKAR JEWELLERS — Shared site design system
   Used by: index.html, login/index.html, rate/index.html
   ========================================================================== */

:root {
  /* ---- Palette: warm parchment + true metallic gold + maroon + deep emerald.
     Deliberately avoiding the generic "cream + terracotta" AI palette —
     this leans into the shop's own material world: hallmark gold, velvet
     jewellery trays, and temple-jewellery reds. ---- */
  --ivory: #f6ecd6;
  --ivory-deep: #efe0bd;
  --paper: #fffaf0;
  --espresso: #2a1b0c;
  --espresso-soft: #4a3520;
  --brass: #8b6b33;
  --brass-line: #d8c79c;
  --gold: #c9a227;
  --gold-light: #e8c766;
  --gold-deep: #9c7a1a;
  --maroon: #7a1630;
  --maroon-deep: #5c0f24;
  --emerald: #1f5c4a;
  --silver-light: #e9e7df;
  --silver: #a6a89d;
  --silver-deep: #74766c;

  --shadow-soft: 0 10px 30px rgba(42, 27, 12, 0.12);
  --shadow-deep: 0 20px 50px rgba(42, 27, 12, 0.22);
  --radius: 14px;

  --font-display: 'Playfair Display', 'Noto Sans Bengali', serif;
  --font-flourish: 'Cormorant Garamond', serif;
  --font-body: 'Inter', 'Noto Sans Bengali', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--espresso);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

.container {
  width: min(1140px, 92%);
  margin: 0 auto;
}

.eyebrow {
  font-family: var(--font-flourish);
  font-style: italic;
  font-size: 18px;
  color: var(--maroon);
  letter-spacing: 0.02em;
  margin: 0 0 6px;
}

.eyebrow-bn {
  font-family: 'Noto Sans Bengali', sans-serif;
  font-size: 14px;
  color: var(--brass);
  margin: 0 0 4px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--espresso);
  margin: 0 0 14px;
  line-height: 1.15;
}

h1 { font-size: clamp(34px, 5vw, 56px); }
h2 { font-size: clamp(26px, 3.4vw, 36px); }
h3 { font-size: 20px; }

p { line-height: 1.7; color: var(--espresso-soft); }

.section { padding: 76px 0; }
.section-tight { padding: 46px 0; }

.section-head { max-width: 640px; margin: 0 auto 40px; text-align: center; }
.section-head.left { margin-left: 0; text-align: left; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14.5px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  font-family: var(--font-body);
}
.btn:hover { transform: translateY(-2px); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold-light), var(--gold-deep));
  color: var(--espresso);
  box-shadow: var(--shadow-soft);
}
.btn-gold:hover { box-shadow: var(--shadow-deep); }

.btn-outline {
  background: transparent;
  color: var(--espresso);
  border-color: var(--brass-line);
}
.btn-outline:hover { border-color: var(--maroon); color: var(--maroon); }

.btn-maroon {
  background: var(--maroon);
  color: var(--paper);
  box-shadow: var(--shadow-soft);
}
.btn-maroon:hover { background: var(--maroon-deep); }

.btn-block { width: 100%; }

/* ---- Header / nav ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: rgba(246, 236, 214, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--brass-line);
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand img { width: 40px; height: 40px; object-fit: contain; }

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text .brand-en {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  color: var(--espresso);
  letter-spacing: 0.01em;
}
.brand-text .brand-bn {
  font-family: 'Noto Sans Bengali', sans-serif;
  font-size: 12px;
  color: var(--brass);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--espresso-soft);
}
.nav-links a:hover { color: var(--maroon); }

.staff-login-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--brass-line);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: var(--espresso);
  /* On a 375px screen this was wrapping to "Staff / Login" and pushing the
     header to 53px against a 16px line-height. */
  white-space: nowrap;
}
.staff-login-link:hover { border-color: var(--maroon); color: var(--maroon); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  width: 44px;
  height: 44px;
  cursor: pointer;
  color: var(--espresso);
}

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-row.open .nav-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    padding: 18px 6%;
    border-bottom: 1px solid var(--brass-line);
    box-shadow: var(--shadow-soft);
  }
}

/* ---- Footer ---- */
.site-footer {
  background: var(--espresso);
  color: var(--ivory-deep);
  padding: 54px 0 26px;
}
.site-footer a { color: var(--ivory-deep); text-decoration: none; }
.site-footer a:hover { color: var(--gold-light); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 36px;
}
.footer-grid h4 {
  font-family: var(--font-display);
  color: var(--gold-light);
  font-size: 15px;
  margin: 0 0 14px;
  letter-spacing: 0.03em;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.footer-bottom {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(246, 236, 214, 0.15);
  font-size: 12.5px;
  color: rgba(246, 236, 214, 0.6);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---- Reveal-on-scroll ---- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* ---- Focus states for accessibility ---- */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--maroon);
  outline-offset: 2px;
}

/* ---- Auth card (shared by /login and /rate) ---- */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 10%, rgba(201, 162, 39, 0.16), transparent 45%),
    radial-gradient(circle at 85% 90%, rgba(122, 22, 48, 0.12), transparent 45%),
    var(--ivory);
}

.auth-card {
  width: min(440px, 100%);
  background: var(--paper);
  border: 1px solid var(--brass-line);
  border-radius: 20px;
  padding: 40px 34px;
  box-shadow: var(--shadow-deep);
  text-align: center;
}

@media (max-width: 380px) {
  .auth-shell { padding: 16px; }
  .auth-card { padding: 32px 20px; }
}

.auth-card img.auth-logo { width: 56px; height: 56px; margin: 0 auto 14px; }
.auth-card h1 { font-size: 24px; margin-bottom: 4px; }
.auth-card p.auth-sub { margin-top: 0; margin-bottom: 26px; font-size: 14px; color: var(--brass); }

.field-group { text-align: left; margin-bottom: 16px; }
.field-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--espresso-soft);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.field-group input, .field-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--brass-line);
  border-radius: 10px;
  font-size: 15px;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--espresso);
}
.field-group input:focus, .field-group textarea:focus {
  border-color: var(--maroon);
  outline: none;
}

.form-message {
  min-height: 20px;
  font-size: 13.5px;
  color: var(--maroon);
  margin: 4px 0 14px;
}
.form-message.success { color: var(--emerald); }
.form-message.error { color: var(--maroon); }

.back-link {
  display: inline-block;
  margin-top: 22px;
  font-size: 13px;
  color: var(--brass);
  text-decoration: none;
}
.back-link:hover { color: var(--maroon); }

/* "All Login Sessions" at the foot of the staff directory. Deliberately small
   and quiet - it is a secondary, occasional action, not a menu item. */
.sessions-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 5px 12px;
  border: 1px solid rgba(176, 141, 87, 0.35);
  border-radius: 999px;
  background: transparent;
  color: var(--brass);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sessions-button::before {
  content: "\2022";
  font-size: 14px;
  line-height: 0;
  opacity: 0.6;
}

.footer-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.footer-tools .sessions-button { margin-top: 0; }
/* The icon replaces the dot: one marker per button, not two. */
.tool-button::before { content: none; }
.tool-button svg { flex: none; opacity: .85; }

.sessions-button:hover {
  background: rgba(176, 141, 87, 0.09);
  border-color: rgba(176, 141, 87, 0.6);
  color: var(--maroon);
}

.sessions-button:focus-visible {
  outline: 2px solid rgba(176, 141, 87, 0.85);
  outline-offset: 2px;
}

.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 6px;
}
.choice-grid.choice-grid-single {
  grid-template-columns: 1fr;
  max-width: 260px;
  margin-left: auto;
  margin-right: auto;
}
/* A lone card on the second row (e.g. 3 cards in a 2-col grid) fills the width */
.choice-grid .choice-card:nth-child(3):last-child { grid-column: 1 / -1; }
@media (max-width: 480px) {
  .choice-grid { grid-template-columns: 1fr; }
}

.choice-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 14px;
  border-radius: 16px;
  border: 1px solid var(--brass-line);
  background: var(--ivory);
  text-decoration: none;
  color: var(--espresso);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
/* Estimate Price calculator on the Directory (directory/estimate.js). */
.estimate-dialog {
  width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--brass-line);
  border-radius: 18px;
  padding: 22px 22px 16px;
  background: var(--paper);
  color: var(--espresso);
  box-shadow: var(--shadow-deep);
  font-family: var(--font-body);
}
.estimate-dialog::backdrop { background: rgba(42, 27, 12, .45); }
.estimate-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.estimate-head h2 { margin: 0; font-family: var(--font-display); font-size: 22px; }
.estimate-close { border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--brass); }
.estimate-field { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 0; }
.estimate-field span { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--brass); }
.estimate-field input, .estimate-field select {
  font: inherit; font-size: 16px; padding: 10px 12px;
  border: 1px solid var(--brass-line); border-radius: 10px; background: #fff; width: 100%;
}
.estimate-row { display: flex; gap: 12px; margin-top: 12px; }
.estimate-note { margin: 6px 0 0; font-size: 12px; color: var(--brass); }
.estimate-lines {
  display: grid; grid-template-columns: 1fr auto; gap: 8px 12px;
  margin: 16px 0 4px; padding: 14px; border-radius: 12px; background: var(--ivory);
  font-variant-numeric: tabular-nums;
}
.estimate-lines dt { font-size: 13.5px; }
.estimate-lines dt small { color: var(--brass); }
.estimate-lines dd { margin: 0; text-align: right; font-weight: 600; }
.estimate-lines .estimate-total {
  padding-top: 8px; border-top: 1px solid var(--brass-line);
  font-size: 17px; font-weight: 700; color: var(--maroon);
}

.choice-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
  border-color: var(--gold-deep);
}

/* A page this account may not open (module level 'off'). Shown and barred
   rather than hidden: staff can see the whole menu and understand what they
   do not have, instead of wondering why a colleague's screen has more on it.
   This is signposting - the real block is the RLS policies and the redirect
   in bills/access.js. */
.choice-card.is-blocked {
  position: relative;
  cursor: not-allowed;
  background: #f3ece0;
}
/* Grey the CONTENTS, not the card: a filter on the card would desaturate its
   own ::after too, and the cross has to stay red to read as a refusal. */
.choice-card.is-blocked > * {
  filter: grayscale(1);
  opacity: 0.45;
}
/* Cancel the lift-on-hover: a card that cannot be opened must not feel live. */
.choice-card.is-blocked:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--brass-line);
}
.choice-card.is-blocked::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(139, 47, 47, 0.14)
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b2f2f' stroke-width='2.6' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cline x1='5.6' y1='5.6' x2='18.4' y2='18.4'/%3E%3C/svg%3E")
    no-repeat center;
  background-size: 56px 56px;
  opacity: 0;
  transition: opacity 0.12s ease;
}
/* .show-cross is for touch: an iPad has no hover, so a tap has to reveal it. */
.choice-card.is-blocked:hover::after,
.choice-card.is-blocked:focus-visible::after,
.choice-card.is-blocked.show-cross::after { opacity: 1; }

.choice-card .choice-icon { font-size: 30px; }
.choice-card .choice-title { font-weight: 700; font-size: 15px; }
.choice-card .choice-sub { font-size: 12px; color: var(--brass); text-align: center; }

.session-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 22px;
  font-size: 13px;
  color: var(--brass);
}
.session-strip button {
  background: none;
  border: none;
  color: var(--maroon);
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
  padding: 0;
}

/* Staff pages stay hidden until the session has been checked, so the login
   form never flashes before a redirect. */
body.auth-pending .auth-shell { visibility: hidden; }

/* An explicit `display` on a class beats the browser's [hidden] rule, which
   silently leaves "hidden" elements on screen and keyboard-focusable.
   This restores it for every element on the page. */
[hidden] { display: none !important; }
