/* BIG American OS — Login & PWA Styles (< 300 LOC) */
:root {
    --bg-dark: #09090b;
    --card-bg: rgba(18, 18, 21, 0.92);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-border-hover: rgba(220, 38, 38, 0.35);
    --primary-red: #dc2626;
    --primary-hover: #ef4444;
    --primary-active: #b91c1c;
    --input-bg: #141417;
    --input-border: #27272a;
    --text-white: #ffffff;
    --text-muted: #a1a1aa;
    --text-subtle: #71717a;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-white);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Background & Ambient Glow Effect */
.corpoO {
    position: relative; display: flex; align-items: center; justify-content: center;
    min-height: 100vh; padding: 110px 20px 50px;
    background: radial-gradient(circle at 50% 25%, #42020a 0%, #150005 50%, var(--bg-dark) 100%);
    overflow: hidden;
}
.bg-glow {
    position: absolute; width: 650px; height: 650px;
    background: radial-gradient(circle, rgba(220, 38, 38, 0.28) 0%, rgba(220, 38, 38, 0.05) 50%, rgba(0, 0, 0, 0) 75%);
    top: 45%; left: 50%; transform: translate(-50%, -50%); pointer-events: none;
    animation: pulseGlow 7s ease-in-out infinite alternate;
}
@keyframes pulseGlow {
    0% { transform: translate(-50%, -50%) scale(0.85); opacity: 0.6; }
    100% { transform: translate(-50%, -50%) scale(1.15); opacity: 0.95; }
}

/* Dynamic Rotating Gears */
.iconegirado {
    position: absolute; width: 750px; bottom: -350px; right: -350px;
    animation: rotate 140s linear infinite; opacity: 0.10; pointer-events: none;
}
.iconegirado-secundario {
    position: absolute; width: 500px; top: -220px; left: -220px;
    animation: rotateReverse 100s linear infinite; opacity: 0.07; pointer-events: none;
}
@keyframes rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes rotateReverse { from { transform: rotate(360deg); } to { transform: rotate(0deg); } }

/* Card Modal */
.card-login {
    position: relative; z-index: 10; width: 100%; max-width: 440px;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border); border-radius: 24px;
    padding: 0 32px 32px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.9), 0 0 1px 1px rgba(255, 255, 255, 0.05);
    animation: cardAppear 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.card-login:hover {
    border-color: var(--card-border-hover);
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.95), 0 0 30px -10px rgba(220, 38, 38, 0.25);
}
@keyframes cardAppear {
    from { opacity: 0; transform: translateY(24px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Large Logo (50% Above Card Edge) */
.logo-wrapper {
    position: relative; display: flex; justify-content: center; align-items: center;
    margin-top: -90px; margin-bottom: 20px;
}
.logotipo {
    position: relative; z-index: 2; width: 180px; height: 180px; object-fit: contain;
    filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.7));
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Card Header Title */
.card-header-title { text-align: center; margin-bottom: 24px; }
.card-header-title h2 { font-family: 'Outfit', sans-serif; font-size: 25px; font-weight: 800; letter-spacing: 0.5px; color: var(--text-white); }
.card-header-title h2 span { color: var(--primary-red); }
.card-header-title p { font-size: 13px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }

/* Form & Inputs */
.form-grupo { margin-bottom: 20px; }
.form-grupo label { display: block; font-size: 13px; font-weight: 600; color: #e4e4e7; margin-bottom: 8px; }
.input-container { position: relative; display: flex; align-items: center; }
.input-icon { position: absolute; left: 14px; color: var(--text-muted); display: flex; align-items: center; pointer-events: none; transition: color 0.2s; }
.form-grupo input {
    width: 100%; padding: 14px 44px 14px 44px;
    background: var(--input-bg); border: 1px solid var(--input-border); border-radius: 12px;
    font-size: 15px; color: var(--text-white); font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.form-grupo input::placeholder { color: #52525b; }
.form-grupo input:focus {
    outline: none; background: #1a1a1e; border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.22);
}
.form-grupo input:focus + .input-icon, .input-container:focus-within .input-icon { color: var(--primary-red); }

/* Password Toggle Eye Button */
.btn-toggle-password {
    position: absolute; right: 12px; background: none; border: none;
    color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center;
    padding: 6px; border-radius: 6px; transition: color 0.2s, background-color 0.2s;
}
.btn-toggle-password:hover { color: var(--text-white); background: rgba(255, 255, 255, 0.08); }
.is-hidden { display: none !important; }

/* Submit Button */
.botao {
    width: 100%; padding: 15px; margin-top: 10px;
    background: var(--primary-red); border: none; border-radius: 12px;
    color: var(--text-white); font-family: 'Outfit', sans-serif; font-size: 16px; font-weight: 700;
    letter-spacing: 0.5px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35); transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.botao:hover { background-color: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(220, 38, 38, 0.45); }
.botao:active { transform: translateY(0); background-color: var(--primary-active); box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3); }

/* Error Alert */
.erro {
    background: rgba(220, 38, 38, 0.15); border: 1px solid rgba(220, 38, 38, 0.4);
    color: #fca5a5; padding: 12px 16px; border-radius: 12px; margin-bottom: 20px;
    font-size: 14px; display: flex; align-items: center; gap: 10px;
    animation: shakeAlert 0.4s ease-in-out;
}
@keyframes shakeAlert {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

/* Install App Button — Oculto por padrão (só exibe no navegador comum quando elegível) */
.install-wrapper {
    display: none;
    margin-top: 18px; text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 16px;
}
.btn-install-app {
    display: none;
    align-items: center; justify-content: center; gap: 8px;
    background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-white); font-family: 'Outfit', sans-serif; font-size: 14px; font-weight: 600;
    padding: 10px 18px; border-radius: 10px; cursor: pointer; width: 100%;
    transition: background-color 0.25s, border-color 0.25s, transform 0.2s, color 0.2s;
}
.btn-install-app.is-visible {
    display: inline-flex;
}
.btn-install-app svg { color: var(--primary-red); transition: transform 0.2s; }
.btn-install-app:hover {
    background: rgba(220, 38, 38, 0.12); border-color: rgba(220, 38, 38, 0.4);
    color: #ffffff; transform: translateY(-1px);
}
.btn-install-app:hover svg { transform: translateY(1px); }

/* SUPRESSÃO ABSOLUTA NO MODO PWA INSTALADO */
@media (display-mode: standalone), (display-mode: window-controls-overlay), (display-mode: fullscreen), (display-mode: minimal-ui) {
    .install-wrapper,
    .btn-install-app,
    #btn-pwa-install,
    .modal-pwa-guide {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}

.app-mode-standalone .install-wrapper,
.app-mode-standalone .btn-install-app,
.app-mode-standalone #btn-pwa-install,
.app-mode-standalone .modal-pwa-guide {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Modal PWA Guide (iOS / Desktop) */
.modal-pwa-guide {
    position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center;
    padding: 20px; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-pwa-guide.is-active { opacity: 1; visibility: visible; }
.modal-pwa-backdrop {
    position: absolute; inset: 0; background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.modal-pwa-card {
    position: relative; z-index: 2; width: 100%; max-width: 420px;
    background: #141418; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 20px;
    padding: 24px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
    transform: scale(0.92); transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-pwa-guide.is-active .modal-pwa-card { transform: scale(1); }
.modal-pwa-header { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; position: relative; }
.modal-pwa-logo { width: 44px; height: 44px; border-radius: 10px; object-fit: contain; }
.modal-pwa-header h3 { font-size: 17px; font-weight: 700; color: #fff; }
.modal-pwa-header p { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.modal-pwa-close {
    position: absolute; top: -6px; right: -6px; background: none; border: none;
    color: var(--text-muted); font-size: 24px; cursor: pointer; padding: 4px 8px; line-height: 1;
}
.modal-pwa-close:hover { color: #fff; }
.modal-pwa-steps { display: flex; flex-direction: column; gap: 14px; margin-bottom: 22px; }
.pwa-step { display: flex; align-items: flex-start; gap: 12px; font-size: 13.5px; color: #e4e4e7; line-height: 1.45; }
.pwa-step-num {
    background: var(--primary-red); color: #fff; font-weight: 700; font-size: 12px;
    width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center;
    justify-content: center; flex-shrink: 0; margin-top: 1px;
}
.pwa-icon-share, .pwa-icon-add { vertical-align: middle; margin: 0 2px; color: var(--primary-red); }
.modal-pwa-btn-ok {
    width: 100%; padding: 12px; background: var(--primary-red); border: none; border-radius: 10px;
    color: #fff; font-weight: 600; font-size: 14px; cursor: pointer; transition: background-color 0.2s;
}
.modal-pwa-btn-ok:hover { background-color: var(--primary-hover); }

/* Responsive Mobile Layout */
@media (max-width: 480px) {
    .corpoO { padding: 95px 16px 30px; }
    .card-login { padding: 0 22px 28px; border-radius: 20px; }
    .logo-wrapper { margin-top: -80px; }
    .logotipo { width: 155px; height: 155px; }
    .card-header-title h2 { font-size: 22px; }
    .form-grupo input { padding: 13px 40px 13px 40px; font-size: 14px; }
    .botao { padding: 14px; font-size: 15px; }
}