@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}
/* Theme variables (ensure readable text on dark backgrounds) */
:root {
    --background: #252432;
    --surface: #2d2d39;
    --text: #ffffff;
    --muted: rgba(255,255,255,0.72);
    --accent: #003a72;
    --accent-2: #ffffff;
    --accent-muted: #505050;
    --accent-soft: rgba(0,58,114,0.08);
}
html,
body {
  height: 100%;
}

body {
  display: flex;
  justify-content: center;
  align-items: stretch;
  min-height: 100vh;
  height: 100vh;
  background: #252432;
  overflow: hidden;
}

body[data-page="login"] {
  align-items: center;
  overflow: visible;
}

body { color: var(--text); }

.landing {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100vh;
  pointer-events: none;
}

spline-viewer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  min-width: 100vw;
  min-height: 100vh;
  z-index: 0;
}

.landing {
  position: relative;
  z-index: 1;
}

.landing-footer,
.landing-footer * {
  pointer-events: auto;
}

a,
a:link,
a:visited,
a:hover,
a:focus,
a:active {
  text-decoration: none;
}

.spline-overlay {
  position: absolute;
  left: 12%;
  bottom: 20%;
  max-width: 46ch;
  z-index: 10;
  color: #fff;
  font-family: "Poppins", "Segoe UI", sans-serif;
  font-size: clamp(2.6rem, 5.4vw, 4.3rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
  text-shadow: 0 0 30px rgba(255,255,255,0.35), 0 0 54px rgba(0, 58, 114, 0.35), 0 18px 52px rgba(0,0,0,0.22);
  font-weight: 600;
  pointer-events: none;
  user-select: none;
}
@property --a {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
.box {
  position: relative;
  width: 400px;
  height: 200px;
  background: repeating-conic-gradient(
    from var(--a),
    var(--accent) 0%,
    var(--accent) 5%,
    transparent 5%,
    transparent 40%,
    var(--accent) 50%
  );
  filter: drop-shadow(0 15px 50px #000);
  animation: rotating 4s linear infinite;
  border-radius: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: 0.5s;
}
.box:hover {
  width: 450px;
  height: 500px;
}
@keyframes rotating {
  0% {
    --a: 0deg;
  }
  100% {
    --a: 360deg;
  }
}
.box::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  background: repeating-conic-gradient(
    from var(--a),
    var(--accent-2) 0%,
    var(--accent-2) 5%,
    transparent 5%,
    transparent 40%,
    var(--accent-2) 50%
  );
  filter: drop-shadow(0 15px 50px #000);
  border-radius: 20px;
  animation: rotating 4s linear infinite;
  animation-delay: -1s;
}
.box::after {
  content: "";
  position: absolute;
  inset: 4px;
  background: #2d2d39;
  border-radius: 15px;
  border: 8px solid #25252b;
}
.login {
  position: absolute;
  inset: 60px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1000;
  box-shadow: inset 0 10px 20px rgba(0, 0, 0, 0.5);
  border-bottom: 2px solid var(--accent-muted);
  transition: 0.5s;
  color: #fff;
  overflow: hidden;
  padding: 10px 0;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.box:hover .login {
  inset: 40px;
}

.loginBx {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 10px;
  width: 70%;
  max-width: 320px;
  max-height: 96px;
  min-height: 96px;
  overflow: hidden;
  transition: max-height 0.5s ease;
  will-change: max-height, transform;
}
.box:hover .loginBx {
  max-height: 520px;
}

#login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-height: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  overflow: hidden;
  transition: max-height 0.5s ease, opacity 0.35s ease 0.15s, transform 0.35s ease 0.15s, visibility 0.35s ease 0.15s;
  will-change: max-height, opacity, transform;
}

.box:hover #login-form {
  max-height: 500px;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.loginBx h2 {
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  text-align: center;
  margin: 0;
  padding: 18px 0 4px;
  line-height: 1.2;
}
.loginBx h2 i {
  color: var(--accent);
  text-shadow: 0 0 5px var(--accent), 0 0 30px var(--accent);
  display: flex;
  align-items: center;
  font-size: 1.2em;
}

.loginBx input {
  width: 100%;
  padding: 10px 20px;
  outline: none;
  font-size: 1em;
  color: #fff;
  background: rgba(0, 0, 0, 0.1);
  border: 2px solid #fff;
  border-radius: 30px;
}
.loginBx input::placeholder {
  color: #999;
}
.loginBx input[type="submit"] {
  background: var(--accent);
  border: none;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.loginBx input[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 10px rgba(0, 39, 114, 0.25);
}
.loginBx button.submit-btn {
  width: 100%;
  padding: 12px 20px;
  background: var(--accent);
  border: none;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  font-size: 1em;
  border-radius: 30px;
}
.loginBx button.submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 10px rgba(0, 39, 114, 0.25);
}
.loginBx .alert {
  color: #ff6b6b;
  font-size: 0.9em;
  text-align: center;
  margin-top: 10px;
}
.group {
  display: flex;
  width: 100%;
  justify-content: space-between;
}
.group a {
  color: #fff;
  text-decoration: none;
}
.group a:nth-child(2) {
  color: var(--accent);
  font-weight: 600;
}



.page-shell {
    position: relative;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    z-index: 1;
}

.development-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.development-page .page-shell {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: calc(100vh - 80px);
}

.development-page .logout-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.development-page .logout-bar span {
    display: block;
}

.pretitle {
    color: var(--accent);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.landing h1,
.page-shell h1 {
    font-size: clamp(2.5rem, 5vw, 4.4rem);
    line-height: 1.05;
    margin-bottom: 24px;
}

.subtitle,
.page-shell p {
    color: var(--muted);
    max-width: 720px;
    margin: 0 auto;
    font-size: 1.05rem;
    line-height: 1.8;
}

.landing-footer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    padding: 0 20px;
    color: var(--muted);
    font-size: 0.95rem;
}

.mini-btn,
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--text);
    border: 1px solid rgba(93, 140, 255, 0.4);
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.mini-btn:hover,
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 45px rgba(93, 140, 255, 0.18);
}

.form-card,
.sites-grid {
    width: 100%;
    max-width: 1100px;
    margin: 20px auto 0;
}

.form-card {
    background: rgba(15, 18, 29, 0.92);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 24px;
    padding: 36px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
    text-align: left;
}

.form-card label {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-weight: 600;
}

.form-card input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: var(--text);
    margin-bottom: 18px;
    outline: none;
}

