/* ============================================
   Axioma ID — PWA do Cliente
   Dark theme, mobile-first
   ============================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: Inter, -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0B0E14;
    color: #fff;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ========== LOADING / LOGIN ========== */

#loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    gap: 16px;
}

#loading-screen .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: #6c5ce7;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

#loading-screen .brand {
    font-size: 14px;
    color: #8a8f98;
    font-weight: 500;
}

#login-screen {
    display: none;
    min-height: 100vh;
    padding: 32px 16px;
}

#login-screen .login-header {
    text-align: center;
    margin-bottom: 32px;
    padding-top: 48px;
}

#login-screen .login-header h1 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
}

#login-screen .login-header p {
    color: #8a8f98;
    font-size: 14px;
}

#login-root {
    max-width: 400px;
    margin: 0 auto;
}

/* ========== APP ========== */

#app-root {
    display: none;
    max-width: 480px;
    margin: 0 auto;
    padding: 0 16px 32px;
    min-height: 100vh;
}

/* ========== HEADER ========== */

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid #1a1e28;
    margin-bottom: 24px;
}

.app-header .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.app-header .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #1a1e28;
}

.app-header .user-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #6c5ce7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

.app-header .user-greeting {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-header .btn-logout {
    background: none;
    border: 1px solid #2a2e38;
    color: #8a8f98;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    flex-shrink: 0;
}

.app-header .btn-logout:hover {
    border-color: #e74c3c;
    color: #e74c3c;
}

/* ========== ACTION BAR ========== */

.action-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    background: #12161F;
    border: 1px solid #1e2230;
    border-radius: 10px;
    color: #8a8f98;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.action-btn:hover {
    border-color: #6c5ce7;
    color: #fff;
}

.action-btn .action-icon {
    font-size: 15px;
}

/* ========== INSTALL MODAL ========== */

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.75);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.2s;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
    background: #12161F;
    border-radius: 16px;
    padding: 28px 24px;
    max-width: 420px;
    width: 100%;
    position: relative;
    animation: slideUp 0.25s;
}

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

.modal-close {
    position: absolute;
    top: 12px; right: 12px;
    background: none;
    border: none;
    color: #555;
    font-size: 22px;
    cursor: pointer;
    width: 32px; height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.15s;
}

.modal-close:hover {
    background: rgba(255,255,255,0.08);
    color: #999;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 4px;
}

.modal-subtitle {
    font-size: 14px;
    color: #8a8f98;
    text-align: center;
    margin-bottom: 20px;
}

.install-tabs {
    display: flex;
    gap: 4px;
    background: #0B0E14;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 20px;
}

.install-tab {
    flex: 1;
    padding: 8px;
    border: none;
    background: transparent;
    color: #8a8f98;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.install-tab.active {
    background: #6c5ce7;
    color: #fff;
}

.install-panel {
    display: none;
}

.install-panel.active {
    display: block;
}

.install-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
}

.install-step + .install-step {
    border-top: 1px solid #1a1e28;
}

.step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(108, 92, 231, 0.15);
    color: #6c5ce7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.install-step span:last-child {
    font-size: 14px;
    color: #ccc;
    line-height: 1.5;
    padding-top: 3px;
}

.install-step strong {
    color: #fff;
}

/* ========== SECTIONS ========== */

.app-section {
    margin-bottom: 28px;
}

.app-section .section-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-section .section-icon {
    font-size: 18px;
}

/* ========== CARDS ========== */

.data-card {
    background: #12161F;
    border: 1px solid #1e2230;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 10px;
    transition: border-color 0.15s;
}

.data-card:hover {
    border-color: #2a2e38;
}

.data-card .card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.data-card .card-service {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}

.data-card .card-business {
    font-size: 13px;
    color: #8a8f98;
}

.data-card .card-datetime {
    font-size: 13px;
    color: #8a8f98;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.data-card .card-status {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.card-status.status-confirmed {
    background: rgba(0, 184, 148, 0.15);
    color: #00b894;
}

.card-status.status-pending {
    background: rgba(253, 203, 110, 0.15);
    color: #fdcb6e;
}

.data-card .card-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #6c5ce7;
    text-decoration: none;
    font-weight: 500;
    margin-top: 10px;
    transition: color 0.15s;
}

.data-card .card-link:hover {
    color: #8577ed;
}

/* ========== VQG STAMP BAR ========== */

.stamp-bar {
    display: flex;
    gap: 4px;
    margin-top: 10px;
}

.stamp-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #2a2e38;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.stamp-dot.filled {
    background: #6c5ce7;
    border-color: #6c5ce7;
    color: #fff;
}

.stamp-reward {
    font-size: 12px;
    color: #8a8f98;
    margin-top: 6px;
}

/* ========== VIEW ALL LINK ========== */

.view-all {
    text-align: center;
    margin-top: 4px;
}

.view-all a {
    font-size: 13px;
    color: #6c5ce7;
    text-decoration: none;
    font-weight: 500;
}

.view-all a:hover {
    text-decoration: underline;
}

/* ========== DIVIDER ========== */

.section-divider {
    text-align: center;
    color: #555;
    font-size: 13px;
    font-weight: 500;
    margin: 32px 0 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-divider::before,
.section-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #1e2230;
}

/* ========== CROSS-SELL CARDS ========== */

.crosssell-card {
    background: #12161F;
    border: 1px solid #1e2230;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: border-color 0.15s;
}

.crosssell-card:hover {
    border-color: #2a2e38;
}

.crosssell-icon {
    font-size: 28px;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(108, 92, 231, 0.1);
    border-radius: 10px;
}

.crosssell-info {
    flex: 1;
    min-width: 0;
}

.crosssell-info .cs-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}

.crosssell-info .cs-desc {
    font-size: 13px;
    color: #8a8f98;
}

.crosssell-card .cs-link {
    color: #6c5ce7;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    flex-shrink: 0;
    white-space: nowrap;
}

.crosssell-card .cs-link:hover {
    text-decoration: underline;
}

/* ========== PLACE CARD (Meus Estabelecimentos) ========== */

.place-card {
    background: #12161F;
    border: 1px solid #1e2230;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: border-color 0.15s;
}

.place-card:hover {
    border-color: #2a2e38;
}

.place-logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: #1a1e28;
}

.place-initial {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(108, 92, 231, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: #6c5ce7;
    flex-shrink: 0;
}

.place-info {
    flex: 1;
    min-width: 0;
}

.place-name {
    font-size: 15px;
    font-weight: 600;
}

.place-links {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}

.place-link {
    font-size: 13px;
    color: #6c5ce7;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.place-link:hover {
    color: #8577ed;
}

/* ========== EMPTY STATE ========== */

.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: #8a8f98;
    line-height: 1.5;
}

/* ========== ERROR STATE ========== */

.error-state {
    text-align: center;
    padding: 40px 20px;
}

.error-state p {
    font-size: 14px;
    color: #8a8f98;
    margin-bottom: 16px;
}

.error-state .btn-retry {
    background: #6c5ce7;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.error-state .btn-retry:hover {
    filter: brightness(1.1);
}

/* ========== SECTION EMPTY ========== */

.section-empty {
    font-size: 13px;
    color: #555;
    padding: 12px 0;
}

/* ========== FOOTER ========== */

.app-footer {
    text-align: center;
    padding: 24px 0 16px;
    color: #333;
    font-size: 12px;
    font-weight: 500;
}

/* ========== RESPONSIVE ========== */

@media (min-width: 481px) {
    #app-root {
        padding: 0 24px 48px;
    }
}
