body {
     background-color: #D3DBDE !important;
     background-image: url('https://ibsa.itsplanet.com/img/sfondo.jpg') !important; /* Default Desktop */
     background-size: cover !important;
     background-position: center center !important;
     background-repeat: no-repeat !important;
     background-attachment: fixed;
     min-height: 100vh;
     display: flex;
     align-items: center;
     justify-content: center;
     margin: 0;
     position: relative;
}

/* Patina scura sopra lo sfondo */
body::before {
     content: "";
     position: fixed;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     background: rgba(0, 0, 0, 0.45); /* Overlay scura */
     z-index: 1;
}





/* --- LOGIN CARD --- */
.login-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 40px 35px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-soft);
  position: relative;
  margin: 20px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  z-index: 2;
}

.lang-switcher-container {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10;

  /* Visual Style of the Button */
  background-color: var(--primary-light);
  border-radius: 20px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

/* Prefix Select Styling */
.prefix-select {
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background-color: #f8fafc;
  color: var(--dark-slate);
  font-weight: 600;
  padding: 0 35px 0 15px;
  /* Spazio per la freccia */
  height: calc(3.5rem + 2px);
  /* Match input height */
  white-space: nowrap;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  outline: none;
  min-width: 110px;
}

.prefix-select:focus,
.prefix-select:hover {
  border-color: var(--primary-brand);
  background-color: white;
}

.lang-switcher-container:hover {
  background-color: #fff;
  border-color: var(--primary-brand);
  box-shadow: 0 4px 10px rgba(0, 174, 239, 0.15);
}

.lang-icon {
  color: var(--primary-deep);
  font-size: 0.9rem;
}

.lang-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary-deep);
  min-width: 20px;
  text-align: center;
}

.lang-arrow {
  font-size: 0.7rem;
  color: var(--primary-deep);
  opacity: 0.7;
}

/* The Invisible Select on Top */
.lang-select-hidden {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  /* Invisibile */
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

/* Brand Logo */
.brand-logo {
  text-align: center;
  margin-bottom: 25px;
  margin-top: 10px;
}

.brand-text {
  font-size: 2rem;
  font-weight: 800;
  color: var(--dark-slate);
  letter-spacing: -1px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.brand-text i {
  font-size: 1.8rem;
  color: var(--primary-brand);
}

.brand-text span {
  color: var(--primary-brand);
}

.welcome-text {
  text-align: center;
  color: var(--mid-slate);
  margin-bottom: 25px;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.5;
}

/* --- TABS SWITCHER --- */
.nav-pills {
  background: #f8fafc;
  padding: 4px;
  border-radius: var(--radius-main);
  margin-bottom: 25px;
  border: 1px solid #e2e8f0;
}

.nav-pills .nav-link {
  color: var(--mid-slate);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-main);
  transition: all 0.2s;
  padding: 8px 0;
}

.nav-pills .nav-link.active {
  background-color: white;
  color: var(--primary-brand);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* Form Elements */
.form-floating {
  margin-bottom: 15px;
}

.form-floating > .form-control {
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding-top: 1.625rem;
  padding-bottom: 0.625rem;
  height: calc(3.5rem + 2px);
  font-size: 1rem;
  color: var(--dark-slate);
  background-color: #f8fafc;
  transition: all 0.2s;
}

.form-floating > .form-control:focus {
  border-color: var(--primary-brand);
  background-color: #fff;
  box-shadow: 0 0 0 4px var(--primary-light);
}

.form-floating > label {
  color: #94a3b8;
  padding-top: 0.8rem;
}

/* Phone Input Group */
.phone-group {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.btn-prefix {
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background-color: #f8fafc;
  color: var(--dark-slate);
  font-weight: 600;
  padding: 0 15px;
  display: flex;
  align-items: center;
  gap: 5px;
  height: calc(3.5rem + 2px);
  /* Match input height */
  white-space: nowrap;
}

.btn-prefix:hover,
.btn-prefix.show {
  border-color: var(--primary-brand);
  background-color: white;
}

/* Password Toggle */
.password-group {
  position: relative;
}

.btn-toggle-pass {
  position: absolute;
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
  border: none;
  background: none;
  color: #94a3b8;
  cursor: pointer;
  z-index: 5;
  padding: 5px;
  display: flex;
}

.btn-toggle-pass:hover {
  color: var(--primary-brand);
}

/* Options Row */
.options-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  font-size: 0.85rem;
}

.form-check-input {
  border-color: #cbd5e1;
  cursor: pointer;
}

.form-check-input:checked {
  background-color: var(--primary-brand);
  border-color: var(--primary-brand);
}

.link-forgot {
  color: var(--mid-slate);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.link-forgot:hover {
  color: var(--primary-brand);
}

/* Login Button */
.btn-login {
  background: var(--ai-gradient);
  color: white;
  border-radius: var(--radius-main);
  padding: 14px;
  font-weight: 700;
  width: 100%;
  border: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-transform: uppercase;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  margin-bottom: 20px;
}

.btn-login:hover {

  opacity:0.7;
  color:white;
}

.btn-login:active {
  transform: scale(0.98);
}

/* Footer */
.login-footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--mid-slate);
  border-top: 1px solid #f1f5f9;
  padding-top: 20px;
  line-height: 1.4;
  opacity: 0.8;
}

/* RTL Specific Adjustments */
html[dir="rtl"] {
  text-align: right;
}

html[dir="rtl"] .lang-dropdown {
  left: 20px;
  right: auto;
}

html[dir="rtl"] .form-floating > label {
  left: auto;
  right: 0;
  transform-origin: 100% 0;
}

html[dir="rtl"] .form-control {
  text-align: right;
}

html[dir="rtl"] .btn-toggle-pass {
  right: auto;
  left: 15px;
}
/* Footer */
.auth-footer {
  text-align: center;
  font-size: 0.9rem;
  color: var(--mid-slate);
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #f1f5f9;
}
.auth-footer a {
  color: var(--dark-slate);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.2s;
}
.auth-footer a:hover {
  color: var(--primary-brand);
}

/* --- CAPTCHA STYLE --- */
.captcha-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 15px;
  margin-bottom: 20px;
}

