/* Appily Eighteen — Root Cellar Ledger account */

.page-root-cellar {
  --rc-stone: #f3efe6;
  --rc-wood: #6b5b3e;
  --rc-wood-dark: #4a3f2c;
  --rc-lantern: #c67d3a;
  --rc-lantern-glow: rgba(198, 125, 58, 0.25);
  --rc-leaf: #8fae7a;
  --rc-leaf-soft: rgba(143, 174, 122, 0.15);
  --rc-ink: #2c2419;
  --rc-paper: #faf7f0;
  --rc-rule: rgba(107, 91, 62, 0.1);
  background:
    radial-gradient(ellipse at 20% 0%, var(--rc-lantern-glow) 0%, transparent 42%),
    radial-gradient(ellipse at 80% 5%, rgba(143, 174, 122, 0.12) 0%, transparent 38%),
    linear-gradient(180deg, #ebe4d8 0%, var(--white) 320px);
}

/* ── Hero arch ── */
.rc-hero {
  position: relative;
  padding: clamp(28px, 5vw, 44px) 0 clamp(18px, 3vw, 28px);
  overflow: hidden;
}

.rc-arch {
  position: absolute;
  inset: auto 10% 0;
  height: 120px;
  border: 3px solid rgba(107, 91, 62, 0.15);
  border-bottom: 0;
  border-radius: 50% 50% 0 0;
  pointer-events: none;
}

.rc-lantern {
  position: absolute;
  top: 18px;
  right: 12%;
  width: 36px;
  height: 48px;
  border-radius: 6px 6px 4px 4px;
  background: linear-gradient(180deg, var(--rc-lantern) 0%, #a86530 100%);
  box-shadow: 0 0 24px var(--rc-lantern-glow);
  animation: rc-flicker 4s ease-in-out infinite;
}

.rc-lantern::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  width: 14px;
  height: 8px;
  background: var(--rc-wood);
  transform: translateX(-50%);
  border-radius: 2px 2px 0 0;
}

@keyframes rc-flicker {
  0%, 100% { box-shadow: 0 0 20px var(--rc-lantern-glow); }
  50% { box-shadow: 0 0 32px rgba(198, 125, 58, 0.45); }
}

.rc-hero-inner { position: relative; }

.rc-kicker {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rc-wood);
}

.rc-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.9rem, 4.2vw, 2.65rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--rc-ink);
}

.rc-hero h1 em {
  font-style: normal;
  color: var(--rc-lantern);
}

.rc-lede {
  margin: 0;
  max-width: 520px;
  color: var(--ink-soft);
  line-height: 1.7;
}

/* ── Floor ── */
.rc-floor {
  padding: 8px 0 72px;
}

.rc-wrap {
  max-width: 980px;
}

.rc-loading {
  margin-bottom: 20px;
}

/* ── Member ledger pass ── */
.rc-ledger-pass {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px 20px;
  padding: 22px 24px;
  margin-bottom: 24px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, var(--rc-paper) 0%, #f0e9dc 100%);
  border: 2px solid var(--rc-wood);
  box-shadow:
    inset 0 0 0 4px rgba(255, 255, 255, 0.6),
    var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.rc-ledger-pass::before {
  content: "";
  position: absolute;
  top: 12px;
  right: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid rgba(198, 125, 58, 0.35);
  background: radial-gradient(circle at 30% 30%, rgba(198, 125, 58, 0.2), transparent 60%);
  opacity: 0.7;
}

.rc-seal {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--white);
  background: radial-gradient(circle at 35% 30%, var(--rc-lantern), #8b5528);
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.2);
  z-index: 1;
}

.rc-pass-avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 1.4rem;
  background: var(--rc-leaf-soft);
  border: 2px solid rgba(143, 174, 122, 0.35);
  z-index: 1;
}

.rc-pass-label {
  margin: 0 0 2px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.rc-ledger-pass h2 {
  margin: 0;
  font-size: clamp(1.1rem, 2.5vw, 1.45rem);
  color: var(--rc-ink);
  z-index: 1;
}

.rc-pass-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  z-index: 1;
}

/* ── Drawer nav + ledger panels ── */
.rc-hub {
  display: grid;
  gap: 20px;
}

