/* Public home page (not logged in): access panel for login and access requests */

/* header: "Log in" link next to the "Request access" button */
.pub-login { font-size: .92rem; font-weight: 500; color: var(--ink-soft); padding: 0 6px; white-space: nowrap; }
.pub-login:hover { color: var(--accent); }
@media (max-width: 1240px) { .pub-login { padding: 0 2px; font-size: .86rem; } }

/* ---------- overlay ---------- */
.pub-overlay { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(31, 28, 25, .46); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .22s ease; overflow-y: auto; overscroll-behavior: contain; }
.pub-overlay.show { opacity: 1; }
.pub-overlay[hidden] { display: none; }
body.pub-open { overflow: hidden; }

/* ---------- panel ---------- */
.pub-panel { position: relative; display: grid; grid-template-columns: 0.9fr 1.1fr; grid-template-rows: minmax(0, 1fr); width: 100%; max-width: 900px; min-height: 520px; max-height: calc(100vh - 48px);
  background: var(--paper); border-radius: 16px; overflow: hidden; box-shadow: 0 40px 100px rgba(20, 16, 12, .35), 0 2px 8px rgba(20, 16, 12, .12);
  transform: translateY(14px) scale(.985); transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
.pub-overlay.show .pub-panel { transform: none; }
.pub-panel.wide { max-width: 1000px; grid-template-columns: 0.75fr 1.25fr; }

.pub-media { position: relative; background: var(--bg-alt); min-height: 100%; }
.pub-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pub-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20, 16, 12, 0) 45%, rgba(20, 16, 12, .72) 100%); }
.pub-media .cap { position: absolute; left: 28px; right: 28px; bottom: 26px; z-index: 1; color: #fff; }
.pub-media .cap img { position: static; width: auto; height: 30px; margin-bottom: 14px; filter: brightness(0) invert(1); }
.pub-media .cap p { margin: 0; font-family: var(--serif); font-size: 1.45rem; line-height: 1.25; }

.pub-body { position: relative; min-height: 0; padding: clamp(28px, 4vw, 48px); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; }
.pub-body > * { flex-shrink: 0; }
.pub-body .eyebrow { margin-bottom: 6px; }
.pub-body h2 { margin: 0 0 10px; font-size: clamp(1.9rem, 3.2vw, 2.5rem); line-height: 1.08; }
.pub-body .lead { font-size: 1rem; line-height: 1.6; color: var(--ink-soft); margin: 0 0 22px; }

.pub-x { position: sticky; top: 0; margin: -14px -14px -24px auto; align-self: flex-end; z-index: 3; width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 50%;
  background: var(--paper); color: var(--ink-soft); cursor: pointer; box-shadow: 0 0 0 1px var(--line), 0 4px 14px rgba(20, 16, 12, .1); transition: background .15s, color .15s; }
.pub-x:hover { background: var(--bg-alt); color: var(--ink); }
.pub-x svg { width: 16px; height: 16px; }
.pub-back { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin: -6px 0 14px; padding: 4px 0; border: 0; background: none; font: inherit; font-size: .88rem; color: var(--muted); cursor: pointer; }
.pub-back:hover { color: var(--ink); }

/* gate: two choices */
.pub-choices { display: grid; gap: 12px; }
.pub-choice { display: flex; align-items: center; gap: 16px; width: 100%; padding: 18px 20px; text-align: left; font: inherit; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.pub-choice:hover { border-color: var(--accent); box-shadow: 0 8px 24px rgba(122, 90, 67, .12); transform: translateY(-1px); }
.pub-choice.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.pub-choice.primary:hover { background: #000; box-shadow: 0 10px 28px rgba(0, 0, 0, .22); }
.pub-choice .ic { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.pub-choice.primary .ic { background: rgba(255, 255, 255, .12); color: #fff; }
.pub-choice .ic svg { width: 19px; height: 19px; }
.pub-choice strong { display: block; font-weight: 500; font-size: 1rem; }
.pub-choice small { display: block; margin-top: 2px; font-size: .86rem; color: var(--muted); line-height: 1.4; }
.pub-choice.primary small { color: rgba(255, 255, 255, .7); }
.pub-choice .go { margin-left: auto; flex: none; opacity: .6; transition: transform .15s, opacity .15s; }
.pub-choice:hover .go { transform: translateX(3px); opacity: 1; }

.pub-list { list-style: none; margin: 24px 0 0; padding: 20px 0 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.pub-list li { display: flex; gap: 9px; align-items: flex-start; font-size: .88rem; color: var(--ink-soft); line-height: 1.4; }
.pub-list svg { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--accent); }

/* forms */
.pub-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pub-form .full { grid-column: 1 / -1; }
.pub-form label { display: block; font-size: .82rem; font-weight: 500; color: var(--ink-soft); margin-bottom: 6px; }
.pub-form label .opt { font-weight: 400; color: var(--muted); }
.pub-field { position: relative; }
.pub-form input, .pub-form select, .pub-form textarea { width: 100%; font: inherit; font-size: 1rem; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none; }
.pub-form select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238b8279' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.pub-field.ic input { padding-left: 44px; }
.pub-field.ic svg { position: absolute; left: 15px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.pub-form input:focus, .pub-form select:focus, .pub-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pub-form input.bad { border-color: #c0573f; box-shadow: 0 0 0 3px rgba(192, 87, 63, .12); }
.pub-form textarea { min-height: 84px; resize: vertical; }
.pub-form .trap { position: absolute; left: -5000px; width: 1px; height: 1px; opacity: 0; }
.pub-form .btn { width: 100%; justify-content: center; height: 50px; font-size: 1rem; }
.pub-form .btn[disabled] { opacity: .6; cursor: default; }
.pub-form .btn .spin { width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: pubspin .7s linear infinite; }
@keyframes pubspin { to { transform: rotate(360deg); } }

/* 6 code boxes */
.pub-code { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; max-width: 360px; }
.pub-code input { text-align: center; font-size: 1.6rem; font-weight: 500; padding: 12px 0; font-variant-numeric: tabular-nums; }

.pub-note { font-size: .82rem; color: var(--muted); line-height: 1.5; margin: 0; }
.pub-note.lock { display: flex; gap: 8px; align-items: flex-start; }
.pub-note.lock svg { flex: none; width: 14px; height: 14px; margin-top: 2px; }
.pub-msg { font-size: .9rem; min-height: 0; margin: 0; padding: 0; border-radius: 8px; }
.pub-msg:not(:empty) { padding: 10px 12px; background: #f8ebe7; color: #9a3b26; }
.pub-msg.info:not(:empty) { background: var(--bg); color: var(--ink-soft); }
.pub-alt { margin-top: auto; padding-top: 22px; font-size: .9rem; color: var(--muted); }
.pub-link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.pub-link:hover { color: var(--accent-dark); }
.pub-links { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .9rem; }

/* success */
.pub-ok { text-align: left; }
.pub-ok .tick { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: #e3ebe1; color: var(--ok); margin-bottom: 18px; }
.pub-ok .tick svg { width: 24px; height: 24px; }

/* ---------- phones: full-height sheet, no photo ---------- */
@media (max-width: 760px) {
  .pub-overlay { padding: 0; align-items: flex-end; }
  .pub-panel, .pub-panel.wide { grid-template-columns: 1fr; max-width: none; min-height: 0; max-height: 92vh; border-radius: 18px 18px 0 0; transform: translateY(40px); }
  .pub-media { display: none; }
  .pub-body { padding: 30px 22px calc(26px + env(safe-area-inset-bottom)); }
  .pub-form { grid-template-columns: 1fr; }
  .pub-list { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .pub-overlay, .pub-panel { transition: none; } }

/* phones: one compact "Log in" button in the header (the panel offers both choices) */
@media (max-width: 600px) {
  body.public .header-inner .cart-btn { display: none; }
  body.public .pub-login { margin-left: auto; display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border: 1px solid var(--ink); border-radius: 8px; color: var(--ink); font-weight: 500; font-size: .86rem; }
  body.public .lang-switch { margin-left: 8px; }
}
@media (max-width: 900px) { body.public .menu-btn { display: none; } }