.captcha-canvas {
  background-color: #fff;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  cursor: pointer;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05);
}

.btn-refresh {
  background: none;
  border: none;
  color: var(--mid-slate);
  font-size: 1.2rem;
  transition: transform 0.3s;
  padding: 5px;
}
.btn-refresh:hover {
  color: var(--primary-brand);
  transform: rotate(180deg);
}

.captcha-input {
  border: none;
  background: transparent;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 2px;
  width: 100px;
  text-align: center;
  color: var(--dark-slate);
  outline: none;
  border-bottom: 2px solid #e2e8f0;
  transition: border-color 0.2s;
}
.captcha-input:focus {
  border-color: var(--primary-brand);
}
.captcha-input::placeholder {
  font-weight: 400;
  letter-spacing: 0;
  font-size: 0.8rem;
}



     .login-logo-container {
          text-align: center;
          padding: 10px 0 10px 0; /* Aria ridotta dall'alto */
     }
     .login-logo {
          max-width: 260px; /* Logo più grosso */
          height: auto;
     }

     /* Assicura che la card risalti sullo sfondo */
     .login-card {
          background: rgba(255, 255, 255, 0.95);
          backdrop-filter: blur(5px);
          border: none;
          box-shadow: 0 10px 30px rgba(0,0,0,0.1);
     }


     /* Banda in alto */
     .top-bar {
          position: fixed;
          top: 0;
          left: 0;
          width: 100%;
          background-color: #ffffff;
          padding: 12px 20px;
          z-index: 10;
          box-shadow: 0 2px 10px rgba(0,0,0,0.15);
          display: flex;
          align-items: center;
     }

     .top-bar img {
          height: 35px;
          width: auto;
     }

     .login-logo-container {
          text-align: center;
          padding: 10px 0 10px 0; /* Aria ridotta dall'alto */
     }
     .login-logo {
          max-width: 260px; /* Logo più grosso */
          height: auto;
     }

     /* Assicura che la card risalti sopra l'overlay */
     .login-card {
          position: relative;
          z-index: 5;
          background: rgba(255, 255, 255, 0.98);
          backdrop-filter: blur(5px);
          border: none;
          box-shadow: 0 15px 35px rgba(0,0,0,0.25);
          margin-top: 60px; /* Spazio per la top-bar */
     }