.form-card button {
    width: 100%;
    margin-top: 8px;
}

.alert {
    margin-top: 12px;
    color: #ff8c8c;
    font-size: 0.95rem;
}

.sites-grid {
    display: grid;
    align-items: stretch;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 22px;
    margin-top: 36px;
    justify-content: center;
}

.site-card {
    position: relative;
    background: rgba(18, 22, 36, 0.95);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 22px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 420px;
    transition: transform 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

.site-card:hover {
    transform: translateY(-4px);
    border-color: rgba(93, 140, 255, 0.7);
}

.site-card iframe {
    width: 100%;
    height: 260px;
    min-height: 240px;
    aspect-ratio: 16 / 9;
    border: none;
    background: #090b12;
    overflow: hidden;
    pointer-events: none;
}

.site-link a {
    width: 100%;
    pointer-events: auto;
}

.site-link a {
    display: inline-flex;
    justify-content: center;
}

.site-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1 1 auto;
    min-height: 140px;
}

.site-title {
    font-size: 1.15rem;
    font-weight: 700;
}

.site-description {
    color: var(--muted);
    line-height: 1.6;
    flex: 1;
}

.site-link {
    margin-top: auto;
}

.site-link a {
    width: 100%;
}

/* From Uiverse.io by Shoh2008 */
.loader {
    width: 16px;
    height: 16px;
    box-shadow: 0 30px, 0 -30px;
    border-radius: 4px;
    background: currentColor;
    display: block;
    position: relative;
    transform: translate(-150%, -20px);
    color: #FFF;
    box-sizing: border-box;
    animation: animloader 2s ease infinite;
}

.loader::after,
.loader::before {
    content: '';
    box-sizing: border-box;
    width: 16px;
    height: 16px;
    box-shadow: 0 30px, 0 -30px;
    border-radius: 4px;
    background: currentColor;
    color: #FFF;
    position: absolute;
    left: 30px;
    top: 0;
    animation: animloader 2s 0.2s ease infinite;
}

.loader::before {
    animation-delay: 0.4s;
    left: 60px;
}

@keyframes animloader {
    0% {
        top: 0;
        color: white;
    }

    50% {
        top: 30px;
        color: rgba(255, 255, 255, 0.2);
    }

    100% {
        top: 0;
        color: white;
    }
}

