/* The login page (login.html, login.js). Loaded after account.css, only by login.html.
   Desktop and tablets: one letter on the desk with two paper index tabs behind its top edge, Log in and Create an
   account, and a wax seal by the main button. Forgot password is three steps on the same letter.
   Phones (760px and less): one page at a time that turns (a ribbon bookmark and page numbers, like a book), the
   sign-up questions are the numbered lines of a reader's card, and the reset steps are stamps on a kraft slip. */

.gwl .acct-panel { position: relative; }
.gwl .gwl-page { position: relative; z-index: 1; }

/* ---------- The tabs ---------- */
.gwl-tabs { position: relative; z-index: 0; display: flex; gap: 6px; padding: 0 30px; margin-bottom: -14px; }
.gwl-tabs[hidden] { display: none; }
.gwl-tab {
  position: relative; padding: 12px 22px 24px; border: 0; border-radius: 8px 8px 0 0; cursor: pointer;
  font: 600 12.5px/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: #5f4b2e;
  background: var(--fibre), linear-gradient(180deg, #e4d1a2, #d2b980); background-blend-mode: hard-light, normal;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), inset 0 0 0 .5px rgba(60,40,15,.35), 0 -2px 8px -4px rgba(0,0,0,.5);
  transform: translateY(7px); transition: transform .25s var(--ease), color .2s;
}
.gwl-tab[aria-selected="true"] {
  color: var(--burgundy); transform: none;
  background: var(--fibre), linear-gradient(180deg, #fffaf0, var(--paper)); background-blend-mode: hard-light, normal;
}
.gwl-tab[aria-selected="false"]:hover { transform: translateY(3px); color: var(--burgundy); }
.gwl-tab:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- Inside the letter ---------- */
.gwl .acct-lede { max-width: 46ch; }
.gwl .field-hint { display: block; margin-top: 6px; font-size: 13.5px; line-height: 1.45; color: var(--text-dark-muted); }
.gwl-qs { list-style: none; margin: 0; padding: 0; }
.gwl-pass-field { position: relative; }
.gwl-forgot { position: absolute; top: 0; right: 0; min-height: 0; padding: 0; font-size: 13.5px; line-height: 1.4; }
.gwl-turn { margin: 14px 0 0; }
.gwl-turn .link-btn b { font-weight: 600; }
.gwl-ribbon, .gwl-folio, .gwl-card-head { display: none; }

/* The main button and its wax seal: pressed while the form is being sent */
.gwl-post { align-items: center; }
.gwl-seal {
  width: 54px; height: 54px; flex: none; margin-left: 4px;
  background: url(assets/art/wax-seal-rh.webp) center / contain no-repeat;
  filter: drop-shadow(0 2px 2px rgba(40,10,10,.45)); transform: rotate(-8deg); transition: transform .25s var(--ease), filter .25s;
}
.is-sealing .gwl-seal { transform: rotate(-14deg) scale(.86); filter: drop-shadow(0 0 1px rgba(40,10,10,.6)) brightness(.92); }

/* Password rules, ticked off as you type, and how strong it is */
.gwl-pw-help { margin-top: 8px; font-size: 13px; line-height: 1.45; color: #6a5a3f; }
.gwl-rules { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 18px; }
.gwl-rules li { position: relative; padding-left: 20px; }
.gwl-rules li::before {
  content: ""; position: absolute; left: 0; top: .32em; width: 12px; height: 12px; border: 1.5px solid rgba(90,64,30,.5); border-radius: 50%;
}
.gwl-rules li.is-ok { color: #2f5d34; }
.gwl-rules li.is-ok::before { border-color: #2f5d34; background: #2f5d34 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 6.3l2 2 4-4.6' fill='none' stroke='%23fbf5e6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 10px no-repeat; }
.gwl-meter { display: flex; align-items: center; gap: 10px; margin: 6px 0 0; }
.gwl-bars { display: inline-flex; gap: 4px; flex: none; }
.gwl-bars i { width: 30px; height: 5px; border-radius: 3px; background: rgba(90,64,30,.18); transition: background-color .2s; }
[data-score="1"] .gwl-bars i:nth-child(-n+1) { background: #a3332b; }
[data-score="2"] .gwl-bars i:nth-child(-n+2) { background: #a8741c; }
[data-score="3"] .gwl-bars i:nth-child(-n+3) { background: #4f7a3f; }
[data-score="4"] .gwl-bars i { background: #2f5d34; }
[data-score="1"] [data-meter-word] { color: #8f1d1d; }
[data-score="3"] [data-meter-word], [data-score="4"] [data-meter-word] { color: #2f5d34; }

/* The newsletter question and the privacy tick */
.gwl-q--letter { margin: 6px 0 14px; }
.gwl-q--letter fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.gwl-q--letter legend { padding: 0; margin-bottom: 6px; font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--text-dark-muted); }
.gwl-q--letter legend .opt { letter-spacing: 0; text-transform: none; font-weight: 400; }
.gwl .check { color: var(--text-dark); }
.gwl-interests { margin: 6px 0 0 28px; display: flex; flex-wrap: wrap; gap: 2px 18px; }
.gwl-interests[hidden] { display: none; }
.gwl-interests-h { flex-basis: 100%; margin: 0; font-size: 13.5px; color: var(--text-dark-muted); }
.gwl-agree { margin: 4px 0 14px; }
.gwl-agree .field-hint { margin: 2px 0 0 28px; }
.gwl-agree a { color: var(--burgundy); }

/* Resetting a password: three steps along the top of the letter */
.gwl-steps { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #6f5f44; }
.gwl-steps li { padding-top: 8px; border-top: 3px solid rgba(90,64,30,.2); }
.gwl-steps b { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 4px; border-radius: 50%;
  border: 1.5px solid currentColor; font-size: 11px; letter-spacing: 0; }
.gwl-steps li.is-done { color: #5f4f37; border-color: var(--gold-lo); }
.gwl-steps li.is-done b { background: var(--gold-lo); border-color: var(--gold-lo); color: transparent; position: relative; }
.gwl-steps li.is-done b::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #fbf5e6; }
.gwl-steps li[aria-current="step"] { color: var(--burgundy); border-color: var(--burgundy); }
.gwl-steps li[aria-current="step"] b { background: var(--burgundy); border-color: var(--burgundy); color: #fbefd2; }
.gwl-tips { margin: -6px 0 18px; padding: 0 0 0 18px; font-size: 14.5px; color: var(--text-dark-muted); }
.gwl-tips li + li { margin-top: 4px; }
.gwl [data-panel="sent"]:focus { outline: none; }
.gwl [data-resend][disabled] { cursor: default; }

/* ---------- Phones: a book whose pages turn, a reader's card, stamps ---------- */
@media (max-width: 760px) {
  .gwl-tabs, .gwl-tabs[hidden] { display: none; }
  .gwl-seal { display: none; }

  /* A ribbon bookmark on the log-in page and a page number at the foot of the two pages */
  .gwl-ribbon { display: block; position: absolute; top: -6px; right: 20px; z-index: 2; width: 16px; height: 62px; pointer-events: none;
    background: var(--cloth), linear-gradient(90deg, #5e1823, #8a2a38 45%, #5e1823); background-blend-mode: soft-light, normal;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%); filter: drop-shadow(0 2px 1px rgba(0,0,0,.35)); }
  .gwl-card .gwl-ribbon { display: none; }
  .gwl-folio { display: block; margin: 14px 0 0; text-align: center; font: italic 16px/1 var(--serif); color: #7a6a4e; }
  .gwl-folio::before, .gwl-folio::after { content: " — "; }

  /* "New here? Create a reader account →" / "← Have an account? Log in": the page's turned-up corner */
  .gwl.acct-sign .gwl-turn .link-btn {
    position: relative; width: 100%; min-height: 48px; justify-content: center; gap: 6px; margin: 4px 0 0; padding: 0 18px;
    border: 1px solid rgba(110,31,44,.4); border-radius: 3px; text-decoration: none; text-transform: none; letter-spacing: 0;
    font-size: 15px; font-weight: 400; color: var(--burgundy);
    background: linear-gradient(225deg, #d9c59a 0 12px, rgba(90,64,30,.25) 12px 13px, transparent 13px), rgba(255,255,255,.4);
  }
  .gwl-turn--back .link-btn { background: linear-gradient(135deg, #d9c59a 0 12px, rgba(90,64,30,.25) 12px 13px, transparent 13px), rgba(255,255,255,.4) !important; }
  .gwl-forgot { position: static; display: flex !important; justify-content: flex-end; margin: 2px 0 -6px auto; font-size: 15px; }
  .gwl-pass-field { display: flex; flex-direction: column; }

  /* Create an account: a reader's card, its questions numbered in the margin and written on ruled lines */
  .gwl-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 0 0 14px; padding-bottom: 6px;
    border-bottom: 2px solid rgba(110,31,44,.7); }
  .gwl-card-head b { font: 700 12px var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--burgundy); }
  .gwl-card-head span { font: italic 15px var(--serif); color: var(--text-dark-muted); white-space: nowrap; }
  .gwl-card .letter-salute { margin-bottom: 6px; }
  .gwl-qs { counter-reset: q; }
  .gwl-q { counter-increment: q; position: relative; padding: 0 0 14px 30px; margin: 0 0 14px !important; border-bottom: 1px solid rgba(110,150,185,.55); }
  .gwl-q::before { content: counter(q); position: absolute; left: 0; top: -4px; font: 600 26px/1 var(--serif); color: var(--burgundy); }
  .gwl-q--letter { margin-bottom: 10px !important; border-bottom: 0; }
  .gwl-rules { gap: 2px 14px; }
  /* the strength bars on one line, what they say (or the tip) under them, full width */
  .gwl-meter { flex-wrap: wrap; gap: 6px 10px; }
  .gwl-meter [data-meter-word] { flex-basis: 100%; }
  .gwl-interests { margin-left: 0; }
  .gwl-agree .field-hint { margin-left: 0; }

  /* Resetting: three stamps on a kraft slip */
  .gwl-steps { margin: 0 0 16px; padding: 10px 10px 12px; gap: 8px; border-radius: 3px; font-size: 10.5px; letter-spacing: .08em; color: #3a2510;
    background: url(assets/art/kraft.webp) 0 0 / 256px, #b98c56;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.25), inset 0 0 0 .5px rgba(60,35,10,.4), 0 6px 10px -6px rgba(0,0,0,.5); }
  .gwl-steps li { display: grid; place-items: center; gap: 2px; min-height: 52px; padding: 5px 4px; text-align: center; line-height: 1.2;
    border: 2px dashed rgba(58,37,16,.55); border-radius: 4px; transform: rotate(2deg); }
  .gwl-steps li:nth-child(2) { transform: rotate(-1.5deg); }
  .gwl-steps b { width: auto; height: auto; margin: 0; border: 0; font: 600 18px/1 var(--serif); }
  .gwl-steps li.is-done { color: #4a0f19; border: 2px solid rgba(74,15,25,.75); }
  .gwl-steps li.is-done b { background: none; color: #4a0f19; }
  .gwl-steps li.is-done b::after { content: none; }
  .gwl-steps li.is-done b::before { content: "✓ "; }
  .gwl-steps li[aria-current="step"] { color: var(--burgundy); border: 2px solid var(--burgundy); background: rgba(251,245,230,.88); transform: rotate(-3deg); }
  .gwl-steps li[aria-current="step"] b { background: none; color: var(--burgundy); }
  .gwl-tips { font-size: 15px; }
}

/* Still pictures and reduced motion: nothing moves (login.js skips the page turn too) */
html.calm .gwl-tab, html.calm .gwl-seal, html.calm .gwl-bars i { transition: none; }
@media (prefers-reduced-motion: reduce) {
  .gwl-tab, .gwl-seal, .gwl-bars i { transition: none; }
}
