/* App-like behaviour for the auth pages + the install banner.
   It only adds to auth.css; it does not restyle your layout. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overscroll-behavior-y: none; }
a, button, label, select { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
@media (max-width: 768px) {
    /* 16px stops iPhone Safari zooming in when a field is tapped */
    input, select, textarea { font-size: 16px !important; }
}
.page-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }

.pwa-card {
    display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
    position: relative;
    margin: 0 0 20px; padding: 12px 38px 12px 12px;
    border-radius: 10px;
    background: #ecfdf3;
    border: 1px solid #b7e4c7;
    color: var(--text, #1f2937);
    text-align: left;
}
.pwa-card[hidden] { display: none; }
.pwa-ic { border-radius: 11px; flex: none; }
.pwa-tx { flex: 1 1 140px; min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.3; }
.pwa-tx strong { font-size: 14px; }
.pwa-tx span { font-size: 12px; opacity: .72; }
.pwa-btn {
    flex: none; height: 38px; padding: 0 18px; border: 0; border-radius: 10px; cursor: pointer;
    background: var(--green, #006837); color: #fff; font: 700 14px/1 inherit; font-family: inherit;
}
.pwa-btn:active { opacity: .85; }
.pwa-x {
    position: absolute; top: 4px; right: 6px; width: 30px; height: 30px; border: 0; border-radius: 50%;
    background: transparent; color: inherit; opacity: .55; font-size: 22px; line-height: 1; cursor: pointer;
}
.pwa-steps { flex: 1 1 100%; margin: 4px 0 0 2px; padding: 10px 12px 10px 30px; border-radius: 10px; background: #fff; border: 1px solid #d5ecdc; font-size: 13px; line-height: 1.5; }
.pwa-steps li + li { margin-top: 4px; }
.pwa-share { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12M8 7l4-4 4 4M5 12v7a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-7'/%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' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12M8 7l4-4 4 4M5 12v7a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-7'/%3E%3C/svg%3E") center/contain no-repeat; }

/* app icon in the brand row (replaces the old inline shield) */
.brand-row .brand-logo { width: 44px; height: 44px; flex: none; border-radius: 11px; display: block; }


/* ═════════ phone: behave like a native screen ═════════ */
@media (max-width: 520px) {
    body { background-attachment: scroll; }
    .page-main { padding: 0; align-items: stretch; }
    .auth-card {
        max-width: none; border: 0; border-radius: 0; box-shadow: none;
        display: flex; flex-direction: column;
    }
    .auth-head { padding: 22px 16px 18px; }
    .auth-body { flex: 1; padding: 22px 18px 26px; }
    .auth-title { font-size: 19px; }
    .auth-sub { font-size: 13px; margin-bottom: 22px; }

    .field { margin-bottom: 16px; }
    .field label, .field-top label { font-size: 12.5px; }
    .ig-addon { width: 46px; font-size: 16px; }
    .ig input, .ig select { height: 48px; font-size: 16px; padding: 0 14px; }
    .ig select { padding-right: 36px; }
    .hint { font-size: 12px; margin-top: 6px; }
    .link-green { font-size: 13px; padding: 6px 0; }
    .section-label { font-size: 12px; margin-top: 10px; }

    .btn-green { height: 52px; font-size: 16px; border-radius: 10px; margin-top: 10px; }
    .btn-green:active { transform: scale(.985); background: var(--green-hover); }
    .note { font-size: 12px; padding: 11px 12px; }
    .foot-links { font-size: 14px; line-height: 2.2; }
    .foot-links a { padding: 6px 2px; display: inline-block; }
    .page-foot { font-size: 12px; padding: 14px 18px calc(14px + env(safe-area-inset-bottom, 0px)); text-align: center; }
    .pwa-card { margin-bottom: 22px; }
    .pwa-btn { height: 44px; }
}

/* installed app: no browser bars, so give the header the room a status bar needs */
@media (display-mode: standalone) {
    .auth-head { padding-top: calc(22px + env(safe-area-inset-top, 0px)); }
    .page-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
}

/* ═════════ tablet / PC ═════════ */
@media (min-width: 521px) {
    .page-main { padding: 48px 24px; }
}
@media (min-width: 861px) {
    /* the long registration form uses two columns instead of a tall single strip */
    .auth-card--wide { max-width: 780px; }
    .auth-card--wide .auth-body { padding: 28px 36px 26px; }
    .auth-card--wide form { display: grid; grid-template-columns: 1fr 1fr; column-gap: 22px; }
    .auth-card--wide form > .section-label,
    .auth-card--wide form > .btn-green,
    .auth-card--wide form > .note,
    .auth-card--wide form > .divider,
    .auth-card--wide form > .foot-links { grid-column: 1 / -1; }
    .auth-card--wide .btn-green { max-width: 360px; margin-left: auto; margin-right: auto; }
}

/* smooth page-to-page transitions between login / register / reset (Chrome, Edge, Android) */
@media (prefers-reduced-motion: no-preference) {
    @view-transition { navigation: auto; }
}
