/* Mobile shell — AUTH screens (board "Login — mobile app").
   web-login is re-laid out by mshell/auth.js (nodes moved, never
   rebuilt). email-login / register / reset / verify and the
   "not enabled" / "not registered" panels share the same frame and
   are restyled here only. The approval splash (.approval-card) keeps
   its own look. Prefix: mwa-. */
@media (max-width: 979px) {
  /* full-bleed screen: no header chrome before sign-in */
  html.web-shell body[data-screen="auth"] .app-header { display: none !important; }
  html.web-shell body[data-screen="auth"] main#app {
    min-height: 100vh; min-height: 100dvh;
    padding: 0;
    background: radial-gradient(360px 300px at 50% 12%, rgba(240, 185, 11, 0.08), transparent 70%), var(--mws-bg);
  }
  html.web-shell body[data-screen="auth"] .auth-screen {
    max-width: 440px; margin: 0 auto; box-sizing: border-box;
    min-height: 100vh; min-height: 100dvh;
    padding: calc(28px + env(safe-area-inset-top, 0)) 28px calc(28px + env(safe-area-inset-bottom, 0));
    display: flex; align-items: center; justify-content: center;
  }
  html.web-shell .auth-card:not(.approval-card) {
    background: none; border: 0; box-shadow: none; padding: 0;
    width: 100%; min-width: 0;
    display: flex; flex-direction: column; align-items: stretch;
    color: var(--mws-ink);
  }

  /* brand: gold rounded square with the trend line */
  html.web-shell .auth-card:not(.approval-card) .auth-brand {
    text-align: center; margin: 0;
    display: flex; flex-direction: column; align-items: center;
  }
  html.web-shell .auth-card:not(.approval-card) .auth-brand::before {
    content: ""; width: 64px; height: 64px; border-radius: 18px;
    background:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M3 17 L9 11 L13 14 L21 5' stroke='%230a0b0e' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 32px 32px no-repeat,
      linear-gradient(135deg, #fcd535, #f0b90b);
    box-shadow: 0 12px 40px rgba(240, 185, 11, 0.3);
  }
  html.web-shell .auth-card:not(.approval-card) .auth-logo,
  html.web-shell .auth-card:not(.approval-card) .auth-logo-fallback { display: none; }
  html.web-shell .auth-card:not(.approval-card) .auth-brand h1 {
    margin: 18px 0 0; font-size: 26px; font-weight: 800; letter-spacing: -0.01em;
    color: var(--mws-ink);
  }
  html.web-shell .auth-card:not(.approval-card) .auth-subtitle {
    margin-top: 6px; font-size: 13.5px; color: var(--mws-ink-3);
  }
  /* sibling screens: space between brand and the form */
  html.web-shell .auth-card:not(.approval-card) > .auth-form { margin-top: 32px; }

  /* form */
  html.web-shell .auth-card:not(.approval-card) .auth-form { display: flex; flex-direction: column; }
  html.web-shell .auth-card:not(.approval-card) .auth-form .field {
    margin: 0 0 12px; display: flex; flex-direction: column; gap: 6px;
  }
  html.web-shell .auth-card:not(.approval-card) .auth-form .field-label {
    margin: 0; font-family: var(--mws-mono); font-size: 9.5px; font-weight: 500;
    letter-spacing: 0.12em; color: var(--mws-ink-3);
  }
  html.web-shell .auth-card:not(.approval-card) .auth-form input[type="password"],
  html.web-shell .auth-card:not(.approval-card) .auth-form input[type="email"],
  html.web-shell .auth-card:not(.approval-card) .auth-form input[type="text"] {
    height: 46px; padding: 0 14px; border-radius: 12px;
    background: var(--mws-card); border: 1px solid var(--mws-line);
    color: var(--mws-ink); font-family: var(--font); font-size: 16px; /* 16px: no iOS zoom */
    box-shadow: none; max-width: none;
  }
  html.web-shell .auth-card:not(.approval-card) .auth-form input:focus {
    border-color: rgba(240, 185, 11, 0.5); box-shadow: 0 0 0 3px rgba(240, 185, 11, 0.12);
  }
  html.web-shell .auth-card:not(.approval-card) .auth-form input::placeholder { color: var(--mws-ink-3); }
  html.web-shell .auth-card:not(.approval-card) .auth-form .field-hint {
    margin: 0; font-size: 11.5px; color: var(--mws-ink-3); line-height: 1.45;
  }
  html.web-shell .auth-card:not(.approval-card) .auth-error {
    margin: 2px 0 6px; border-radius: 12px; padding: 10px 12px;
    font-size: 12.5px; line-height: 1.45;
    background: rgba(234, 57, 67, 0.1); border: 1px solid rgba(234, 57, 67, 0.35);
    color: #ff8a92;
  }
  html.web-shell .auth-card:not(.approval-card) .auth-error a { color: var(--mws-gold); font-weight: 700; }

  /* gold pill (every auth submit + the "Register on Telegram" link) */
  html.web-shell .auth-card:not(.approval-card) .auth-submit {
    width: 100%; height: 50px; margin-top: 6px; padding: 0 18px; box-sizing: border-box;
    border-radius: 999px; border: 0;
    background: linear-gradient(180deg, #fcd535, #f0b90b); color: #1a1206;
    font-family: var(--font); font-size: 14.5px; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 30px -8px rgba(240, 185, 11, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    text-decoration: none;
  }
  html.web-shell .auth-card:not(.approval-card) .auth-submit[disabled] { opacity: 0.6; }

  /* links / switch rows */
  html.web-shell .auth-card:not(.approval-card) .auth-switch {
    margin-top: 16px; font-size: 12.5px; color: var(--mws-ink-3); text-align: center;
    flex-wrap: wrap; gap: 8px 16px;
  }
  html.web-shell .auth-card:not(.approval-card) .auth-switch a {
    color: var(--mws-gold); font-weight: 700; display: inline-block; padding: 6px 0;
  }
  html.web-shell .auth-card:not(.approval-card) .auth-switch.muted a { color: var(--mws-ink-2); font-weight: 600; }
  html.web-shell .auth-card:not(.approval-card) .hint,
  html.web-shell .auth-card:not(.approval-card) > p {
    font-size: 13px; line-height: 1.55; color: var(--mws-ink-2); text-align: center;
  }
  html.web-shell .auth-card:not(.approval-card) > p b { color: var(--mws-ink); overflow-wrap: anywhere; }
  html.web-shell .auth-card:not(.approval-card) .muted { color: var(--mws-ink-3); }

  /* ------------------------------------------ web-login (auth.js) */
  html.web-shell .mwa-card .mwa-tg {
    margin-top: 36px; min-height: 50px;
    display: flex; align-items: center; justify-content: center;
  }
  html.web-shell .mwa-card .mwa-tg iframe { display: block; max-width: 100%; }
  html.web-shell .mwa-card .mwa-tgwait {
    width: 100%; height: 50px; border-radius: 999px; box-sizing: border-box;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    background: rgba(46, 160, 221, 0.12); border: 1px solid rgba(46, 160, 221, 0.35);
    color: #7cc4ec; font-size: 13.5px; font-weight: 700;
  }
  html.web-shell .mwa-card .mwa-tg:has(iframe) .mwa-tgwait { display: none; }
  html.web-shell .mwa-card .mwa-tgwait svg { display: block; }
  html.web-shell .mwa-or {
    display: flex; align-items: center; gap: 12px; margin: 22px 0;
    font-family: var(--mws-mono); font-size: 10px; letter-spacing: 0.12em; color: var(--mws-ink-3);
  }
  html.web-shell .mwa-or .ln { flex: 1 1 auto; height: 1px; background: var(--mws-line); }
  html.web-shell .auth-card.mwa-card > .mwa-form { margin-top: 0; }
  html.web-shell .mwa-card .mwa-form .auth-submit { margin-top: 8px; }
  html.web-shell .mwa-card .mwa-forgot {
    align-self: flex-end; font-size: 12px; font-weight: 700; color: var(--mws-gold);
    text-decoration: none; padding: 4px 0;
  }
  html.web-shell .mwa-signup {
    margin-top: 18px; text-align: center; font-size: 12.5px; color: var(--mws-ink-3);
  }
  html.web-shell .mwa-signup a {
    color: var(--mws-gold); font-weight: 700; text-decoration: underline; text-underline-offset: 2px;
    display: inline-block; padding: 8px 0;
  }
  html.web-shell .mwa-trust {
    margin-top: 28px; align-self: center;
    display: flex; align-items: center; gap: 7px;
    font-size: 11px; color: var(--mws-ink-3); text-align: center;
  }
  html.web-shell .mwa-trust .ic { color: var(--mws-up); display: inline-flex; flex-shrink: 0; }
  html.web-shell .mwa-help {
    margin-top: 14px; display: flex; flex-direction: column; gap: 6px;
  }
  html.web-shell .mwa-card .mwa-help .mwa-helpline {
    margin: 0; font-size: 10.5px; line-height: 1.5; color: var(--mws-ink-3); text-align: center;
  }
}
