@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Inter", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
}

:root {
    --primary-color: #2563eb;
    --primary-color-light: #eff6ff;
    --primary-color-dark: #1d4ed8;
    --title-text-color: #0f172a;
    --text-color: #8a95a5;
    --light-gray: #f1f5f9;
    
    --danger-color: #ef4444;
    --success-color: #10b981;
    --warning-color: #f59e0b;

    /* MF */
    --pui-cstm-primary: hsl(221, 83%, 53%);
    --pui-cstm-primary-rgb: 37, 99, 235;
    --pui-cstm-primary-hover: hsl(224, 71%, 48%);
    --pui-cstm-primary-active: hsl(226, 48%, 40%);
    --pui-cstm-primary-text-color: #fff;

    --pui-cstm-secondary: hsl(215, 16%, 47%);
    --pui-cstm-secondary-rgb: 100, 116, 139;
    --pui-cstm-secondary-hover: hsl(215, 19%, 35%);
    --pui-cstm-secondary-active: hsl(215, 25%, 27%);
    --pui-cstm-secondary-text-color: #eef3ff;
}

body {
    color: var(--text-color);
    background: #f8fafc;
    display: none;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--title-text-color);
}

p {
    margin-top: 10px;
    line-height: 1.5;
}

.intro {    
    position: relative;
    text-align: center;
}

.text-center {
    text-align: center;
}

.content-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.container-title {
    animation: 1s fadeIn;
}

#app-title {
    position: relative;
    z-index: 2;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.secondary-title {
    font-style: italic;
    position: absolute;
    left: 50%;
    top: 0px;
    transform: translateX(-50%);
    width: 100%;
    color: #efd255;
    letter-spacing: 1px;
}

.container {
    padding-inline: 50px;
    max-width: 1600px;
    margin: 0 auto;
}

@media(max-width: 989px){
  .container {
      padding-inline: 30px;
  }
}

/* -------
BUTTON
------------------------------- */
.btn {
    border-radius: 16px;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    transition: .3s;
    border: none;
}

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

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

.btn.btn-secondary {
    background: var(--primary-color-light);
    border: 2px solid #d6e6fd;
    color: var(--primary-color);
}

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

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

.btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.link {
    background: transparent !important;
    text-decoration: underline !important;
    color: var(--primary-color) !important;
    font-size: 16px;    
}

.link.dark {
  color: var(--primary-color-dark) !important;
}

.link.danger {
  color: var(--danger-color) !important;
}

.bg-dots {
  background-image: radial-gradient(rgba(69, 65, 65, .2) 1px, transparent 0px);
  background-size: 16px 16px;
}

/* -------
NAV
------------------------------- */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: #fff;
  padding-block: 20px;
  z-index: 99;
  box-shadow: 0 3px 6px 3px rgba(180, 194, 223, 0.1) !important;
  height: 90px;
}

#navbar .navbar__inner {
  display: flex;
  align-items: center;
  gap: 13px;
  flex-wrap: wrap;
}

#navbar .navbar__inner img {
  height: 50px;
}

#navbar .navbar__inner .menu-item {
  color: var(--title-text-color) !important;
  text-decoration: none !important;
  padding-inline: 0 !important;
  margin-left: 20px;
}

#navbar .navbar__inner .menu-item:nth-of-type(1){
  margin-left: 40px;
}

@media(max-width: 686px){
  #navbar .navbar__inner .menu-item {
    display: none;
  }
}


/* -------
LANDING PAGE
------------------------------- */
.hero {
  padding-top: 90px;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.hero > .col {
  flex-basis: 50%;
  padding-inline: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

#app-title {
  line-height: 1.1;
  font-size: 60px;
  margin-bottom: 10px; 
}

#app-subtitle {
  font-size: 1.1rem;
  color: #5A6270;
  margin-bottom: 30px;
}

.cta-subtext {
  font-size: 0.85rem;
  color: #7A8490;
  margin: 0;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
}

.cta-subtext i {
  color: var(--warning-color);
}

.hero-cta-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 40px;
  width: 100%;
}

@media(max-width: 989px) {
  .hero {
    padding-top: 150px !important;
    padding: 30px 20px;
    text-align: center;
  }

  .hero > .col {
    flex-basis: 100%;
    padding: 10px 0;
    align-items: center;
  }

  #app-title {
    font-size: 36px;
  }

  .cta-subtext {
    justify-content: center;
  }
}

/* -------
AUTHSERVICE
------------------------------- */
.container-btn-authservice {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 40px;
}

.spid-container {
    position: relative;
}

.btn.authservice-button {
    width: 185px;
    font-size: 16px;
    padding: 15px;
}

.authservice-button img{
    height: 20px;
}

.spid-provider-container{
    display: none; 
    position: absolute;
    border: 1px solid rgba(0,0,0,.1);
    max-width: 90%;
    overflow-y: auto;
    z-index: 9;
    background: #fff;
    border-radius: 8px;
    width: 200px;
    top: 60px;
    z-index: 3;
}

.provinder {
    cursor: pointer;
    width: 100%;
    padding: 10px 15px;
    border-bottom: 1px solid rgba(0, 0, 0, .1);
    background: #fff;
}

.provinder img {
    height: 20px;
}

.info-spid-provider{
    color: #4E4E4E;
}

.info-spid-provider:not(:last-child){
    border-bottom: 1px solid rgba(0,0,0,.1);    
}

@media(max-width: 989px){
  .container-btn-authservice {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }
}

/* -------
HOME
------------------------------- */
.home-container {
  min-height: 100svh;
  padding-top: 130px;
}

#home-container, #containerUtenteProfilo{
  display: none;  
}