.rc-drawers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  background: var(--rc-stone);
  border: 2px solid rgba(107, 91, 62, 0.2);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 2px 6px rgba(44, 36, 25, 0.06);
}

.rc-drawer-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--white);
  border-bottom: 3px solid rgba(107, 91, 62, 0.2);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--transition), border-color var(--transition), background var(--transition), color var(--transition);
}

.rc-drawer-btn:hover {
  transform: translateY(-2px);
  border-bottom-color: var(--rc-leaf);
  color: var(--rc-wood);
}

.rc-drawer-btn.is-active {
  background: var(--rc-wood);
  color: var(--white);
  border-bottom-color: var(--rc-lantern);
  box-shadow: 0 4px 12px rgba(107, 91, 62, 0.25);
}

.rc-drawer-icon {
  font-size: 1rem;
  line-height: 1;
}

.rc-stage {
  min-height: 200px;
}

.rc-panel {
  display: none;
  position: relative;
  padding: 26px 26px 30px;
  border-radius: var(--radius-lg);
  background: var(--rc-paper);
  border: 2px solid rgba(107, 91, 62, 0.18);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.rc-panel.is-active {
  display: block;
}

.rc-panel-rules {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(var(--rc-rule) 1px, transparent 1px);
  background-size: 100% 28px;
  opacity: 0.6;
}

.rc-panel-kicker {
  position: relative;
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rc-wood);
}

.rc-panel-title {
  position: relative;
  margin: 0 0 20px;
  font-size: 1.25rem;
}

.rc-panel-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
}

.rc-panel-head .rc-panel-title {
  margin-bottom: 0;
}

/* Profile grid (JS-rendered) */
.rc-profile-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.rc-profile-grid .profile-item {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: 0 2px 0 rgba(107, 91, 62, 0.04);
}

.rc-profile-grid .k,
.profile-item .k {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.rc-profile-grid .v,
.profile-item .v {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--rc-ink);
  word-break: break-word;
}

.profile-item .v.mono {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 600;
}

/* Orders list (JS-rendered) */
.rc-order-list {
  position: relative;
  display: grid;
  gap: 10px;
}

.rc-order-list .order-row,
.order-list .order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--rc-leaf);
}

.rc-order-list .order-row strong {
  display: block;
  font-size: 0.92rem;
}

.rc-order-list .mini-copy,
.order-row .mini-copy {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}

.rc-order-list .btn-soft,
.order-row .btn-soft {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: var(--radius);
  background: var(--rc-stone);
  border: 1px solid var(--line);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--rc-wood);
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition);
}

.rc-order-list .btn-soft:hover {
  border-color: var(--rc-leaf);
  background: var(--rc-leaf-soft);
}

/* Forms */
.rc-form {
  position: relative;
  display: grid;
  gap: 16px;
  max-width: 420px;
}

.rc-form-inline {
  max-width: none;
}

.rc-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.rc-field input {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid rgba(107, 91, 62, 0.18);
  border-radius: var(--radius-md);
  font: inherit;
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.rc-field input:focus {
  outline: none;
  border-color: var(--rc-leaf);
  box-shadow: 0 0 0 3px var(--rc-leaf-soft);
}

/* Buttons */
.rc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  border: 0;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--transition), background var(--transition), filter var(--transition);
  white-space: nowrap;
}

.rc-btn-primary {
  background: var(--rc-wood);
  color: var(--white);
  box-shadow: 0 6px 16px rgba(107, 91, 62, 0.25);
}

.rc-btn-primary:hover {
  background: var(--rc-wood-dark);
  color: var(--white);
  transform: translateY(-1px);
}

.rc-btn-soft {
  background: var(--rc-leaf-soft);
  color: var(--rc-wood-dark);
  border: 1px solid rgba(143, 174, 122, 0.35);
}

.rc-btn-soft:hover {
  background: rgba(143, 174, 122, 0.25);
}

.rc-ledger-pass .rc-btn-soft {
  background: var(--white);
  color: var(--rc-wood);
  border-color: rgba(107, 91, 62, 0.25);
}

.rc-btn-ghost {
  background: transparent;
  color: var(--rc-wood);
  border: 2px solid rgba(107, 91, 62, 0.3);
}

.rc-btn-ghost:hover {
  background: var(--rc-stone);
}

