/* Mobile Login - hidden by default, shown on mobile */
.mobile-login-container {
  display: none;
}

@media (max-width: 999px) {
  /* Full fixed layout */
  html, body {
    width: 100vw !important;
    height: 100vh !important;
    overflow: hidden !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
  }
  #loginPage {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    overflow: hidden !important;
  }
  .login-bg {
    position: fixed !important;
    top: 0; left: 0; right: 0; bottom: 0 !important;
  }

  /* Hide the TV login */
  .login-content {
    display: none !important;
  }
  .dns-text {
    display: none !important;
  }

  /* Show the mobile login */
  .mobile-login-container {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4vw !important;
    z-index: 100 !important;
    padding: 0 5vw !important;
  }

  /* Left: Logo */
  .ml-logo-side {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .ml-logo {
    width: 14vw;
    height: auto;
    filter: drop-shadow(0 0 1vw rgba(14,165,233,0.3));
  }

  /* Right: Form */
  .ml-form-side {
    flex: 0 1 65vw;
    max-width: 65vw;
  }
  .ml-form-card {
    background: rgba(15, 22, 45, 0.9);
    border: 0.15vw solid rgba(255,255,255,0.1);
    border-radius: 1.2vw;
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .ml-input-row {
    display: flex;
    align-items: center;
    padding: 0 2vw;
    height: 7vh;
    background: rgba(200, 220, 240, 0.12);
  }
  .ml-icon {
    width: 3vw;
    height: 3vw;
    flex-shrink: 0;
    color: rgba(255,255,255,0.4);
    margin-right: 2vw;
  }
  .ml-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 2vw;
    font-weight: 500;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
  }
  .ml-input::placeholder {
    color: rgba(255,255,255,0.35);
    font-weight: 400;
  }
  .ml-input:focus {
    color: #fff;
  }
  .ml-divider {
    height: 0.1vw;
    background: rgba(255,255,255,0.08);
  }
  .ml-btn {
    display: block;
    width: 100%;
    padding: 2vh 0;
    font-size: 2vw;
    font-weight: 700;
    letter-spacing: 0.3vw;
    color: #fff;
    background: rgba(30, 40, 70, 0.95);
    border: none;
    border-top: 0.1vw solid rgba(255,255,255,0.08);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    transition: background 0.2s;
  }
  .ml-btn:active {
    background: rgba(14, 165, 233, 0.4);
  }
}

/* Portrait mobile (phone held vertically) */
@media (max-width: 999px) and (orientation: portrait) {
  .mobile-login-container {
    flex-direction: column !important;
    gap: 4vh !important;
    padding: 0 8vw !important;
  }
  .ml-logo {
    width: 20vw !important;
  }
  .ml-form-side {
    flex: 0 1 auto !important;
    max-width: 84vw !important;
    width: 84vw !important;
  }
  .ml-input-row {
    height: 7vh !important;
    padding: 0 4vw !important;
  }
  .ml-icon {
    width: 5vw !important;
    height: 5vw !important;
    margin-right: 3vw !important;
  }
  .ml-input {
    font-size: 4vw !important;
  }
  .ml-btn {
    padding: 2.5vh 0 !important;
    font-size: 4vw !important;
    letter-spacing: 0.5vw !important;
  }
  .ml-form-card {
    border-radius: 3vw !important;
  }
}
