/* Phone login keeps the same account, registration and SMS actions as the web app.
   The form stays in document flow so browser chrome and the keyboard cannot trap it. */
@media screen and (max-width: 760px) , screen and (max-width:1000px) and (max-height:540px) and (orientation:landscape){
  .auth-shell {
    display: block;
    min-width: 0;
    min-height: 100svh;
    padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
    background: linear-gradient(155deg, #edf5ef 0%, #f8faf8 42%, #ffffff 85%);
  }
  .auth-shell .auth-story {
    width: 100%;
    max-width: 472px;
    min-height: 0;
    margin: 0 auto;
    padding: 24px 24px 2px;
    color: #244a30;
    background: transparent;
  }
  .auth-shell .auth-brand { gap: 11px; padding: 0; }
  .auth-shell .auth-brand .brand-mark {
    width: 52px;
    height: 52px;
    padding: 0;
    flex: 0 0 52px;
    overflow: visible;
    background: transparent;
  }
  /* Preserve the full approved logo; no offset or oversized image crop. */
  .auth-shell .auth-brand .brand-mark img {
    position: static;
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    object-position: center;
  }
  .auth-shell .auth-brand > div { min-width: 0; }
  .auth-shell .auth-brand strong { font-size: 20px; letter-spacing: 1.5px; line-height: 1.5; }
  .auth-shell .auth-brand small { font-size: 8px; letter-spacing: 1px; line-height: 1.6; color: #667a6d; }
  .auth-shell .auth-story-main {
    position: relative;
    isolation: isolate;
    margin: 0;
    padding: 20px 0 12px;
  }
  .auth-shell .auth-story-main > h1 {
    position: relative;
    z-index: 1;
    max-width: none;
    color: #244a30;
    font-size: clamp(25px, 6.9vw, 29px);
    font-weight: 750;
    line-height: 1.34;
    letter-spacing: -.6px;
    overflow-wrap: anywhere;
  }
  .auth-shell .auth-story h1 br { display: block; }
  .auth-shell .auth-story-main > p {
    position: relative;
    z-index: 1;
    max-width: none;
    margin-top: 10px;
    color: #5e7265;
    font-size: 12px;
    line-height: 1.85;
  }
  .auth-shell .auth-story-main > p br { display: none; }
  .auth-shell .auth-story .eyebrow,
  .auth-shell .auth-story .auth-flow,
  .auth-shell .auth-story-bottom { display: none; }
  /* Existing factory artwork is only a quiet backdrop, never a new business claim. */
  .auth-shell .glass-scene {
    display: block;
    position: absolute;
    width: 480px;
    max-width: none;
    height: 250px;
    right: 0;
    top: 15px;
    margin: 0;
    transform: scale(.36);
    transform-origin: right top;
    opacity: .2;
    z-index: -1;
    pointer-events: none;
  }
  .auth-shell .scene-orbit,
  .auth-shell .glass-data-two { display: none; }
  .auth-shell .auth-panel {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 10px 16px 28px;
    overflow: visible;
  }
  .auth-shell .auth-form-wrap {
    width: 100%;
    min-width: 0;
    max-width: 440px;
    margin: 0 auto;
    padding: 24px 20px 21px;
    border: 1px solid #244a3014;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 14px 40px #244a3009, 0 2px 5px #244a3004;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .auth-shell .auth-form-wrap > .eyebrow { color: #8c735b; font-size: 9px; letter-spacing: 1.4px; }
  .auth-shell .auth-form-wrap h2 { color: #244a30; font-size: 24px; line-height: 1.4; letter-spacing: -.5px; }
  .auth-shell .auth-form-wrap > p { margin: 7px 0 20px; color: #63766a; font-size: 12px; line-height: 1.75; }
  .auth-shell .auth-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 0;
    margin-bottom: 18px;
  }
  .auth-shell .auth-tab { min-width: 0; min-height: 46px; padding: 10px 2px; font-size: 13px; text-align: center; white-space: nowrap; }
  .auth-shell .sms-auth-methods { padding: 4px; margin-bottom: 18px; border-radius: 11px; background: #f1f5f2; border-color: #dfe8e1; }
  .auth-shell .sms-auth-methods button { min-height: 44px; border-radius: 7px; font-size: 14px; color: #566e5e; }
  .auth-shell .sms-auth-methods button.active { color: #244a30; background: #fff; }
  .auth-shell .auth-form { min-width: 0; gap: 17px; }
  .auth-shell .auth-form label { min-width: 0; color: #344b3c; font-size: 14px; line-height: 1.5; }
  .auth-shell .auth-form :is(input, select, textarea) {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 50px;
    padding: 12px 13px;
    border: 1px solid #dce5de;
    border-radius: 10px;
    background: #f8faf8;
    color: #242625;
    font-size: 16px;
    line-height: 1.4;
    scroll-margin-block: 24px 120px;
  }
  .auth-shell .auth-form :is(input, select, textarea):focus { background: #fff; border-color: #6ca285; box-shadow: 0 0 0 3px #6ca28520; }
  .auth-shell .auth-form input::placeholder { color: #7c8b80; opacity: 1; }
  .auth-shell .auth-form .button { min-height: 52px; padding: 13px 14px; border-radius: 10px; font-size: 16px; }
  .auth-shell .auth-form > .button { margin-top: 3px; }
  .auth-shell .register-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .auth-shell .register-grid .span-2 { grid-column: auto; }
  .auth-shell .sms-code-row { min-width: 0; grid-template-columns: minmax(0, 1fr) 108px; gap: 8px; align-items: stretch; }
  .auth-shell .sms-code-row input { margin-top: 0; letter-spacing: .5px; }
  .auth-shell .auth-form .sms-code-row .button { min-height: 50px; padding: 9px 6px; font-size: 13px; white-space: normal; line-height: 1.35; }
  .auth-shell .sms-service-note { min-width: 0; padding: 11px; font-size: 12px; overflow-wrap: anywhere; }
  .auth-shell .sms-service-note button { min-height: 44px; margin: 0; padding: 6px 0; font-size: 13px; }
  .auth-shell .sms-field-hint { font-size: 11px; color: #667a6d; }
  .auth-shell .sms-auth-feedback { margin-bottom: 16px; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
  .auth-shell .admin-login-hint { padding: 11px 12px; font-size: 12px; line-height: 1.75; overflow-wrap: anywhere; }
  .auth-shell .auth-divider { margin: 22px 0 13px; font-size: 11px; }
  .auth-shell .demo-entry > .button { min-height: 48px; padding: 11px; border-radius: 10px; color: #385741; font-size: 14px; }
  .auth-shell .demo-note { margin-top: 10px; color: #667a6d; font-size: 11px; line-height: 1.7; }
  .auth-shell .auth-footer { margin-top: 18px; color: #687b6e; font-size: 11px; line-height: 1.85; }
  .auth-shell :is(button, [role="button"]) {
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 120ms cubic-bezier(.23, 1, .32, 1);
  }
  .auth-shell button:active:not(:disabled) { transform: scale(.98); }
  .auth-shell :is(button, input, select, textarea):focus-visible { outline: 2px solid #6ca285; outline-offset: 3px; }
}

/* More room for the input rather than a decorative header on short landscape phones. */
@media screen and (max-width: 760px) and (max-height: 540px) and (orientation: landscape) , screen and (max-width:1000px) and (max-height:540px) and (orientation:landscape) and (max-height: 540px) and (orientation: landscape){
  .auth-shell .auth-story { padding-top: 14px; }
  .auth-shell .auth-brand .brand-mark { width: 44px; height: 44px; flex-basis: 44px; }
  .auth-shell .auth-story-main { padding: 12px 0 6px; }
  .auth-shell .auth-story-main > h1 { font-size: 24px; }
  .auth-shell .auth-story-main > p { margin-top: 6px; }
  .auth-shell .glass-scene { display: none; }
}

/* Existing desktop hover paint must not stick after a tap on a phone. */
@media screen and (max-width: 760px) and (hover: none) , screen and (max-width:1000px) and (max-height:540px) and (orientation:landscape) and (hover: none){
  .auth-shell .button:hover { background: var(--green, #244a30); }
  .auth-shell .button.secondary:hover { background: #fff; }
}
@media screen and (max-width: 760px) and (prefers-reduced-motion: reduce) , screen and (max-width:1000px) and (max-height:540px) and (orientation:landscape) and (prefers-reduced-motion: reduce){
  .auth-shell :is(button, [role="button"]) { transition: none; }
}
