:root {
    --bg: #080f1e; /* Blu notte molto scuro e solido */
    --bg2: #111827;
    --panel: rgba(17, 24, 39, 0.95); /* Meno trasparenza, piu solidita */
    --text: #f8fafc;
    --muted: #94a3b8;
    --line: rgba(51, 65, 85, 0.6);
    --accent: #2563eb; /* Blu Istituzionale (Trust Blue) */
    --accent2: #1d4ed8;
    --ok: #10b981; /* Verde smeraldo per il successo */
    --bad: #ef4444;
    --panel-soft: rgba(15, 23, 42, 0.92);
    --emerald: var(--ok);
    --emerald-strong: #059669;
    --alert: var(--bad);
    --shadow: 0 20px 56px rgba(2, 10, 26, 0.45);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    margin: 0;
    font-family: 'Manrope', sans-serif;
    color: var(--text);
    min-height: 100vh;
    background:
        radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.1), transparent 50%),
        var(--bg);
}

.app-background {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 80% 8%, rgba(37, 99, 235, 0.12), transparent 44%),
        radial-gradient(circle at 20% 85%, rgba(37, 99, 235, 0.06), transparent 42%);
    z-index: -1;
}

.topbar {
    width: min(1180px, calc(100% - 2rem));
    margin: 1.1rem auto 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    color: var(--text);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-family: 'Space Grotesk', sans-serif;
}

.brand-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    letter-spacing: 0.015em;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.topbar-actions button,
.hero-actions button,
.side-actions button,
.inbox-head button,
.auth-form button {
    margin-top: 0;
}

.viewport {
    width: min(1180px, calc(100% - 2rem));
    margin: 0.95rem auto 1.8rem;
}

.app-page {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.32s ease, transform 0.32s ease, max-height 0.32s ease;
}

.app-page.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    max-height: 24000px;
    overflow: visible;
}

.landing-page {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 0.95rem;
}

.full-span {
    grid-column: 1 / -1;
}

.hero-card,
.steps-card,
.auth-card,
.dash-sidebar,
.dash-main {
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.hero-card,
.steps-card,
.auth-card {
    padding: 1.15rem;
}

.hero-card {
    grid-column: span 2;
    background:
        linear-gradient(130deg, rgba(15, 23, 42, 0.98), rgba(17, 24, 39, 0.96)),
        radial-gradient(circle at 12% 30%, rgba(37, 99, 235, 0.14), transparent 40%);
}

.badge {
    display: inline-flex;
    border: 1px solid rgba(37, 99, 235, 0.45);
    color: #bfdbfe;
    padding: 0.32rem 0.62rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-size: 0.72rem;
    margin: 0 0 0.8rem;
}

h1,
h2,
h3 {
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1.1;
    margin: 0 0 0.65rem;
}

h1 {
    font-size: clamp(2rem, 4.1vw, 3.35rem);
    max-width: 850px;
}

h2 {
    font-size: clamp(1.25rem, 2.3vw, 1.75rem);
}

h3 {
    font-size: 1.06rem;
}

.lead {
    color: #cbd5e1;
    max-width: 810px;
    margin: 0 0 0.95rem;
}

.hero-actions {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 0.95rem;
    flex-wrap: wrap;
}

.trust-badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin: 1.5rem 0;
}

.trust-badge {
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.3);
    color: #93c5fd;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}

.status-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
}

.status-chip {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.58rem 0.65rem;
    background: rgba(15, 23, 42, 0.96);
}

.status-chip span {
    display: block;
    font-size: 0.73rem;
    color: var(--muted);
}

.status-chip strong {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
}

.steps-card {
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.98), rgba(17, 24, 39, 0.96));
}

.steps {
    margin: 0;
    padding-left: 1rem;
}

.steps li {
    margin-bottom: 0.7rem;
}

.steps p {
    margin: 0.2rem 0;
    color: var(--muted);
}

.step-title {
    font-family: 'Space Grotesk', sans-serif;
    color: #e6f1ff;
}

.auth-card {
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.98), rgba(17, 24, 39, 0.96));
}

.landing-cta-card p {
    color: var(--muted);
    margin: 0 0 0.65rem;
}

.trust-band,
.feature-grid,
.usecase-section,
.pricing-section,
.faq-section,
.final-cta,
.landing-footer {
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.trust-band {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.55rem;
    padding: 0.85rem;
}

.trust-band article {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.96);
    padding: 0.62rem 0.65rem;
}

