/* Mobile/tablet presentation for the existing owner/staff login. The PC layout
   above 1024px and all authentication behavior stay unchanged. */
@media (max-width: 1024px) {
  #auth-view.auth-shell {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    min-height: 100vh;
    min-height: 100svh;
    background: radial-gradient(ellipse at 100% 100%, #f8ece4 0, transparent 58%), #f7f4f1;
    padding: calc(28px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(28px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  }
  #auth-view > .auth-story {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 460px;
    min-height: 0;
    height: auto;
    margin: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: var(--ink, #292727);
  }
  #auth-view .auth-story .brand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 48px;
    margin: 0;
  }
  #auth-view .auth-story .brand img {
    content: url('/assets/brand/logo.svg');
    display: block;
    width: 144px;
    max-width: 100%;
    height: auto;
  }
  #auth-view .auth-story > div,
  #auth-view .auth-story h1,
  #auth-view .auth-story p,
  #auth-view .auth-story .eyebrow,
  #auth-view .auth-story .auth-steps,
  #auth-view .auth-story > small { display: none; }
  #auth-view > .auth-form {
    position: relative;
    flex: 0 0 auto;
    width: 100%;
    max-width: 460px;
    min-width: 0;
    margin: 0;
    padding: 26px 26px 23px;
    border: 1px solid #e5d9ce;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 12px 36px #3620150b;
  }
  #auth-view .auth-form > .eyebrow {
    display: none;
  }
  #auth-view .auth-form h2 { font-size: 26px; line-height: 1.4; letter-spacing: -.4px; }
  #auth-view .auth-form > #auth-copy {
    display: flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    margin: 9px 0 21px;
    padding: 5px 10px;
    border: 1px solid #eed5c5;
    border-radius: 9px;
    background: #fff6ef;
    color: #864425;
    font-size: 13px;
    line-height: 1.6;
  }
  #auth-view #auth-copy::before {
    content: '';
    width: 13px;
    height: 16px;
    flex: 0 0 13px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m12 2 8 3v6c0 5-8 10-8 10S4 16 4 11V5z' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'/%3E%3Cpath d='m8 11 3 3 5-5' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m12 2 8 3v6c0 5-8 10-8 10S4 16 4 11V5z' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'/%3E%3Cpath d='m8 11 3 3 5-5' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  }
  #auth-view .auth-form form { min-width: 0; }
  #auth-view .auth-form label {
    display: block;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 15px;
    color: var(--ink, #292727);
  }
  #auth-view .auth-form input:not([data-mfa-digit]) {
    width: 100%;
    min-width: 0;
    min-height: 50px;
    font-size: 16px;
    line-height: 1.5;
    padding: 11px 13px;
    margin-top: 6px;
    border: 1px solid #d9d0c8;
    border-radius: 11px;
    background: #fff;
    color: var(--ink, #292727);
  }
  #auth-view .auth-form input:not([data-mfa-digit]):focus {
    border-color: var(--brand, #a7441e);
    outline: 2px solid #a7441e30;
    outline-offset: 2px;
  }
  #auth-view .auth-form label > small {
    font-size: 12px;
    line-height: 1.5;
    color: var(--muted, #665d58);
    margin-top: 5px;
  }
  #auth-view .auth-form .button {
    min-height: 50px;
    border-radius: 12px;
    padding: 11px 14px;
    font-size: 16px;
    line-height: 1.5;
    margin: 5px 0 0;
  }
  #auth-view .auth-form .button.primary {
    color: #fff;
    background: var(--brand, #a7441e);
    border-color: var(--brand, #a7441e);
    box-shadow: 0 5px 12px #a7441e14;
  }
  #auth-view .auth-form > small {
    display: block;
    font-size: 12px;
    line-height: 1.7;
    color: var(--muted, #665d58);
    text-align: center;
    margin-top: 16px;
    overflow-wrap: anywhere;
  }
  #auth-view #auth-error:empty { display: none; }
  #auth-view #auth-error:not(:empty) {
    margin: 14px 0 0;
    border-left: 3px solid #a14f42;
    background: #fff5f1;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.7;
    overflow-wrap: anywhere;
  }
  #auth-view #mfa-panel > p {
    font-size: 14px;
    line-height: 1.8;
    color: var(--muted, #665d58);
    margin-bottom: 14px;
  }
  #auth-view #mfa-panel fieldset { min-width: 0; }
  #auth-view #mfa-panel #mfa-qr { margin: 15px auto 18px; width: fit-content; max-width: 100%; }
  #auth-view #mfa-qr img, #auth-view #mfa-qr canvas { max-width: 100%; height: auto; }
  #auth-view #mfa-panel .text-button {
    min-height: 46px;
    font-size: 14px;
    line-height: 1.7;
    padding: 10px 8px;
  }
  #auth-view #mfa-status { font-size: 12px; line-height: 1.7; }
  #auth-view #reset-admin-form > p { font-size: 14px; line-height: 1.8; margin-bottom: 17px; }
  #auth-view #mfa-qr:empty { display: none; margin: 0; }
}
@media (max-width: 1024px) and (max-height: 620px) {
  #auth-view.auth-shell {
    gap: 13px;
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
  #auth-view .auth-story .brand { min-height: 36px; }
  #auth-view .auth-story .brand img { width: 124px; }
  #auth-view > .auth-form { padding: 20px 18px 18px; margin: 0; }
  #auth-view .auth-form h2 { font-size: 25px; }
  #auth-view .auth-form > #auth-copy { margin-top: 7px; margin-bottom: 15px; }
  #auth-view .auth-form label { margin-bottom: 12px; }
  #auth-view .auth-form > small { margin-top: 12px; }
  #auth-view #mfa-panel > p { margin-bottom: 10px; }
  #auth-view:has(#mfa-panel:not([hidden])) .auth-form > #auth-copy { margin-bottom: 12px; }
}
