/* Vinted Alert — Stili */

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container { max-width: 900px; margin: 0 auto; padding: 0 20px; }

/* Header */
header { background: #1976D2; color: white; padding: 12px 0; position: sticky; top: 0; z-index: 100; }
header .container { display: flex; justify-content: space-between; align-items: center; }
header h1 { font-size: 1.3rem; }
header nav { display: flex; gap: 12px; align-items: center; }
header nav a { color: white; text-decoration: none; }

/* Buttons */
.btn {
    padding: 10px 20px; border: none; border-radius: 8px;
    cursor: pointer; font-size: 0.95rem; font-weight: 500;
    text-decoration: none; display: inline-block; transition: all 0.2s;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: #1976D2; color: white; }
.btn-primary:hover:not(:disabled) { background: #1565C0; }
.btn-outline { background: transparent; color: #1976D2; border: 2px solid #1976D2; }
.btn-outline:hover:not(:disabled) { background: #1976D2; color: white; }
.btn-danger { background: #e53935; color: white; }
.btn-danger:hover:not(:disabled) { background: #c62828; }
.btn-small { padding: 6px 12px; font-size: 0.85rem; }
.btn-large { padding: 14px 32px; font-size: 1.1rem; }
.btn-full { width: 100%; }
header .btn-outline { color: white; border-color: white; }
header .btn-outline:hover { background: white; color: #1976D2; }

/* Hero */
.hero {
    background: linear-gradient(135deg, #1976D2, #0D47A1);
    color: white; text-align: center; padding: 80px 20px;
}
.hero h2 { font-size: 2.2rem; margin-bottom: 16px; }
.hero p { font-size: 1.2rem; opacity: 0.9; max-width: 600px; margin: 0 auto 24px; }
.hero-sub { font-size: 0.9rem; opacity: 0.7; margin-top: 12px; }

/* Features */
.features { padding: 60px 20px; background: white; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 30px; }
.feature { text-align: center; padding: 20px; }
.feature-icon { font-size: 2.5rem; margin-bottom: 12px; }
.feature h3 { margin-bottom: 8px; color: #1976D2; }

/* Pricing */
.pricing { padding: 60px 20px; }
.pricing h2 { text-align: center; margin-bottom: 30px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.plan {
    background: white; border-radius: 12px; padding: 30px;
    text-align: center; border: 2px solid #eee;
}
.plan-featured { border-color: #1976D2; position: relative; }
.plan-featured::before {
    content: attr(data-badge); position: absolute; top: -12px; left: 50%;
    transform: translateX(-50%); background: #1976D2; color: white;
    padding: 4px 16px; border-radius: 20px; font-size: 0.8rem;
}
.plan h3 { margin-bottom: 8px; }
.price { font-size: 2rem; font-weight: 700; color: #1976D2; margin-bottom: 16px; }
.price span { font-size: 0.9rem; color: #999; font-weight: 400; }
.plan ul { list-style: none; margin-bottom: 20px; }
.plan li { padding: 6px 0; border-bottom: 1px solid #f5f5f5; }

/* Social Proof Bar */
.social-proof { background: #0D47A1; color: white; padding: 24px 20px; }
.proof-grid { display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; }
.proof-item { text-align: center; }
.proof-value { display: block; font-size: 1.5rem; font-weight: 700; }
.proof-label { display: block; font-size: 0.85rem; opacity: 0.8; margin-top: 4px; }

/* How it works */
.how-it-works { padding: 60px 20px; background: #f5f5f5; }
.how-it-works h2 { text-align: center; margin-bottom: 40px; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.step { text-align: center; padding: 20px; }
.step-number {
    width: 48px; height: 48px; border-radius: 50%;
    background: #1976D2; color: white; font-size: 1.3rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
}
.step h3 { color: #1976D2; margin-bottom: 8px; }

/* Features title */
.features-title { text-align: center; margin-bottom: 40px; }

/* Why us */
.why-us { padding: 60px 20px; background: #f5f5f5; }
.why-us h2 { text-align: center; margin-bottom: 40px; }
.why-grid { display: flex; flex-direction: column; gap: 16px; max-width: 640px; margin: 0 auto; }
.why-item {
    display: flex; align-items: flex-start; gap: 16px;
    background: white; padding: 20px; border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.why-icon { font-size: 1.8rem; flex-shrink: 0; line-height: 1; }
.why-item h3 { margin-bottom: 4px; color: #1976D2; font-size: 1rem; }
.why-item p { color: #666; font-size: 0.95rem; }

/* Pricing strong */
.plan li strong { color: #1976D2; }

/* FAQ */
.faq { padding: 60px 20px; background: white; }
.faq h2 { text-align: center; margin-bottom: 40px; }
.faq-list { max-width: 640px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid #eee; }
.faq-item summary {
    padding: 16px 0; font-weight: 600; cursor: pointer; font-size: 1rem;
    list-style: none; display: flex; justify-content: space-between; align-items: center;
}
.faq-item summary::after { content: '+'; font-size: 1.3rem; color: #1976D2; font-weight: 700; flex-shrink: 0; margin-left: 16px; }
.faq-item[open] summary::after { content: '\2212'; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item p { padding: 0 0 16px; color: #666; line-height: 1.6; }

/* Final CTA */
.final-cta { background: linear-gradient(135deg, #1976D2, #0D47A1); color: white; text-align: center; padding: 60px 20px; }
.final-cta h2 { font-size: 2rem; margin-bottom: 16px; }
.final-cta p { font-size: 1.1rem; opacity: 0.9; margin-bottom: 24px; }
.final-cta .hero-sub { font-size: 0.9rem; opacity: 0.7; margin-top: 12px; margin-bottom: 0; }

/* Footer */
.site-footer { background: #333; color: #aaa; text-align: center; padding: 20px; font-size: 0.85rem; }

/* Auth */
.auth-container {
    max-width: 400px; margin: 80px auto; background: white;
    padding: 40px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.auth-container h2 { margin-bottom: 20px; }
.auth-container form { display: flex; flex-direction: column; gap: 12px; }
.auth-container input {
    padding: 12px; border: 2px solid #ddd; border-radius: 8px;
    font-size: 1rem;
}
.auth-container input:focus { border-color: #1976D2; outline: none; }
.auth-container p { margin-top: 16px; text-align: center; }
.auth-container a { color: #1976D2; }
.error { color: #e53935; margin-top: 8px; }
.success { color: #2e7d32; margin-top: 8px; }
.text-muted { color: #999; font-size: 0.9rem; }

/* Dashboard */
.dashboard-content { padding-top: 20px; padding-bottom: 40px; }

/* Stats */
.stats-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
    margin-bottom: 20px;
}
.stat-card {
    background: white; border-radius: 12px; padding: 20px;
    text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.stat-value { font-size: 2rem; font-weight: 700; color: #1976D2; }
.stat-label { font-size: 0.85rem; color: #999; margin-top: 4px; }

/* Cards */
.card {
    background: white; border-radius: 12px; padding: 24px;
    margin-bottom: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.card h3 { margin-bottom: 16px; }

/* Plan bar */
.plan-bar, .telegram-bar {
    display: flex; justify-content: space-between; align-items: center;
    gap: 16px; flex-wrap: wrap;
}
.plan-bar h3, .telegram-bar h3 { margin-bottom: 4px; }

/* Tabs */
.tabs { display: flex; gap: 0; margin-bottom: 20px; border-bottom: 2px solid #eee; }
.tab {
    padding: 10px 20px; border: none; background: none; cursor: pointer;
    font-size: 0.95rem; font-weight: 500; color: #999;
    border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.2s;
}
.tab.active { color: #1976D2; border-bottom-color: #1976D2; }
.tab:hover { color: #333; }

/* Forms */
.form-row { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.form-row input, .form-row select {
    flex: 1 1 0;
    min-width: 0;
    box-sizing: border-box;
    padding: 10px; border: 2px solid #ddd;
    border-radius: 8px; font-size: 0.95rem;
    max-width: 100%;
}
.form-row input:focus, .form-row select:focus { border-color: #1976D2; outline: none; }
.form-row label { display: flex; align-items: center; gap: 6px; cursor: pointer; }

/* Form: hint sotto i campi ricerca con link guida */
.form-row-hint {
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px; flex-wrap: wrap;
    font-size: 0.9rem;
}
.form-row-hint label { display: flex; align-items: center; gap: 6px; }
.form-row-hint a { white-space: nowrap; }

/* Alert items */
.alert-item {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap;
    padding: 12px 0; border-bottom: 1px solid #f0f0f0;
    gap: 12px;
}
.alert-info { flex: 1; min-width: 0; }
.alert-info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert-meta { font-size: 0.85rem; color: #999; }
.alert-actions { display: flex; gap: 8px; flex-shrink: 0; }
/* Modale generico */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.modal {
    background: #fff;
    border-radius: 12px;
    width: 100%; max-width: 640px;
    max-height: 90vh; overflow-y: auto; overflow-x: hidden;
    padding: 24px;
    box-sizing: border-box;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.modal * { box-sizing: border-box; }
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px;
}
.modal-header h3 { margin: 0; }
.modal-close {
    background: none; border: none; font-size: 1.6rem; line-height: 1;
    cursor: pointer; color: #666; padding: 4px 10px;
}
.modal-close:hover { color: #000; }
.modal-actions {
    display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px;
}
@media (max-width: 600px) {
    .modal { padding: 18px; border-radius: 8px; }
    .modal-actions { flex-direction: column-reverse; }
    .modal-actions .btn { width: 100%; }
}
.empty { color: #999; text-align: center; padding: 20px; }

/* Results grid */
.results-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.result-item {
    background: #fafafa; border-radius: 8px; overflow: hidden;
    text-decoration: none; color: inherit; border: 1px solid #eee;
    transition: transform 0.15s, box-shadow 0.15s;
    display: block;
}
.result-item:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.result-img { width: 100%; height: 160px; overflow: hidden; background: #eee; }
.result-img img { width: 100%; height: 100%; object-fit: cover; }
.result-no-img {
    width: 100%; height: 100%; display: flex; align-items: center;
    justify-content: center; color: #ccc; font-size: 0.85rem;
}
.result-info { padding: 10px; }
.result-title {
    font-weight: 500; font-size: 0.9rem; margin-bottom: 4px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.result-price { color: #1976D2; font-weight: 700; font-size: 1.1rem; }
.result-meta { font-size: 0.75rem; color: #999; margin-top: 4px; }

#results-select-bar { margin-bottom: 16px; }
#results-alert-select {
    width: 100%; padding: 10px; border: 2px solid #ddd;
    border-radius: 8px; font-size: 0.95rem;
}
#results-alert-select:focus { border-color: #1976D2; outline: none; }
#results-load-more { margin-top: 16px; }

/* Badges */
.badge {
    padding: 4px 10px; border-radius: 20px; font-size: 0.75rem;
    font-weight: 600; text-transform: uppercase;
}
.badge-free { background: #e0e0e0; color: #666; }
.badge-pro { background: #E3F2FD; color: #1976D2; }
.badge-sniper { background: #FFF3E0; color: #E65100; }

/* Toast */
#toast-container {
    position: fixed; bottom: 20px; right: 20px; z-index: 1000;
    display: flex; flex-direction: column; gap: 8px;
}
.toast {
    padding: 12px 20px; border-radius: 8px; color: white;
    font-size: 0.9rem; font-weight: 500;
    opacity: 0; transform: translateX(100%);
    transition: all 0.3s ease;
    max-width: 350px;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast-success { background: #2e7d32; }
.toast-error { background: #c62828; }
.toast-info { background: #1976D2; }

/* Tooltip */
[data-tooltip] {
    position: relative;
}
[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 200;
}
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 200;
}
[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
    opacity: 1;
}

/* Stat card cliccabile */
.stat-clickable {
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.stat-clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Telegram instructions */
.telegram-instructions {
    margin-top: 12px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.6;
}
.telegram-instructions code {
    background: #e0e0e0;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}
.btn-copy {
    padding: 4px 10px;
    font-size: 0.8rem;
    background: #1976D2;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-left: 8px;
}
.btn-copy:hover { background: #1565C0; }

/* Language switcher */
.lang-switcher {
    position: relative;
    margin-left: 4px;
}
.lang-current {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1;
    transition: background 0.2s;
}
.lang-current:hover { background: rgba(255,255,255,0.25); }
.lang-current .lang-flag { width: 20px; height: 14px; border-radius: 2px; flex-shrink: 0; }
.lang-current .lang-code { text-transform: uppercase; }
.lang-current .lang-arrow { font-size: 0.65rem; margin-left: 2px; opacity: 0.7; }
.lang-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    overflow: hidden;
    z-index: 200;
    min-width: 120px;
}
.lang-switcher.open .lang-dropdown { display: block; }
.lang-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #333;
    transition: background 0.15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}
.lang-option:hover { background: #f0f4ff; }
.lang-option.active { background: #E3F2FD; font-weight: 600; }
.lang-option .lang-flag { width: 22px; height: 15px; border-radius: 2px; flex-shrink: 0; }

/* Menu utente */
.user-menu { position: relative; }
.user-menu-trigger {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 999px;
    padding: 4px 10px 4px 4px;
    cursor: pointer; color: white;
    font-size: 0.85rem; font-weight: 500; line-height: 1;
    transition: background 0.2s;
}
.user-menu-trigger:hover { background: rgba(255,255,255,0.25); }
.user-menu-trigger .lang-arrow { font-size: 0.65rem; opacity: 0.7; }
.user-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: white; color: #1976D2;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.9rem; flex-shrink: 0;
    text-transform: uppercase;
}
.user-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.user-menu-dropdown {
    display: none;
    position: absolute; top: calc(100% + 8px); right: 0;
    background: white; color: #333;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.18);
    overflow: hidden;
    z-index: 200; min-width: 260px;
}
.user-menu.open .user-menu-dropdown { display: block; }
.user-menu-head {
    display: flex; align-items: center; gap: 12px;
    padding: 16px; border-bottom: 1px solid #eee; background: #fafafa;
}
.user-avatar-lg { width: 40px; height: 40px; font-size: 1.1rem; background: #1976D2; color: white; }
.user-menu-head-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.user-menu-email { font-weight: 600; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-head-info .badge { align-self: flex-start; }
.user-menu-item {
    display: block; width: 100%; text-align: left;
    padding: 12px 16px; border: none; background: none; cursor: pointer;
    font-size: 0.95rem; color: #333; transition: background 0.15s;
}
.user-menu-item:hover { background: #f0f4ff; }
.user-menu-item-danger { color: #c62828; }
.user-menu-item-danger:hover { background: #fdecea; }
.user-menu-sep { height: 1px; background: #eee; margin: 4px 0; }

/* Pagina Account */
.card-danger { border: 1px solid #f3c2c2; }
.card-danger h3 { color: #c62828; }
.account-form { display: flex; flex-direction: column; gap: 12px; max-width: 420px; }
.account-form input {
    padding: 12px; border: 2px solid #ddd; border-radius: 8px; font-size: 1rem;
}
.account-form input:focus { border-color: #1976D2; outline: none; }
.account-form button { align-self: flex-start; }
.account-form small { margin-top: -4px; }

/* Menu utente su mobile: bottom-sheet */
@media (max-width: 600px) {
    .user-menu { position: static; }
    .user-menu-trigger { padding: 4px; }
    .user-menu.open .user-menu-dropdown {
        position: fixed; left: 0; right: 0; bottom: 0; top: auto;
        width: 100%; min-width: 0;
        border-radius: 16px 16px 0 0;
        max-height: 80vh; overflow-y: auto;
        animation: sheet-up 0.2s ease;
        z-index: 1001;
    }
    .user-menu.open::before {
        content: ''; position: fixed; inset: 0;
        background: rgba(0,0,0,0.4); z-index: 1000;
    }
    .user-menu-head { padding: 18px 16px; }
    .user-menu-item { padding: 16px; font-size: 1rem; }
}
@keyframes sheet-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* i18n anti-FOUC */
body.i18n-loading { opacity: 0; }
body { transition: opacity 0.1s; }

/* Responsive */
@media (max-width: 768px) {
    [data-tooltip]::after,
    [data-tooltip]::before { display: none; }

    .hero { padding: 50px 20px; }
    .hero h2 { font-size: 1.6rem; }
    .hero p { font-size: 1rem; }

    .final-cta h2 { font-size: 1.5rem; }
    .final-cta p { font-size: 1rem; }

    .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .stat-card { padding: 12px; }
    .stat-value { font-size: 1.5rem; }

    .results-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .result-img { height: 120px; }
}

@media (max-width: 600px) {
    .form-row { flex-direction: column; }
    header .container { flex-direction: column; gap: 8px; }

    .plan-bar, .telegram-bar { flex-direction: column; align-items: flex-start; }

    .alert-item { flex-direction: column; align-items: flex-start; }
    .alert-actions { width: 100%; }
    .alert-actions .btn { flex: 1; text-align: center; }

    .hide-mobile { display: none; }

    .proof-grid { gap: 20px; }
    .proof-value { font-size: 1.2rem; }

    .steps-grid { grid-template-columns: 1fr; gap: 20px; }

    .plan-grid { grid-template-columns: 1fr; }
}