/* Global overlay for the loader */
.global-loader-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000; /* fully opaque background to hide page behind */
    z-index: 9999;
    pointer-events: auto; /* block interaction with page while loading */
    opacity: 1;
    transition: opacity 0.5s ease;
}

#global-loader { /* id wrapper */
    pointer-events: auto;
}

/* Fade-out state for loader */
.global-loader-overlay.fade-out {
    opacity: 0;
}

.logout-bar {
    width: 100%;
    max-width: 1100px;
    margin-top: 24px;
    text-align: center;
    color: var(--muted);
}

.logout-bar button {
    margin-top: 14px;
}

@media (max-width: 720px) {
    .landing-footer {
        flex-direction: column;
        gap: 10px;
    }

    .form-card,
    .sites-grid,
    .logout-bar {
        max-width: 100%;
    }
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.portfolio-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.5s;
}

.portfolio-item:hover img {
    transform: scale(1.05);
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-overlay h3 {
    color: white;
    margin-bottom: 10px;
}

/* Testimonianze */
.testimonials {
    padding: 80px 0;
    background-color: var(--light);
}

.testimonial-slider {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.testimonial {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-align: center;
}

.testimonial img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 20px;
}

.testimonial-text {
    font-style: italic;
    margin-bottom: 20px;
}

.testimonial-author {
    font-weight: bold;
    color: var(--secondary);
}

/* Contatti */
.contact {
    padding: 80px 0;
    background-color: white;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.contact-info h2 {
    color: var(--secondary);
    margin-bottom: 30px;
}

.contact-info p {
    margin-bottom: 20px;
}

.contact-form {
    background-color: var(--light);
    padding: 30px;
    border-radius: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
}

.form-group textarea {
    height: 150px;
}

/* Footer */
footer {
    background-color: var(--secondary);
    color: white;
    padding: 50px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-column h3 {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 10px;
}

.footer-column ul li a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-column ul li a:hover {
    color: var(--primary);
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    display: inline-block;
    width: 40px;
    height: 40px;
    background-color: rgba(255,255,255,0.1);
    border-radius: 50%;
    text-align: center;
    line-height: 40px;
    color: white;
    transition: background-color 0.3s;
}

.social-links a:hover {
    background-color: var(--primary);
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #bdc3c7;
    font-size: 0.9rem;
}

/* Mobile Menu */
.menu-toggle {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
}

.mobile-menu {
    display: none;
    position: absolute;
    top: 80px;
    left: 0;
    width: 100%;
    background-color: var(--secondary);
    padding: 20px 0;
}

.mobile-menu.active {
    display: block;
}

.mobile-menu ul {
    list-style: none;
    text-align: center;
}

.mobile-menu ul li {
    margin: 15px 0;
}

.mobile-menu ul li a {
    color: white;
    text-decoration: none;
}

/* Animazioni */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate {
    animation: fadeIn 0.6s ease-out forwards;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
    }

    nav ul {
        margin-top: 20px;
        flex-direction: column;
        align-items: center;
    }

    nav ul li {
        margin: 10px 0;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .about-content, .contact-content {
        grid-template-columns: 1fr;
    }

    .menu-toggle {
        display: block;
        position: absolute;
        right: 20px;
        top: 20px;
    }
}

@media (max-width: 720px) {
    .box {
        width: min(100%, 100vw - 20px);
        max-width: none;
        height: auto;
        min-height: 360px;
        padding: 18px;
    }

    .login {
        inset: 14px;
    }

    .loginBx {
        width: 100%;
        max-width: none;
        min-height: 220px;
        max-height: 720px;
        padding: 0 12px;
    }

    .loginBx h2 {
        padding: 20px 0 10px;
        font-size: 1.2rem;
    }

    .loginBx input,
    .loginBx button.submit-btn {
        padding: 18px 20px;
        font-size: 1.1rem;
    }

    .loginBx button.submit-btn {
        width: 100%;
    }
}

@media (max-width: 540px) {
    .box {
        width: calc(100vw - 16px);
        min-height: 420px;
        padding: 14px;
    }

    .login {
        inset: 12px;
    }

    .loginBx {
        width: 100%;
        min-height: 240px;
        padding: 0 10px;
    }

    .loginBx h2 {
        font-size: 1.25rem;
    }

    .loginBx input,
    .loginBx button.submit-btn {
        padding: 20px 18px;
        font-size: 1.15rem;
    }
}
