/* 
   App Benfazer Design System - Light & Fresh Edition
   Based on benfazer.pt branding
*/

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    /* Main Palette */
    --brand-green-start: #8ABF3F;
    --brand-green-end: #0FA54A;
    --brand-orange-start: #E9A900;
    --brand-orange-end: #DB7607;
    
    /* UI Palette - Light Mode */
    --bg-light: #F8F9FB;
    --bg-surface: #FFFFFF;
    --text-main: #1A202C;
    --text-muted: #718096;
    
    /* Accents */
    --accent-glow: #D1E9FF;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;

    /* Gradients */
    --grad-green: linear-gradient(135deg, var(--brand-green-start) 0%, var(--brand-green-end) 100%);
    --grad-orange: linear-gradient(135deg, var(--brand-orange-start) 0%, var(--brand-orange-end) 100%);
    --grad-surface: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.5) 100%);

    /* Effects */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.8);
    --soft-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
    --glow-shadow: 0 15px 35px -5px rgba(138, 191, 63, 0.2);
    
    /* Layout */
    --font-primary: 'Poppins', sans-serif;
    --radius-pill: 50px;
    --radius-card: 28px;
    --radius-input: 16px;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    font-family: var(--font-primary);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Base Layout */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 24px;
    padding-bottom: 120px; /* Espaço para a barra de navegação flutuante */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Glass Panels */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    box-shadow: var(--soft-shadow);
    padding: 20px;
}

/* Typography */
h1, h2, h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.text-gradient {
    background: var(--grad-green);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Buttons */
.btn-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    gap: 10px;
    text-decoration: none;
}

.btn-primary {
    background: var(--grad-green);
    color: white;
    box-shadow: var(--glow-shadow);
}

.btn-primary:active {
    transform: scale(0.96);
    box-shadow: 0 5px 15px rgba(138, 191, 63, 0.3);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: var(--soft-shadow);
}

/* Navbar */
.bottom-nav {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    height: 72px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border-radius: 35px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border: 1px solid white;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
    z-index: 1000;
}

.nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 600;
    transition: 0.3s;
}

.nav-link.active {
    color: var(--brand-green-end);
}

.nav-link i {
    font-size: 20px;
    margin-bottom: 4px;
}

/* Special Elements */
.logo-container {
    padding: 40px 0;
    text-align: center;
}

.logo-container img {
    height: 60px;
    margin-bottom: 20px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    width: 20px;
    height: 20px;
}

.form-input {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: var(--radius-input);
    padding: 16px 16px 16px 48px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--brand-green-start);
    box-shadow: 0 0 0 4px rgba(138, 191, 63, 0.1);
}

/* Auth Specific */
.auth-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-title {
    font-size: 2.2rem;
    margin-bottom: 8px;
}

.auth-subtitle {
    color: var(--text-muted);
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 32px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.auth-divider:not(:empty)::before { margin-right: 1em; }
.auth-divider:not(:empty)::after { margin-left: 1em; }

.btn-social {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid rgba(0,0,0,0.05);
    padding: 14px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: 0.3s;
}

.btn-social:hover {
    background: #fdfdfd;
}

/* Animations */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.animate-up {
    animation: slideUp 0.5s ease-out both;
}

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

.spin {
    animation: spin 1s linear infinite;
}

/* Dashboard Components */
.user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.user-greeting .subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.user-greeting .title {
    font-size: 1.6rem;
    font-weight: 700;
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: var(--soft-shadow);
}

/* Balance Cards */
.cards-slider {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    margin: 0 -24px;
    padding: 0 24px 16px;
}

.cards-slider::-webkit-scrollbar { display: none; }

.balance-card {
    flex: 0 0 calc(100% - 40px);
    scroll-snap-align: center;
    position: relative;
    overflow: hidden;
}

.balance-value {
    display: flex;
    align-items: baseline;
    margin: 12px 0;
}

.balance-value .amount {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
}

.balance-value .currency {
    font-size: 1.2rem;
    margin-left: 8px;
    color: var(--text-muted);
}

/* Action Grid */
.actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 24px 0 32px;
}

.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px;
    background: white;
    border-radius: var(--radius-card);
    box-shadow: var(--soft-shadow);
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    transition: 0.3s;
    border: 1px solid rgba(0,0,0,0.02);
}

.action-card:active {
    transform: scale(0.95);
}

.action-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* Transactions */
.recent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.transaction-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.transaction-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: white;
    border-radius: var(--radius-input);
    gap: 16px;
    box-shadow: var(--soft-shadow);
    border: 1px solid rgba(0,0,0,0.02);
}

.tx-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: var(--text-muted);
}

.tx-info {
    flex: 1;
}

.tx-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.tx-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.tx-value {
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tx-value.negative { color: var(--danger); }
.tx-value.positive { color: var(--brand-green-end); }

.mini-icon {
    width: 14px;
    height: 14px;
}

/* Profile Components */
.profile-card {
    text-align: center;
    padding: 32px 0;
    margin-bottom: 24px;
}

.avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: var(--soft-shadow);
    margin-bottom: 20px;
}

.profile-info h1 {
    font-size: 1.8rem;
    margin-bottom: 4px;
}

.profile-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.menu-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: white;
    border-radius: var(--radius-input);
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    box-shadow: var(--soft-shadow);
    transition: 0.3s;
    border: 1px solid rgba(0,0,0,0.02);
}

.menu-item:active {
    transform: scale(0.98);
    background: #fdfdfd;
}

.menu-icon-box {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: #f1f5f9;
}

.logout-item {
    color: var(--danger);
}

.logout-item .menu-icon-box {
    background: rgba(239, 68, 68, 0.05);
    color: var(--danger);
}

/* Event Components */
.event-card-new {
    background: white;
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: var(--soft-shadow);
    margin-bottom: 20px;
    border: 1px solid rgba(0,0,0,0.02);
}

.event-hero {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.event-details {
    padding: 24px;
}

.event-tag {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--brand-green-end);
    margin-bottom: 8px;
    display: block;
}

.event-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
}

.event-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.event-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Scanner Overlay */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.overlay-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 40px;
    margin-top: 20px;
}

.btn-close-overlay {
    position: absolute;
    left: 0;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.qr-reader-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    border: 2px solid var(--brand-green-start);
}

.qr-reader-container #qr-reader__scan_region video {
    border-radius: 20px !important;
}

.overlay-footer {
    margin-top: auto;
    text-align: center;
    padding-bottom: 40px;
}

/* Feedback Modal */
.feedback-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.feedback-container.active {
    opacity: 1;
    visibility: visible;
}

.feedback-modal {
    background: white;
    border-radius: var(--radius-card);
    padding: 32px;
    width: 100%;
    max-width: 320px;
    text-align: center;
    transform: scale(0.9);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
}

.feedback-container.active .feedback-modal {
    transform: scale(1);
}

.feedback-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.feedback-icon.success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.feedback-icon.error { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.feedback-icon.info { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }

.feedback-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.feedback-message {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 24px;
    line-height: 1.5;
}
