/* Ufficio Mobile — apierro.it
 * Brand: bianco, blu cobalto / ceruleo, accento rame dal logo AP
 */

@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Syne:wght@600;700;800&display=swap");

:root {
    --ap-white: #ffffff;
    --ap-mist: #f3f7fc;
    --ap-ink: #071428;
    --ap-ink-soft: #334155;
    --ap-cobalt: #0a3d91;
    --ap-cobalt-deep: #062a66;
    --ap-cerulean: #1e86d6;
    --ap-cerulean-soft: #4aa3e6;
    --ap-copper: #c4a574;
    --ap-copper-soft: #e0c9a4;
    --ap-danger: #c62828;
    --ap-ok: #1b7a45;
    --ap-radius: 0.35rem;
    --ap-font: "Manrope", "Segoe UI", sans-serif;
    --ap-display: "Syne", "Manrope", sans-serif;
    --ap-shadow: 0 18px 50px rgb(6 42 102 / 0.18);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--ap-font);
    line-height: 1.55;
    color: var(--ap-ink);
    background: var(--ap-white);
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--ap-cerulean);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--ap-cobalt);
}

h1, h2, h3, .font-display {
    font-family: var(--ap-display);
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.hidden { display: none !important; }
[x-cloak] { display: none !important; }

/* —— Layout utilities (compat con markup esistente) —— */
.min-h-screen { min-height: 100vh; }
.mx-auto { margin-left: auto; margin-right: auto; }
.max-w-md { max-width: 28rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.w-full { width: 100%; }
.block { display: block; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.grid { display: grid; }
.sm\:grid-cols-2 { grid-template-columns: 1fr; }
@media (min-width: 640px) {
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm\:col-span-2 { grid-column: span 2 / span 2; }
}
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-10 { margin-top: 2.5rem; }
.mr-4 { margin-right: 1rem; }
.pl-5 { padding-left: 1.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.text-xs { font-size: 0.75rem; line-height: 1.1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.35rem; }
.text-lg { font-size: 1.125rem; line-height: 1.7rem; }
.text-2xl { font-size: 1.5rem; line-height: 1.9rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.2rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.06em; }
.tracking-widest { letter-spacing: 0.2em; }
.text-left { text-align: left; }
.text-center { text-align: center; }
.underline { text-decoration: underline; }
.break-all { word-break: break-all; }
.overflow-x-auto { overflow-x: auto; }
.list-decimal { list-style-type: decimal; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.min-h-\[200px\] { min-height: 200px; }

.text-slate-400 { color: #94a3b8; }
.text-slate-500 { color: #64748b; }
.text-slate-600 { color: var(--ap-ink-soft); }
.text-slate-700 { color: #334155; }
.text-slate-900 { color: var(--ap-ink); }
.text-blue-600 { color: var(--ap-cerulean); }
.text-white { color: var(--ap-white); }
.text-red-600 { color: var(--ap-danger); }
.text-green-700 { color: var(--ap-ok); }
.text-amber-900 { color: #7a4e12; }
.bg-slate-50 { background-color: var(--ap-mist); }
.bg-slate-100 { background-color: #e8eef7; }
.bg-slate-200 { background-color: #d7e2f0; }
.bg-slate-900 { background-color: var(--ap-cobalt-deep); }
.bg-white { background-color: var(--ap-white); }
.bg-amber-50 { background-color: #fff8eb; }
.border { border-width: 1px; border-style: solid; }
.border-slate-100 { border-color: #edf2f8; }
.border-slate-200 { border-color: #d9e3f0; }
.border-slate-300 { border-color: #c5d3e6; }
.border-amber-200 { border-color: #f0d7a8; }
.rounded { border-radius: var(--ap-radius); }
.rounded-lg { border-radius: 0.65rem; }
.shadow-sm { box-shadow: 0 1px 2px rgb(7 20 40 / 0.06); }

input, button, select, textarea {
    font: inherit;
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.875em;
    background: #e8eef7;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}

table { border-collapse: collapse; }

/* —— Brand components —— */
.ap-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 0;
    border-radius: 999px;
    padding: 0.85rem 1.4rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
    text-decoration: none;
}

.ap-btn:hover {
    transform: translateY(-1px);
}

.ap-btn-primary {
    background: linear-gradient(135deg, var(--ap-cerulean), var(--ap-cobalt));
    color: var(--ap-white);
    box-shadow: 0 10px 28px rgb(30 134 214 / 0.35);
}

.ap-btn-primary:hover {
    color: var(--ap-white);
    box-shadow: 0 14px 34px rgb(10 61 145 / 0.4);
}

.ap-btn-ghost {
    background: transparent;
    color: var(--ap-white);
    border: 1px solid rgb(255 255 255 / 0.35);
}

.ap-btn-ghost:hover {
    background: rgb(255 255 255 / 0.08);
    color: var(--ap-white);
}

.ap-btn-solid {
    background: var(--ap-cobalt);
    color: var(--ap-white);
}

.ap-btn-solid:hover {
    background: var(--ap-cerulean);
    color: var(--ap-white);
}

.ap-input {
    width: 100%;
    border: 1px solid #c5d3e6;
    border-radius: var(--ap-radius);
    padding: 0.7rem 0.85rem;
    background: var(--ap-white);
    color: var(--ap-ink);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ap-input:focus {
    outline: none;
    border-color: var(--ap-cerulean);
    box-shadow: 0 0 0 3px rgb(30 134 214 / 0.2);
}

.ap-logo {
    width: min(48vw, 340px);
    height: auto;
    display: block;
}

.ap-hero-mark svg.ap-logo {
    width: min(48vw, 340px);
    max-width: 100%;
    height: auto;
    overflow: visible;
}

.ap-logo-sm {
    width: 52px;
    height: auto;
}

.ap-logo-on-dark {
    filter: drop-shadow(0 0 28px rgb(74 163 230 / 0.35));
}

.ap-hero-mark {
    position: relative;
    display: grid;
    place-items: center;
}

.ap-hero-mark::before {
    content: "";
    position: absolute;
    width: 78%;
    height: 78%;
    border-radius: 50%;
    background: radial-gradient(circle, rgb(255 255 255 / 0.16), rgb(30 134 214 / 0.08) 45%, transparent 70%);
    pointer-events: none;
}

.ap-hero-mark img,
.ap-hero-mark object,
.ap-hero-mark svg {
    position: relative;
    z-index: 1;
}

.ap-logo-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgb(255 255 255 / 0.1);
    border: 1px solid rgb(255 255 255 / 0.14);
    border-radius: 0.85rem;
    padding: 0.28rem;
    backdrop-filter: blur(6px);
}

.ap-logo-chip img,
.ap-logo-chip object {
    width: 44px;
    height: 44px;
}

.ap-auth-panel .ap-logo-chip,
.ap-topbar .ap-logo-chip {
    background: #061528;
    border-color: rgb(196 165 116 / 0.35);
}

/* —— Homepage —— */
.ap-page-home {
    background: var(--ap-white);
}

.ap-nav {
    position: absolute;
    inset: 0 0 auto;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
}

.ap-nav a {
    color: rgb(255 255 255 / 0.88);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.ap-nav a:hover {
    color: var(--ap-copper-soft);
}

.ap-nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--ap-display);
    font-weight: 700;
    letter-spacing: 0.02em;
}

.ap-hero {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: var(--ap-white);
    background:
        radial-gradient(ellipse 80% 60% at 70% 20%, rgb(30 134 214 / 0.45), transparent 55%),
        radial-gradient(ellipse 50% 40% at 15% 80%, rgb(196 165 116 / 0.18), transparent 50%),
        linear-gradient(160deg, #020b1a 0%, var(--ap-cobalt-deep) 42%, var(--ap-cobalt) 78%, #0c5bb5 100%);
}

.ap-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgb(255 255 255 / 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgb(255 255 255 / 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
    pointer-events: none;
    animation: ap-grid-drift 28s linear infinite;
}

.ap-hero::after {
    content: "";
    position: absolute;
    width: 55vmax;
    height: 55vmax;
    right: -12%;
    top: -8%;
    border-radius: 50%;
    background: radial-gradient(circle, rgb(74 163 230 / 0.28), transparent 65%);
    animation: ap-glow-pulse 8s ease-in-out infinite;
    pointer-events: none;
}

.ap-hero-inner {
    position: relative;
    z-index: 1;
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 6.5rem 1.5rem 3.5rem;
    display: grid;
    gap: 2.5rem;
    align-items: center;
    justify-items: center;
    text-align: center;
}

@media (min-width: 900px) {
    .ap-hero-inner {
        grid-template-columns: 1.05fr 0.95fr;
        justify-items: stretch;
        text-align: left;
        padding: 6.5rem 1.5rem;
    }
}

.ap-hero-copy {
    max-width: 34rem;
    animation: ap-rise 0.9s ease both;
}

.ap-hero-mark {
    justify-self: center;
    animation: none; /* non mascherare l'animazione SVG interna */
}

@media (min-width: 900px) {
    .ap-hero-mark {
        justify-self: center;
    }

    .ap-hero-copy {
        justify-self: end;
        text-align: left;
    }
}

.ap-hero-lead {
    margin: 1rem auto 0;
    font-size: 1.05rem;
    color: rgb(255 255 255 / 0.78);
    max-width: 28rem;
}

@media (min-width: 900px) {
    .ap-hero-lead {
        margin-left: 0;
        margin-right: 0;
    }
}

.ap-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.75rem;
    justify-content: center;
}

@media (min-width: 900px) {
    .ap-hero-actions {
        justify-content: flex-start;
    }
}

.ap-kicker {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ap-copper-soft);
}

.ap-hero h1 {
    margin: 0.85rem 0 0;
    font-size: clamp(2.6rem, 7vw, 4.6rem);
    font-weight: 800;
    color: var(--ap-white);
}

.ap-section {
    padding: 4.5rem 1.5rem;
}

.ap-section-inner {
    width: min(960px, 100%);
    margin: 0 auto;
}

.ap-section h2 {
    margin: 0;
    font-size: clamp(1.7rem, 3vw, 2.2rem);
    color: var(--ap-cobalt-deep);
}

.ap-section p.lead {
    margin: 0.85rem 0 0;
    color: var(--ap-ink-soft);
    max-width: 36rem;
}

.ap-band {
    background:
        linear-gradient(180deg, var(--ap-mist), var(--ap-white));
    border-top: 1px solid #e2ebf6;
}

.ap-footer {
    padding: 2rem 1.5rem 2.5rem;
    border-top: 1px solid #e2ebf6;
    color: var(--ap-ink-soft);
    font-size: 0.9rem;
}

.ap-footer-inner {
    width: min(960px, 100%);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
}

.ap-footer a {
    color: var(--ap-cobalt);
    text-decoration: none;
    font-weight: 600;
}

.ap-footer a:hover {
    color: var(--ap-cerulean);
}

.ap-footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.ap-nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem 1.25rem;
    align-items: center;
    justify-content: flex-end;
}

.ap-feature-list {
    margin: 1.75rem 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 1rem;
}

.ap-feature-list li {
    padding: 1rem 0 0;
    border-top: 1px solid #d9e3f0;
    color: var(--ap-ink-soft);
}

.ap-feature-list strong {
    display: block;
    color: var(--ap-cobalt-deep);
    font-family: var(--ap-display);
    margin-bottom: 0.25rem;
}

.ap-muted {
    color: var(--ap-ink-soft);
    font-size: 0.95rem;
}

.ap-list {
    margin-top: 1.75rem;
    display: grid;
    gap: 0.85rem;
}

.ap-list-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    border-top: 1px solid #e2ebf6;
}

.ap-list-item h3 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--ap-cobalt-deep);
}

.ap-project-grid {
    margin-top: 1.75rem;
    display: grid;
    gap: 1.25rem;
}

@media (min-width: 720px) {
    .ap-project-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.ap-project {
    padding: 1.25rem 0;
    border-top: 1px solid #d9e3f0;
}

.ap-project h3 {
    margin: 0;
    font-size: 1.15rem;
}

.ap-project h3 a {
    color: var(--ap-cobalt-deep);
    text-decoration: none;
}

.ap-project h3 a:hover {
    color: var(--ap-cerulean);
}

.ap-project p {
    margin: 0.5rem 0 0;
    color: var(--ap-ink-soft);
    font-size: 0.95rem;
}

.ap-project-meta {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ap-chip {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ap-cobalt);
    background: rgb(30 134 214 / 0.12);
    padding: 0.2rem 0.55rem;
    border-radius: var(--ap-radius);
}

/* —— Scrivania backend —— */
.ap-desk {
    background:
        radial-gradient(ellipse 50% 30% at 0% 0%, rgb(30 134 214 / 0.08), transparent 55%),
        linear-gradient(180deg, var(--ap-mist), var(--ap-white));
    color: var(--ap-ink);
}

.ap-desk-nav {
    background: var(--ap-white);
    border-bottom: 1px solid #d9e3f0;
    padding: 0.65rem 0;
    position: sticky;
    top: 0;
    z-index: 20;
}

.ap-desk-tab {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--ap-ink-soft);
    font: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.55rem 0.9rem;
    border-radius: var(--ap-radius);
    cursor: pointer;
}

.ap-desk-tab:hover {
    color: var(--ap-cobalt);
    background: rgb(10 61 145 / 0.06);
}

.ap-desk-tab.is-active {
    color: var(--ap-white);
    background: var(--ap-cobalt);
}

.ap-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

@media (min-width: 720px) {
    .ap-stat-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.ap-stat {
    background: var(--ap-white);
    border: 1px solid #d9e3f0;
    border-radius: 0.75rem;
    padding: 1.1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ap-stat-value {
    font-family: var(--ap-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--ap-cobalt-deep);
    line-height: 1;
}

.ap-stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ap-ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.ap-panel {
    background: var(--ap-white);
    border: 1px solid #d9e3f0;
    border-radius: 0.75rem;
    padding: 1.35rem 1.25rem;
}

.ap-btn-ghost-dark {
    background: transparent;
    color: var(--ap-cobalt);
    border: 1px solid #b7c9e0;
}

.ap-btn-ghost-dark:hover {
    background: rgb(10 61 145 / 0.06);
}

.max-w-5xl { max-width: 64rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mr-4 { margin-right: 1rem; }
.text-slate-500 { color: #64748b; }
.text-slate-600 { color: #475569; }
.text-green-700 { color: #15803d; }
.text-red-600 { color: #dc2626; }
.text-blue-600 { color: #2563eb; }
.bg-slate-50 { background: var(--ap-mist); }
.bg-slate-100 { background: #eef3f9; }
.bg-white { background: #fff; }
.border-slate-100 { border-color: #f1f5f9; }
.border-slate-200 { border-color: #e2e8f0; }
.border-slate-300 { border-color: #cbd5e1; }
.rounded { border-radius: var(--ap-radius); }
.rounded-lg { border-radius: 0.5rem; }
.border { border-width: 1px; border-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.overflow-x-auto { overflow-x: auto; }
.underline { text-decoration: underline; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-2xl { font-size: 1.5rem; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.05em; }
.text-center { text-align: center; }

/* —— Auth / access shells —— */
.ap-auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
    background:
        radial-gradient(ellipse 60% 40% at 10% 0%, rgb(30 134 214 / 0.18), transparent 55%),
        radial-gradient(ellipse 50% 35% at 100% 100%, rgb(10 61 145 / 0.12), transparent 50%),
        linear-gradient(180deg, var(--ap-mist), var(--ap-white));
}

.ap-auth-panel {
    width: min(420px, 100%);
    background: var(--ap-white);
    border: 1px solid #d9e3f0;
    border-radius: 1rem;
    padding: 1.75rem 1.5rem 1.5rem;
    box-shadow: var(--ap-shadow);
    animation: ap-rise 0.7s ease both;
}

.ap-auth-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.ap-auth-brand strong {
    font-family: var(--ap-display);
    font-size: 1.15rem;
    color: var(--ap-cobalt-deep);
}

.ap-auth-brand span {
    display: block;
    font-size: 0.8rem;
    color: var(--ap-ink-soft);
    font-weight: 500;
}

/* —— Scrivania header brand —— */
.ap-topbar {
    background: linear-gradient(90deg, var(--ap-cobalt-deep), var(--ap-cobalt));
    color: var(--ap-white);
    border-bottom: 3px solid var(--ap-copper);
}

.ap-topbar a {
    color: rgb(255 255 255 / 0.9);
}

.ap-topbar .text-slate-900,
.ap-topbar .text-slate-600 {
    color: rgb(255 255 255 / 0.92) !important;
}

.ap-topbar button.bg-slate-900 {
    background: var(--ap-cerulean) !important;
}

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

@keyframes ap-glow-pulse {
    0%, 100% { opacity: 0.55; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.05); }
}

@keyframes ap-grid-drift {
    from { background-position: 0 0, 0 0; }
    to { background-position: 48px 48px, 48px 48px; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
