/* assets/style.css — Design Sistema Share — stili globali e componenti condivisi */

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --bg-main: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --white: #ffffff;
    --border: #e2e8f0;
    --radius: 12px;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Home Layout ───────────────────────────────────────────────────── */
.hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo-container {
    margin-bottom: 24px;
}

.logo-container img {
    max-width: 180px;
    border-radius: var(--radius);
}

.tagline {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 32px;
    max-width: 400px;
}

/* ── Card Auth ─────────────────────────────────────────────────────── */
.auth-card {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 450px;
    margin: 40px auto;
}

h2 {
    margin-bottom: 24px;
    font-weight: 700;
    color: var(--primary-dark);
}

/* ── Form elementi di base ─────────────────────────────────────────── */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 6px;
}

label .opt {
    font-weight: 400;
    color: var(--text-muted);
    font-size: .8rem;
}

input,
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
    color: var(--text-main);
    transition: border-color .2s, box-shadow .2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .1);
}

textarea {
    resize: vertical;
    min-height: 90px;
}

/* ── Bottoni principali ────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 14px 28px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all .2s;
    border: none;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, .2);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

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

.btn-outline:hover {
    background-color: var(--primary);
    color: var(--white);
}

.btn-full {
    width: 100%;
    text-align: center;
}

/* ── Bottoni piccoli ───────────────────────────────────────────────── */
.btn-sm {
    padding: 8px 18px;
    border-radius: 8px;
    font-size: .88rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all .2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-sm.primary {
    background: var(--primary);
    color: #fff;
}

.btn-sm.primary:hover {
    background: var(--primary-dark);
}

.btn-sm.ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1.5px solid var(--border);
}

.btn-sm.ghost:hover {
    border-color: var(--text-muted);
}

/* ── Badge ─────────────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 999px;
    font-size: .73rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.badge-green {
    background: #dcfce7;
    color: #166534;
}

.badge-yellow {
    background: #fef9c3;
    color: #854d0e;
}

.badge-gray {
    background: #f1f5f9;
    color: #475569;
}

.badge-blue {
    background: #dbeafe;
    color: #1e40af;
}

.badge-red {
    background: #fee2e2;
    color: #991b1b;
}

.badge-orange {
    background: #ffedd5;
    color: #9a3412;
}

.badge-purple {
    background: #ede9fe;
    color: #5b21b6;
}

/* ── Navigazione condivisa ─────────────────────────────────────────── */
.main-nav {
    background: var(--white);
    padding: 15px 40px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.4rem;
    text-decoration: none;
}

.nav-user {
    font-size: .9rem;
    color: var(--text-muted);
}

.nav-user a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color .2s;
}

.nav-user a:hover {
    color: var(--primary);
}

/* ── Flash / Alert condivisi ───────────────────────────────────────── */
.flash {
    padding: 14px 20px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.flash.success {
    background: #dcfce7;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.flash.error {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.flash.info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.flash.warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ── Modal condiviso ───────────────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .48);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: #fff;
    border-radius: var(--radius);
    padding: 32px;
    width: 100%;
    max-width: 530px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .2);
    animation: slideUp .25s ease;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-box h3 {
    margin-bottom: 20px;
    color: var(--primary-dark);
    font-size: 1.1rem;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Form group compatto per modal */
.fg {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.fg label {
    font-size: .875rem;
    font-weight: 600;
}

.fg-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
}

.fg-grid>div {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fg-grid label {
    font-size: .875rem;
    font-weight: 600;
}

/* ── Dashboard utente ──────────────────────────────────────────────── */
.dashboard-container {
    padding: 40px;
    max-width: 1000px;
    margin: 0 auto;
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .auth-card {
        margin: 20px;
        padding: 25px;
    }

    .btn-outline {
        margin-left: 0;
        margin-top: 10px;
    }

    .main-nav {
        padding: 12px 18px;
    }

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