.metric {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.03rem;
    color: #bfdbfe;
}

.trust-band p {
    margin: 0.2rem 0 0;
    color: var(--muted);
    font-size: 0.84rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
    padding: 0.86rem;
}

.feature-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.96);
    padding: 0.75rem;
}

.feature-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.usecase-section,
.pricing-section,
.faq-section,
.final-cta {
    padding: 1rem;
}

.usecase-grid {
    margin-top: 0.5rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.56rem;
}

.usecase-grid article {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.96);
    padding: 0.7rem;
}

.usecase-grid p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.pricing-grid {
    margin-top: 0.6rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
}

.price-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.96);
    padding: 0.74rem;
}

.price-card.highlighted {
    border-color: rgba(37, 99, 235, 0.65);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.price {
    margin: 0.1rem 0 0.55rem;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.28rem;
}

.price span {
    color: var(--muted);
    font-size: 0.9rem;
}

.price-card ul {
    margin: 0;
    padding-left: 1rem;
    color: var(--muted);
    font-size: 0.88rem;
}

.price-card li {
    margin-bottom: 0.35rem;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.58rem;
}

.faq-grid details {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.96);
    padding: 0.66rem 0.72rem;
}

.faq-grid summary {
    cursor: pointer;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.89rem;
}

.faq-grid p {
    margin: 0.45rem 0 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.final-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    background:
        linear-gradient(130deg, rgba(15, 23, 42, 0.96), rgba(17, 24, 39, 0.96)),
        radial-gradient(circle at 14% 20%, rgba(37, 99, 235, 0.14), transparent 44%);
}

.final-cta p {
    margin: 0;
    color: var(--muted);
    max-width: 620px;
}

.landing-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    padding: 0.75rem 0.95rem;
}

.landing-footer p {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.landing-footer nav {
    display: flex;
    gap: 0.65rem;
}

.landing-footer a {
    color: #c9def8;
    text-decoration: none;
    font-size: 0.85rem;
}

.landing-footer a:hover {
    text-decoration: underline;
}

.auth-form {
    display: grid;
    gap: 0.55rem;
    padding: 0.6rem 0;
}

label {
    font-size: 0.88rem;
    color: #d7e4fb;
}

input[type='text'],
input[type='email'],
input[type='password'] {
    background: #0f172a;
    color: var(--text);
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    font-family: 'Manrope', sans-serif;
    outline: none;
    transition: all 0.2s ease-in-out;
}

input[type='text']:focus,
input[type='email']:focus,
input[type='password']:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
    background: #1e293b;
}

.check {
    margin-top: 0.25rem;
    display: flex;
    gap: 0.45rem;
    color: var(--muted);
    font-size: 0.87rem;
}

.check input {
    margin-top: 0.2rem;
}