#welcome-title {
    color: var(--text-color);
    font-size: 18px;    
    font-weight: 500;
    margin-bottom: 3px;
}

#welcome-user {
    font-size: 23px;
}

#containerUtenteProfilo, #btnAuthDomain {
    order: 1;
    margin-left: auto;
    position: relative;
}

.welcome-container {
    margin-bottom: 40px;
}

#welcome-title, #welcome-user { text-transform: capitalize; }
#welcome-user { line-height: 1; }

.welcome-container p {
    margin-top: 20px;
}

#btnProfiloUtente {
  display: flex;
  align-items: center;
  gap: 15px;
  background: transparent;
  color: var(--text-color);
  font-weight: 500;
  text-transform: capitalize;
}

.container-info-utente-profilo span {
  display: block;
  text-align: start;
}

.nome-utente-profilo {
  font-size: 1rem;
  color: var(--title-text-color);
}

.avatar-utente {
  height: 35px;
  width: 35px;
  border-radius: 50%;
  background: var(--primary-color);
  color: var(--primary-color-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.menu-utente-profilo {
  pointer-events: none;
  opacity: 0;
  transform: translateY(-20px);
  position: absolute;
  top: 100%;
  right: 15px;
  left: 15px;
  padding: 20px;
  background-color: #fff;
  border-radius: 18px;
  box-shadow: 0 3px 6px 3px rgba(180, 194, 223, 0.1);
  border:1px solid var(--light-gray);
  transition: .3s;
}

.menu-utente-profilo:after{
  content: '';
  position: absolute;
  height: 10px;
  width: 10px;
  background: #fff;
  border: 1px solid var(--light-gray);
  border-top: none;
  border-right: none;
  top: 0;
  right: 25px;
  transform: rotate(135deg) translateY(10px);
}

.menu-utente-profilo.active {
  pointer-events: unset;
  opacity: 1;
  transform: translateY(0);
}

/* -------
NOTIFICATION TOASTS (UI/UX)
------------------------------- */
.notification-container {
    position: fixed;
    right: 30px;
    top: 30px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 15px;
    pointer-events: none;
}

.notification {
    position: relative;
    min-width: 320px;
    max-width: 400px;
    background: #ffffff;
    padding: 20px 45px 20px 24px;
    border-radius: 16px;
    box-shadow: 0 10px 40px -10px rgba(15, 23, 42, 0.15);
    border: 1px solid rgba(226, 232, 240, 0.8);
    pointer-events: auto;
    animation: toastSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    overflow: hidden;
}

.notification::before {
    content: '';
    position: absolute;
    width: 90px;
    height: 90px;
    top: -60px;
    left: -60px;
    border-radius: 50%;
    filter: blur(50px);
    z-index: 0;
    opacity: 0.35;
    transition: all 0.6s ease;
}

.notification.success::before {
    background: var(--success-color);
}
.notification.warning::before {
    background: var(--warning-color);
}
.notification.error::before {
    background: var(--danger-color);
}

.notification-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--title-text-color);
    margin: 0 0 6px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 2;
}

.notification-message {
    font-size: 0.95rem;
    color: var(--text-color);
    line-height: 1.5;
    margin: 0;
    display: block;
    position: relative;
    z-index: 2;
}

.notification .btn-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 3;
}

.notification .btn-close:hover {
    background: var(--light-gray);
    color: var(--title-text-color);
}

.notification::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: currentColor;
    animation: toastProgress 5s linear forwards;
    opacity: 0.4;
    z-index: 2;
}
.notification.success::after { color: var(--success-color); }
.notification.warning::after { color: var(--warning-color); }
.notification.error::after { color: var(--danger-color); }

@keyframes toastSlideIn {
    0% { transform: translateX(120%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes toastSlideOut {
    0% { transform: translateX(0); opacity: 1; height: auto; margin-bottom: 15px; }
    100% { transform: translateX(120%); opacity: 0; height: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; border: none; }
}

@keyframes toastProgress {
    0% { width: 100%; }
    100% { width: 0%; }
}

/* -------
MODALE
------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal {
    background: rgba(255, 255, 255, 0.94);
    width: 90%;
    max-width: 400px;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    text-align: center;
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}

.modal-overlay.show .modal {
    transform: scale(1);
}

.modal h3 {
    margin-top: 0;
    font-size: 22px;
    font-weight: 600;
    color: #1d1d1f;
}

.modal p {
  margin-bottom: 20px;
}

.modal input {
    width: 100%;
    padding: 12px 16px;
    margin: 8px 0;
    border: 1px solid #d2d2d7;
    border-radius: 12px;
    background: #f5f5f7;
    outline: none;
    transition: border-color 0.2s;
}

.modal input:focus {
    border-color: var(--primary-color);
}

.modal-button-bar {
  margin-top: 30px;
  display: flex;
  justify-content: end;
  flex-wrap: wrap;
  gap: 10px;
}

/* -------------------
LOADER
------------------------------- */
#mgg-loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);  
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;  
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#mgg-loader-overlay.mgg-loader-active {
  opacity: 1;
  visibility: visible;
}

.mgg-loader-spinner {
  width: 64px;
  height: 64px;
  border: 6px solid var(--primary-color-light);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: mgg-spin 1s cubic-bezier(0.5, 0.1, 0.4, 0.9) infinite;
  position: relative;
}

.mgg-loader-spinner::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  background-color: var(--primary-color-dark);
  border-radius: 50%;
  animation: mgg-pulse 1s ease-in-out infinite alternate;
}

@keyframes mgg-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes mgg-pulse {
  0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.6; }
  100% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
}