/* ION Admin Console Login Styles */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  color: #ffffff;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.container {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  min-height: 500px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* Prevent layout shift from password managers like LastPass */
input[type="email"] {
  position: relative;
}

/* Hide LastPass, 1Password, and other password manager icons that cause shifts */
input[type="email"]::-ms-reveal,
input[type="email"]::-ms-clear {
  display: none;
}

/* LastPass specific */
div[id^="__lpform_"],
div[data-lastpass-icon-root] {
  position: absolute !important;
  right: 10px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 999 !important;
}

.logo img {
  width: 180px;
  height: auto;
  margin-bottom: 10px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.title {
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.subtitle {
  font-size: 16px;
  color: #cccccc;
  margin-bottom: 30px;
  font-weight: 400;
}

#messageBox {
  min-height: 20px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

/* Form Styles */
form {
  width: 100%;
}

form.hidden {
  display: none !important;
}

.hidden {
  display: none !important;
}

input[type="email"] {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  font-size: 16px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  position: relative;
  box-sizing: border-box;
}

/* Create a stable container for the input to prevent shifts */
form {
  width: 100%;
  position: relative;
}

/* Ensure password manager dropdowns don't affect layout */
input[type="email"] {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

input[type="email"]:focus {
  outline: none;
  border-color: #ffd700;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

input[type="email"]::placeholder {
  color: #999999;
}

/* Button Styles */
.btn {
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  color: #1a1a1a;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 10px;
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 215, 0, 0.4);
  background: linear-gradient(135deg, #ffed4e 0%, #ffd700 100%);
}

.btn:active {
  transform: translateY(0);
}

/* Google OAuth Button Styles */
.inline-flex {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
  text-decoration: none;
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  background: transparent;
  padding: 12px 24px;
  font-size: 14px;
  gap: 12px;
  width: 100%;
  margin-bottom: 10px;
}

.inline-flex:hover {
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
  color: #ffffff;
}

.flex-shrink-0 {
  flex-shrink: 0;
}

/* OTP Styles */
.otp-boxes {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}

.otp-digit {
  width: 45px;
  height: 45px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  transition: all 0.3s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.otp-digit:focus {
  outline: none;
  border-color: #ffd700;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

.timer {
  color: #cccccc;
  font-size: 14px;
  margin-bottom: 20px;
}

#countdown {
  color: #ffd700;
  font-weight: 600;
}

/* Success/Error Message Colors */
.success {
  color: #00cc66;
}

.error {
  color: #ff4d4d;
}

.info {
  color: #cccccc;
}

/* Resend Button Specific Styles */
#resend-btn {
  background: #6c757d;
  font-size: 14px;
  margin-top: 10px;
}

#resend-btn:hover {
  background: #5a6268;
  transform: translateY(-1px);
}

/* Responsive Design - Tablets */
@media screen and (max-width: 768px) {
  body {
    padding: 15px;
  }
  
  .container {
    padding: 30px 25px;
    min-height: 480px;
  }
  
  .logo img {
    width: 160px;
  }
  
  .title {
    font-size: 26px;
  }
  
  .subtitle {
    font-size: 15px;
    margin-bottom: 25px;
  }
}

/* Responsive Design - Mobile */
@media screen and (max-width: 480px) {
  body {
    padding: 10px;
  }
  
  .container {
    padding: 25px 20px;
    margin: 0;
    max-width: 100%;
    min-height: 480px;
  }
  
  .logo img {
    width: 150px;
  }
  
  .title {
    font-size: 24px;
  }
  
  .subtitle {
    font-size: 14px;
    margin-bottom: 20px;
  }
  
  #messageBox {
    font-size: 13px;
    margin-bottom: 15px;
  }
  
  input[type="email"] {
    padding: 12px 14px;
    font-size: 16px; /* Prevents zoom on iOS */
    margin-bottom: 15px;
  }
  
  .btn {
    padding: 12px 16px;
    font-size: 15px;
  }
  
  .inline-flex {
    padding: 10px 16px;
    font-size: 13px;
    gap: 10px;
  }
  
  .inline-flex svg {
    width: 18px;
    height: 18px;
  }
  
  .otp-boxes {
    gap: 6px;
  }
  
  .otp-digit {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
  
  .timer {
    font-size: 13px;
  }
  
  #resend-btn {
    font-size: 13px;
  }
}

/* Very small phones */
@media screen and (max-width: 375px) {
  .container {
    padding: 20px 15px;
    min-height: 450px;
  }
  
  .logo img {
    width: 130px;
  }
  
  .title {
    font-size: 22px;
    margin-bottom: 6px;
  }
  
  .subtitle {
    font-size: 13px;
    margin-bottom: 15px;
  }
  
  .otp-boxes {
    gap: 4px;
  }
  
  .otp-digit {
    width: 38px;
    height: 38px;
    font-size: 15px;
  }
}

/* Landscape orientation on mobile */
@media screen and (max-height: 600px) and (orientation: landscape) {
  body {
    padding: 10px;
  }
  
  .container {
    padding: 20px 25px;
    min-height: auto;
  }
  
  .logo img {
    width: 120px;
    margin-bottom: 10px;
  }
  
  .title {
    font-size: 22px;
    margin-bottom: 5px;
  }
  
  .subtitle {
    font-size: 13px;
    margin-bottom: 15px;
  }
  
  #messageBox {
    margin-bottom: 10px;
  }
  
  input[type="email"] {
    padding: 10px 14px;
    margin-bottom: 10px;
  }
  
  .btn {
    padding: 10px 16px;
  }
  
  .otp-digit {
    width: 35px;
    height: 35px;
  }
}

/* Fix for iOS input zoom */
@media screen and (max-width: 768px) {
  input[type="email"],
  input[type="text"],
  input[type="number"],
  .otp-digit {
    font-size: 16px !important;
  }
}

/* Comprehensive password manager handling */
/* LastPass */
div[id^="__lpform_"] {
  position: absolute !important;
}

/* Generic password manager overlay prevention */
input::-webkit-credentials-auto-fill-button {
  visibility: hidden;
  position: absolute;
  right: 0;
}

/* Prevent autocomplete dropdown from shifting layout */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px rgba(255, 255, 255, 0.05) inset !important;
  -webkit-text-fill-color: #ffffff !important;
  transition: background-color 5000s ease-in-out 0s;
}