/* File: nearlearn-popup.css - Modified for CLS 0.1 compliance */

.cybersec-field,
.cybersec-terms {
  margin-bottom: 20px;
}

/* FIXED: Overlay reserves full viewport space from start - no layout shift */
.nearlearn-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh; /* Explicit viewport height */
  background-color: rgba(0,0,0,.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  /* CRITICAL: Space reserved, only opacity changes */
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
  contain: layout paint; /* Prevent layout recalc */
}

.nearlearn-popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* FIXED: Container has fixed dimensions - no expansion/shrink */
.nearlearn-popup-container {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0,0,0,.3);
  width: 90%;
  max-width: 400px;
  /* FIXED: Fixed height prevents content push */
  height: 500px; /* Reserve space for form */
  max-height: 90vh;
  overflow-y: auto;
  padding: 30px;
  position: relative;
  /* Only scale/translate without affecting layout */
  transform: scale(0.95) translateY(-20px);
  transition: transform .3s ease;
  box-sizing: border-box;
}

.nearlearn-popup-overlay.active .nearlearn-popup-container {
  transform: scale(1) translateY(0);
}

.nearlearn-popup-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  z-index: 1001;
}

.nearlearn-popup-close:hover {
  color: #333;
}

.cybersec-input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  box-sizing: border-box;
  /* FIXED: Fixed height prevents input resize shift */
  height: 48px;
}

.cybersec-input:focus {
  outline: 0;
  border-color: #4a90e2;
  box-shadow: 0 0 0 2px rgba(74,144,226,.2);
}

.cybersec-error {
  color: #dc3545;
  font-size: 14px;
  display: none;
  margin-top: 5px;
}

.cybersec-failure,
.cybersec-success {
  padding: 12px;
  border-radius: 4px;
  margin-bottom: 20px;
  display: none;
  /* FIXED: Fixed height for messages */
  min-height: 48px;
}

.cybersec-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.cybersec-failure {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.cybersec-terms {
  display: flex;
  align-items: flex-start;
}

.cybersec-terms input {
  margin-right: 10px;
  margin-top: 3px;
}

.cybersec-terms label {
  font-size: 14px;
  line-height: 1.4;
  color: #555;
  flex: 1;
}

.cybersec-terms a {
  color: #4a90e2;
  text-decoration: none;
}

.cybersec-terms a:hover {
  text-decoration: underline;
}

.cybersec-submit {
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 12px 20px;
  font-size: 16px;
  cursor: pointer;
  width: 100%;
  transition: background-color .3s ease;
  background: #00A6FF;
  /* FIXED: Fixed height prevents button resize */
  height: 48px;
  box-sizing: border-box;
}

.cybersec-submit:hover:not(:disabled) {
  background-color: #25d366;
}

.cybersec-submit:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.nearlearn-required {
  color: #e74c3c;
}

/* FIXED: Logo has fixed dimensions - no image shift */
#form_logo {
  display: block;
  margin: 0 auto;
  width: 150px; /* Fixed width */
  height: 56px; /* Fixed height */
  object-fit: contain; /* Prevents distortion */
}

/* Media Queries - preserve fixed dimensions */
@media (max-width: 480px) {
  .nearlearn-popup-container {
    padding: 20px;
    max-width: 300px;
    height: 450px; /* Adjusted but still fixed */
  }
  
  .cybersec-input,
  .cybersec-submit {
    padding: 10px;
    height: 44px; /* Fixed mobile height */
  }
}
