/* Instalação PWA — login do aluno/encarregado (estilo neutro) */
.pwa-login-install {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0.75rem 0 0.25rem;
    padding: 8px 12px 8px 8px;
    min-height: 48px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    color: #0f172a;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.pwa-login-install[hidden] {
    display: none;
}

.pwa-login-install:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.pwa-login-install:focus-visible {
    outline: none;
    border-color: #94a3b8;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.25);
}

.pwa-login-install:active {
    background: #f1f5f9;
}

.pwa-login-install__icon {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pwa-login-install__icon img {
    width: 28px;
    height: 28px;
    display: block;
}

.pwa-login-install__text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.pwa-login-install__text strong {
    font-size: 0.82rem;
    font-weight: 600;
    color: #0f172a;
}

.pwa-login-install__text small {
    font-size: 0.7rem;
    color: #64748b;
    line-height: 1.3;
}

.pwa-login-install__arrow {
    flex: 0 0 auto;
    color: #64748b;
    font-size: 14px;
}

/* Folha inferior (bottom sheet) */
.pwa-sheet {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.pwa-sheet[hidden] {
    display: none;
}

.pwa-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.pwa-sheet__panel {
    position: relative;
    width: 100%;
    max-width: 440px;
    max-height: 88vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    color: #0f172a;
    border: 1px solid #e5e7eb;
    border-bottom: 0;
    border-radius: 16px 16px 0 0;
    padding: 8px 18px calc(16px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.12);
    transform: translateY(100%);
    transition: transform 0.22s ease;
}

.pwa-sheet.is-open .pwa-sheet__backdrop {
    opacity: 1;
}

.pwa-sheet.is-open .pwa-sheet__panel {
    transform: translateY(0);
}

.pwa-sheet__grip {
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: #e5e7eb;
    margin: 0 auto 10px;
}

.pwa-sheet__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    font-size: 14px;
}

.pwa-sheet__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 40px 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.pwa-sheet__head img {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.pwa-sheet__head h3 {
    margin: 0 0 2px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
}

.pwa-sheet__head p {
    margin: 0;
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.4;
}

.pwa-sheet__steps {
    list-style: none;
    margin: 10px 0 4px;
    padding: 0;
}

.pwa-sheet__steps[hidden],
.pwa-sheet__note[hidden] {
    display: none;
}

.pwa-sheet__steps li {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.pwa-sheet__steps li:last-child {
    border-bottom: none;
}

.pwa-sheet__num {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #334155;
    font-weight: 600;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pwa-sheet__steps strong {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 2px;
}

.pwa-sheet__steps p {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.45;
    color: #64748b;
}

.pwa-sheet__ios-share {
    width: 18px;
    height: 18px;
    vertical-align: -4px;
    color: #334155;
}

.pwa-sheet__note {
    margin: 4px 0 8px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
    color: #475569;
    font-size: 0.76rem;
    line-height: 1.4;
}

.pwa-sheet__primary {
    display: block;
    width: 100%;
    min-height: 44px;
    margin-top: 8px;
    border: none;
    border-radius: 8px;
    background: #1e293b;
    color: #fff;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
}

.pwa-sheet__primary:active {
    background: #0f172a;
}

body.pwa-sheet-open {
    overflow: hidden;
}

@media (min-width: 768px) {
    .pwa-sheet {
        align-items: center;
    }

    .pwa-sheet__panel {
        border-bottom: 1px solid #e5e7eb;
        border-radius: 14px;
        padding-bottom: 18px;
    }

    .pwa-sheet__grip {
        display: none;
    }
}
