/* app/public/webapp/css/webapp.css */

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; -webkit-tap-highlight-color: transparent; }

body { background-color: #e5e7eb; display: flex; justify-content: center; align-items: center; min-height: 100vh; overflow: hidden; }

#app-container { width: 100%; max-width: 480px; height: 100vh; max-height: 100vh; background-color: #f8fafc; position: relative; overflow-x: hidden; overflow-y: auto; box-shadow: 0 0 20px rgba(0, 0, 0, 0.15); display: flex; flex-direction: column; }

.app-screen { display: none; flex-direction: column; width: 100%; min-height: 100%; animation: slideIn 0.3s ease-out forwards; }
.app-screen.active { display: flex; }

@keyframes slideIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-20px); } }

/* LOGIN & RECUPERAÇÃO */
.login-header { height: 60px; display: flex; align-items: center; padding: 0 20px; }
.btn-voltar { background: transparent; border: none; color: var(--app-primary); font-size: 16px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.btn-voltar:active { opacity: 0.7; }

.app-logo-container { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 20px; min-height: 150px; }
.generic-login-icon { width: 80px; height: 80px; display: flex; justify-content: center; align-items: center; margin-bottom: 15px; }
.generic-login-icon img { width: 100%; height: 100%; object-fit: contain; border-radius: 12px; }
.generic-login-title { font-size: 22px; color: #1e293b; font-weight: 600; margin-bottom: 5px; }
.generic-login-subtitle { font-size: 14px; color: #64748b; line-height: 1.4; }

.login-body { flex: 1; padding: 0 30px 20px; display: flex; flex-direction: column; justify-content: center; }
.input-group { margin-bottom: 20px; display: flex; flex-direction: column; position: relative; }
.input-group label { font-size: 14px; color: #475569; margin-bottom: 8px; font-weight: 500; }
.input-group input { width: 100%; padding: 14px 16px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 16px; color: #1e293b; background-color: #ffffff; transition: all 0.3s; outline: none; }
.input-group input:focus { border-color: var(--app-primary); box-shadow: 0 0 0 3px rgba(var(--app-primary-rgb), 0.2); }
.password-group .toggle-password { position: absolute; right: 16px; top: 42px; color: #94a3b8; font-size: 18px; cursor: pointer; }

.btn-primary { width: 100%; padding: 16px; background-color: var(--app-primary); color: #ffffff; border: none; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; transition: background-color 0.3s, transform 0.1s; box-shadow: 0 4px 6px rgba(var(--app-primary-rgb), 0.3); }
.btn-primary:active { transform: scale(0.98); background-color: var(--app-primary-dark); }
.btn-primary:disabled { opacity: 0.7; cursor: not-allowed; }

.login-links { display: flex; justify-content: space-between; align-items: center; margin-top: 25px; }
.forgot-link { color: #64748b; text-decoration: none; font-size: 14px; font-weight: 500; padding: 10px; }

/* TERMOS E PRIVACIDADE */
.login-footer-terms { margin-top: auto; padding: 20px; text-align: center; font-size: 12px; color: #94a3b8; line-height: 1.5; }
.login-footer-terms a { color: var(--app-primary); text-decoration: none; font-weight: 600; }
.login-footer-terms a:active { text-decoration: underline; }

/* CAIXA DE EMAIL MASCARADO */
.masked-email-box { background-color: #f1f5f9; border: 1px dashed #cbd5e1; border-radius: 8px; padding: 15px; text-align: center; font-size: 13px; color: #475569; margin-bottom: 20px; }
.masked-email-box strong { display: block; font-size: 16px; color: var(--app-primary); margin-top: 5px; letter-spacing: 0.5px; }

/* HOME HEADER */
.home-header { background-color: var(--app-primary); color: #ffffff; padding: 20px 20px; display: flex; justify-content: space-between; align-items: flex-start; position: relative; z-index: 10; transition: background-color 0.4s ease; }
.user-info-bar { display: flex; align-items: center; gap: 15px; }
.user-avatar { width: 48px; height: 48px; background-color: rgba(255, 255, 255, 0.2); border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 20px; border: 2px solid #ffffff; }
.user-text { display: flex; flex-direction: column; }
.greeting { font-size: 16px; font-weight: 600; margin: 0; }
.company-name { font-size: 12px; opacity: 0.8; margin: 0; }
.header-actions { display: flex; gap: 10px; }
.btn-icon { background: transparent; border: none; color: #ffffff; font-size: 24px; cursor: pointer; padding: 5px; transition: transform 0.2s; }

/* SELETOR DE UNIDADE */
.unidade-selector-container { background-color: #1e293b; color: #fff; padding: 8px 20px 15px; display: flex; align-items: center; gap: 10px; border-bottom-left-radius: 24px; border-bottom-right-radius: 24px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); position: relative; z-index: 9; margin-top: -5px; }
.location-icon { color: #cbd5e1; font-size: 16px; }
.unidade-select { flex: 1; background: transparent; border: none; color: #ffffff; font-size: 14px; font-weight: 500; outline: none; appearance: none; cursor: pointer; }
.unidade-select option { color: #1e293b; background: #fff; }

.home-logo-area { display: flex; justify-content: center; align-items: center; padding: 25px 20px 10px; min-height: 80px; }
.home-logo { max-width: 200px; max-height: 60px; object-fit: contain; }

.home-body { padding: 10px 20px 25px; display: flex; flex-direction: column; flex: 1; }

.search-product-container { position: relative; width: 100%; margin-bottom: 25px;}
.search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 16px; }
.search-product-input { width: 100%; padding: 16px 16px 16px 45px; border: 1px solid #e2e8f0; border-radius: 30px; font-size: 15px; color: #334155; background-color: #ffffff; box-shadow: 0 4px 6px rgba(0,0,0,0.02); outline: none; transition: all 0.3s; }
.search-product-input:focus { border-color: var(--app-primary); box-shadow: 0 0 0 3px rgba(var(--app-primary-rgb), 0.1); }

/* VITRINE E CATEGORIAS */
.products-showcase { margin-bottom: 20px; }
.showcase-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; padding: 0 5px;}
.showcase-title { font-size: 16px; color: #1e293b; font-weight: 600; margin: 0; }
.category-select { background-color: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 8px; padding: 6px 10px; font-size: 12px; color: #475569; outline: none; max-width: 50%; cursor: pointer; }

.products-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.product-card { background: #ffffff; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; align-items: center; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.04); border: 1px solid #f1f5f9; transition: transform 0.2s; }
.product-card:active { transform: scale(0.97); }
.product-image-container { width: 100%; height: 120px; display: flex; justify-content: center; align-items: center; margin-bottom: 10px; background-color: #ffffff; border-radius: 8px; overflow: hidden;}
.product-image { max-width: 100%; max-height: 100%; object-fit: contain; }
.product-name { font-size: 13px; color: #334155; font-weight: 500; margin-bottom: 8px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; height: 34px;}
.product-price { font-size: 16px; color: var(--app-primary); font-weight: 700; margin-bottom: 4px; }
.product-ean { font-size: 10px; color: #94a3b8; letter-spacing: 0.5px; background: #f8fafc; padding: 2px 6px; border-radius: 4px; margin-top: auto;}

.action-grid.single-action { display: grid; grid-template-columns: 1fr; }
.action-btn { background-color: #ffffff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 18px 15px; display: flex; align-items: center; justify-content: center; gap: 12px; color: #334155; font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.2s; box-shadow: 0 4px 6px rgba(0,0,0,0.02); }
.action-btn i { font-size: 24px; color: #25D366; }

.home-footer { margin-top: auto; display: flex; flex-direction: column; gap: 15px; }

.welcome-section { background-color: #ffffff; border-radius: 16px; overflow: hidden; box-shadow: 0 4px 10px rgba(0,0,0,0.05); border: 1px solid #f1f5f9; }
.welcome-message { padding: 15px 20px; font-size: 14px; color: #475569; line-height: 1.5; text-align: center; margin: 0; border-bottom: 1px solid #f1f5f9; }
.welcome-image { width: 100%; height: auto; max-height: 140px; object-fit: cover; display: block; }

.social-bar { display: flex; justify-content: center; gap: 15px; }
.social-icon { width: 44px; height: 44px; border-radius: 50%; display: flex; justify-content: center; align-items: center; color: #ffffff; font-size: 20px; text-decoration: none; transition: transform 0.2s; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.social-icon.wpp { background-color: #25D366; }
.social-icon.insta { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%); }
.social-icon.face { background-color: #1877F2; }
.social-icon.yt { background-color: #FF0000; }

/* TOAST (TOPO) */
#webapp-toast-container { position: absolute; top: 170px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; width: 90%; max-width: 400px; z-index: 1000; pointer-events: none; }
.toast { background-color: #334155; color: #ffffff; padding: 12px 20px; border-radius: 30px; font-size: 14px; font-weight: 500; margin-top: 10px; box-shadow: 0 4px 12px rgba(0,0,0,0.2); opacity: 0; transform: translateY(-20px); transition: opacity 0.3s, transform 0.3s; text-align: center; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background-color: #ef4444; }
.toast.success { background-color: #10b981; }

#app-container::-webkit-scrollbar { width: 6px; }
#app-container::-webkit-scrollbar-track { background: #f1f5f9; }
#app-container::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }