:root {
    /* Recycle Pontecagnano Theme: Premium Green & White */
    --color-primary: #2fac4a; /* Logo Green */
    --color-primary-dark: #228b37;
    --color-primary-light: #d1fae5;
    
    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    
    --border-color: #e2e8f0;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-green: 0 10px 15px -3px rgba(16, 185, 129, 0.3);
    
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
}

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

body {
    background-color: var(--color-bg);
    color: var(--text-main);
}

.app-container {
    max-width: 480px; /* Mobile size restriction on desktop */
    margin: 0 auto;
    background-color: var(--color-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--shadow-lg);
}

/* Header */
.app-header {
    background: var(--color-surface);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--color-primary-dark);
}

.logo i {
    font-size: 1.5rem;
    color: var(--color-primary);
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--color-primary-light);
}

/* Main Content */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 100px; /* Space for bottom nav */
}

/* Views Management */
.view {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.view.active {
    display: block;
}

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

/* Welcome Box */
.welcome-box {
    margin-bottom: 24px;
}

.welcome-box h1 {
    font-size: 1.8rem;
    margin-bottom: 4px;
}

.welcome-box p {
    color: var(--text-muted);
}

/* Credit Card */
.credit-card {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    border-radius: var(--radius-lg);
    padding: 24px;
    color: white;
    box-shadow: var(--shadow-green);
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.credit-card::after {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.credit-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 8px;
}

.credit-amount {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.credit-subtitle {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Referral Section */
.referral-section {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.referral-section h2 {
    margin-bottom: 10px;
    color: var(--text-main);
}

.referral-section p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

.qr-container {
    background: var(--color-primary-light);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
    display: inline-block;
    width: 100%;
}

.qr-code {
    width: 120px;
    height: 120px;
    background: white;
    margin: 0 auto 10px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.qr-code i {
    font-size: 5rem;
    color: var(--text-main);
}

.referral-code {
    font-size: 1.1rem;
}

.referral-code strong {
    color: var(--color-primary-dark);
    letter-spacing: 1px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-block {
    width: 100%;
    margin-bottom: 12px;
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-outline {
    background-color: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Bottom Navigation */
.bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-surface);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 10px 20px;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.nav-item {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    padding: 10px;
    flex: 1;
    cursor: pointer;
    transition: color 0.2s;
}

.nav-item i {
    font-size: 1.5rem;
}

.nav-item span {
    font-size: 0.8rem;
    font-weight: 600;
}

.nav-item.active {
    color: var(--color-primary);
}

.nav-item.active i {
    font-weight: bold;
}

.action-btn .fab-btn {
    background: var(--color-primary);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-top: -24px;
    box-shadow: var(--shadow-green);
    border: 4px solid var(--color-surface);
    transition: transform 0.2s;
}

.action-btn.active .fab-btn {
    transform: scale(1.1);
}

.action-btn i {
    color: white;
}

/* Page Header */
.page-header {
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 1.8rem;
    color: var(--text-main);
}

.page-header p {
    color: var(--text-muted);
}

/* Store */
.category-tabs {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding-bottom: 12px;
    margin-bottom: 20px;
    scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.cat-btn {
    white-space: nowrap;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--color-surface);
    color: var(--text-main);
    font-weight: 600;
    cursor: pointer;
}

.cat-btn.active {
    background: var(--text-main);
    color: white;
    border-color: var(--text-main);
}

.products-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.product-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.badge-ribbon {
    position: absolute;
    top: -8px;
    left: 16px;
    background: var(--color-primary);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 12px;
}

.badge-ribbon.discount {
    background: #ef4444; /* Red for discount */
}

.product-image {
    width: 80px;
    height: 80px;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image i {
    font-size: 3rem;
    color: var(--text-muted);
}

.product-info {
    flex: 1;
}

.product-info h3 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.product-info .desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.product-info .price {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--color-primary-dark);
    margin-bottom: 12px;
}

.old-price {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-decoration: line-through;
    font-weight: normal;
    margin-left: 6px;
}

/* Sell Form */
.sell-form-container {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-main);
}

input[type="text"], select {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    background: var(--color-bg);
    outline: none;
    transition: border-color 0.2s;
}

input:focus, select:focus {
    border-color: var(--color-primary);
    background: var(--color-surface);
}

.radio-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.radio-card input {
    display: none;
}

.radio-card .card-content {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 4px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--color-bg);
}

.radio-card .card-content i {
    font-size: 1.5rem;
    margin-bottom: 4px;
    color: var(--text-muted);
}

.radio-card .card-content span {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
}

.radio-card input:checked + .card-content {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.radio-card input:checked + .card-content i,
.radio-card input:checked + .card-content span {
    color: var(--color-primary-dark);
}

/* Valuation Result */
.valuation-result {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px dashed var(--border-color);
    text-align: center;
}

.valuation-result h3 {
    margin-bottom: 12px;
}

.est-price {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--color-primary);
    margin-bottom: 12px;
}

.valuation-result p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-main);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.9rem;
    opacity: 0;
    transition: all 0.3s;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Status Timeline Styles (Horizontal Semaforo) */
.timeline-container {
    padding: 10px 5px;
    margin: 20px 0;
}

.timeline-track {
    height: 4px;
    background: #e2e8f0;
    width: 100%;
    position: relative;
    border-radius: 2px;
}

.timeline-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: var(--color-primary);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-steps {
    display: flex;
    justify-content: space-between;
    margin-top: -10px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 2;
    width: 80px;
}

.step .dot {
    width: 16px;
    height: 16px;
    background: #cbd5e1;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 2px #e2e8f0;
    transition: all 0.3s ease;
}

.step span {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.3s ease;
    text-align: center;
}

.step.active .dot {
    background: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary), 0 0 10px rgba(47, 172, 74, 0.4);
    transform: scale(1.2);
}

.step.active span {
    color: var(--color-primary);
}

.step.completed .dot {
    background: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary);
}

.step.completed span {
    color: var(--text-main);
}

/* Login Overlay */
.login-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-bg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease-in-out;
}

.login-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.login-content {
    background: var(--color-surface);
    padding: 30px 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo {
    margin-bottom: 20px;
}

.login-logo img {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.login-content h2 {
    font-size: 1.8rem;
    color: var(--text-main);
    margin-bottom: 8px;
}

.login-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 24px;
}

.forgot-pwd {
    margin-top: 16px;
    font-size: 0.85rem;
}

.forgot-pwd a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

/* WIZARD TrenDevice Style */
.wizard-container {
    overflow: hidden;
    position: relative;
    padding-bottom: 20px;
}

.wizard-step {
    display: none;
    animation: slideInRight 0.4s ease forwards;
}

.wizard-step.active {
    display: block;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

.wizard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 15px;
}

.wizard-card {
    background: var(--color-surface);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.wizard-card i {
    font-size: 2.2rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    transition: color 0.2s;
}

.wizard-card span {
    font-weight: 600;
    font-size: 0.95rem;
}

.wizard-card:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.wizard-card.selected {
    border-color: var(--color-primary);
    background: #f0fdf4;
}
.wizard-card.selected i {
    color: var(--color-primary);
}

.wizard-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}
.wizard-list .wizard-card {
    flex-direction: row;
    justify-content: flex-start;
    padding: 15px 20px;
    text-align: left;
}
.wizard-list .wizard-card i {
    margin-bottom: 0;
    margin-right: 15px;
}

.show-result {
    text-align: center;
    padding: 30px 15px;
    background: var(--color-surface);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