.rc-btn-sm {
  padding: 8px 14px;
  font-size: 0.82rem;
}

/* Guest / cellar door */
.rc-guest-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(0, 1.1fr);
  gap: 24px;
  align-items: start;
}

.rc-plaque {
  position: relative;
  padding: 28px 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, var(--rc-stone) 0%, #e8e0d2 100%);
  border: 2px solid rgba(107, 91, 62, 0.25);
  box-shadow: inset 0 2px 8px rgba(255, 255, 255, 0.5), var(--shadow-sm);
}

.rc-plaque-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 5px 10px;
  border-radius: var(--radius);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--rc-leaf);
}

.rc-plaque-kicker {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rc-wood);
}

.rc-plaque h2 {
  margin: 0 0 10px;
  font-size: 1.35rem;
  color: var(--rc-ink);
}

.rc-plaque-lede {
  margin: 0 0 18px;
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.65;
}

.rc-plaque-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.rc-plaque-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--rc-ink);
}

.rc-plaque-list li span {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--white);
  background: var(--rc-wood);
}

/* Cellar door auth */
.rc-cellar-door {
  position: relative;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--rc-wood-dark) 0%, var(--rc-wood) 100%);
  border: 3px solid var(--rc-wood-dark);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.rc-door-knocks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  background: rgba(0, 0, 0, 0.15);
  border-bottom: 2px solid rgba(0, 0, 0, 0.2);
}

.rc-knock-tab {
  position: relative;
  padding: 16px 20px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  transition: color var(--transition);
}

.rc-knock-tab.is-active {
  color: var(--white);
}

.rc-knock-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--rc-lantern);
  border-radius: 3px 3px 0 0;
  transition: transform 0.25s ease, width 0.25s ease;
}

.rc-door-panels {
  padding: 0;
  background: var(--rc-paper);
}

.rc-door-panel {
  display: none;
  padding: 28px 26px 32px;
}

.rc-door-panel.is-active {
  display: block;
}

.rc-door-kicker {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rc-wood);
}

.rc-door-panel h2 {
  margin: 0 0 8px;
  font-size: 1.45rem;
}

.rc-door-lede {
  margin: 0 0 22px;
  color: var(--ink-soft);
  line-height: 1.65;
  max-width: 440px;
}

.rc-forgot {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 2px dashed rgba(107, 91, 62, 0.2);
}

.rc-forgot h3,
.rc-form-reset h3 {
  margin: 0 0 14px;
  font-size: 1rem;
}

.rc-form-reset {
  margin-top: 20px;
}

/* Notices & toast */
.rc-wrap .notice,
.rc-stage .notice {
  position: relative;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 0.88rem;
}

.rc-wrap .notice.success,
.rc-stage .notice.success {
  background: var(--rc-leaf-soft);
  border: 1px solid rgba(143, 174, 122, 0.4);
  color: var(--rc-wood-dark);
}

.rc-wrap .notice.warning,
.rc-stage .notice.warning {
  background: rgba(198, 125, 58, 0.12);
  border: 1px solid rgba(198, 125, 58, 0.35);
  color: #7a4e24;
}

.rc-wrap .notice.error,
.rc-auth-notice {
  background: rgba(211, 47, 47, 0.08);
  border: 1px solid rgba(211, 47, 47, 0.25);
  color: #b71c1c;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 500;
  max-width: min(360px, calc(100vw - 32px));
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--white);
  background: var(--rc-ink);
  box-shadow: var(--shadow-lg);
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

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

.toast.success { background: var(--rc-wood-dark); }
.toast.error { background: #8b2e2e; }
.toast.warning { background: #8b5528; }
.toast.info { background: var(--rc-ink); }

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

  .rc-ledger-pass {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
  }

  .rc-pass-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .rc-profile-grid {
    grid-template-columns: 1fr;
  }

  .rc-drawers {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .rc-drawer-btn {
    flex-shrink: 0;
  }

  .rc-order-list .order-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .rc-seal {
    display: none;
  }

  .rc-lantern {
    display: none;
  }
}

@media (max-width: 480px) {
  .rc-panel {
    padding: 20px 18px 24px;
  }

  .rc-door-panel {
    padding: 22px 18px 26px;
  }
}