button {
    margin-top: 0.5rem;
    border: none;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    border-radius: 8px;
    background: var(--accent);
    color: #ffffff;
    font-size: 1rem;
    letter-spacing: 0.02em;
    padding: 0.9rem 1.2rem;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover:not([disabled]) {
    background: var(--accent2);
}

button[disabled] {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.btn-emerald {
    background: var(--accent);
    color: #ffffff;
}

.btn-light {
    background: rgba(37, 99, 235, 0.18);
    color: #eff6ff;
    border: 1px solid rgba(37, 99, 235, 0.35);
}

.btn-outline {
    background: transparent;
    color: #e8f2ff;
    border: 1px solid rgba(37, 99, 235, 0.45);
}

.btn-outline:hover:not([disabled]) {
    background: rgba(37, 99, 235, 0.18);
}

.btn-outline.alert {
    border-color: rgba(234, 91, 104, 0.5);
    color: #ffd3d8;
}

.btn-outline.alert:hover:not([disabled]) {
    background: rgba(234, 91, 104, 0.14);
}

.btn-light:hover:not([disabled]) {
    background: rgba(37, 99, 235, 0.28);
}

.form-message {
    min-height: 1.1rem;
    font-size: 0.9rem;
    color: var(--muted);
    margin: 0.15rem 0 0;
}

.form-message.ok {
    color: #7df3c8;
}

.form-message.error {
    color: #ff95a0;
}

.link-row {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.95rem;
    flex-wrap: wrap;
}

.link-row a {
    color: #c8ddfa;
    text-decoration: none;
    font-size: 0.88rem;
}

.link-row a:hover {
    text-decoration: underline;
}

.dash-sidebar {
    padding: 1rem;
    background: rgba(17, 24, 39, 0.96);
}

.dash-main {
    padding: 1rem;
    background: rgba(17, 24, 39, 0.96);
}

.dashboard-page {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 0.95rem;
}

.login-page {
    padding: 0.2rem 0;
}

.login-layout {
    display: grid;
    grid-template-columns: 0.95fr 1.05fr;
    gap: 0.9rem;
}

.login-side {
    border: 1px solid var(--line);
    border-radius: 20px;
    background:
        linear-gradient(150deg, rgba(15, 23, 42, 0.98), rgba(17, 24, 39, 0.96)),
        radial-gradient(circle at 14% 18%, rgba(37, 99, 235, 0.14), transparent 46%);
    box-shadow: var(--shadow);
    padding: 1.05rem;
}

.login-side p {
    color: var(--muted);
}

.login-forms {
    display: grid;
    gap: 0.9rem;
}

.muted-line {
    margin: 0.2rem 0;
    color: var(--muted);
    font-size: 0.86rem;
    word-break: break-word;
}

.number-card {
    margin-top: 0.7rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0.65rem;
    background: var(--panel-soft);
}

.number-card span {
    display: block;
    color: var(--muted);
    font-size: 0.74rem;
}

.number-card strong {
    margin-top: 0.15rem;
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    color: #dbeafe;
    letter-spacing: 0.015em;
}

.side-actions {
    margin-top: 0.75rem;
    display: grid;
    gap: 0.5rem;
}

.service-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.52rem;
    margin-bottom: 0.85rem;
}

.service-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.56rem 0.62rem;
    background: rgba(15, 23, 42, 0.96);
}

.service-card span {
    display: block;
    color: var(--muted);
    font-size: 0.74rem;
}

.service-card strong {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.93rem;
}

.inbox-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.dotline {
    color: var(--muted);
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
}

.dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--emerald);
    box-shadow: 0 0 0 0 rgba(36, 194, 140, 0.6);
    animation: pulse 1.7s infinite;
}

.message-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.55rem;
}

.message-item {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(5, 18, 39, 0.92);
    padding: 0.72rem 0.78rem;
}

.message-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.6rem;
}

.message-from {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.9rem;
}

.message-time {
    color: var(--muted);
    font-size: 0.76rem;
}

.message-body {
    margin: 0.44rem 0 0;
    color: #dbe8fd;
    font-size: 0.91rem;
    word-break: break-word;
}

.otp-row {
    margin-top: 0.56rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.otp-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.54rem;
    border-radius: 10px;
    background: rgba(37, 99, 235, 0.14);
    border: 1px solid rgba(37, 99, 235, 0.42);
    color: #bfdbfe;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.88rem;
    letter-spacing: 0.06em;
}

.copy-otp-btn {
    border: 1px solid rgba(166, 196, 231, 0.36);
    border-radius: 10px;
    background: transparent;
    color: #e5f0ff;
    padding: 0.3rem 0.52rem;
    font-size: 0.8rem;
}

.empty-state {
    margin-top: 0.72rem;
    border: 1px dashed rgba(146, 182, 222, 0.42);
    border-radius: 14px;
    padding: 0.8rem;
    color: var(--muted);
}

.debug-card {
    margin-top: 0.8rem;
    border-top: 1px solid var(--line);
    padding-top: 0.8rem;
}

.output {
    margin: 0.65rem 0 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(3, 12, 28, 0.88);
    color: #c7d8f7;
    padding: 0.68rem;
    min-height: 90px;
    max-height: 200px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.79rem;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(36, 194, 140, 0.6);
    }
    85% {
        box-shadow: 0 0 0 10px rgba(36, 194, 140, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(36, 194, 140, 0);
    }
}

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

@media (max-width: 980px) {
    .landing-page,
    .dashboard-page {
        grid-template-columns: 1fr;
    }

    .hero-card {
        grid-column: auto;
    }

    .login-layout {
        grid-template-columns: 1fr;
    }

    .status-strip,
    .service-row {
        grid-template-columns: 1fr;
    }

    .trust-band,
    .feature-grid,
    .usecase-grid,
    .pricing-grid,
    .faq-grid {
        grid-template-columns: 1fr;
    }

    .final-cta,
    .landing-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}
