/* Mobile Login Modal Styles - Exact Match */
.mobile-login-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: #f8f9fa;
  z-index: 9999;
  display: none;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.mobile-login-modal.show {
  display: flex;
}

.mobile-login-header {
  width: 100%;
  background: white;
  padding: max(env(safe-area-inset-top), 16px) 20px 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: 1px solid #e9ecef;
  box-sizing: border-box;
  position: relative;
}

.mobile-login-close {
  position: absolute;
  top: max(env(safe-area-inset-top), 16px);
  right: 20px;
  background: none;
  border: none;
  color: #6c757d;
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-login-close:hover,
.mobile-login-close:active {
  background: #f8f9fa;
  color: #343a40;
}

.mobile-login-title {
  color: #1e3a8a;
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  text-align: center;
}

.mobile-login-content {
  flex: 1;
  width: 100%;
  max-width: 400px;
  padding: 40px 30px max(env(safe-area-inset-bottom), 30px);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: white;
  min-height: 0;
}

.mobile-login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 30px;
}

.mobile-login-input-group {
  position: relative;
  width: 100%;
}

.mobile-login-input {
  width: 100%;
  padding: 16px 50px 16px 20px;
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 0;
  color: #495057;
  font-size: 16px;
  box-sizing: border-box;
  transition: all 0.3s;
  font-size: max(16px, 1rem);
}

.mobile-login-input::placeholder {
  color: #6c757d;
  font-size: 14px;
}

.mobile-login-input:focus {
  outline: none;
  border-color: #1e3a8a;
  box-shadow: 0 0 0 2px rgba(30, 58, 138, 0.1);
}

.mobile-login-input-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #6c757d;
  cursor: pointer;
  padding: 8px;
  font-size: 16px;
  border-radius: 50%;
  transition: all 0.2s;
  min-width: 32px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-login-input-icon:hover,
.mobile-login-input-icon:active {
  background: #f8f9fa;
  color: #495057;
}

.mobile-login-checkbox-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin: -10px 0 10px 0;
}

.mobile-login-checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
  color: #495057;
}

.mobile-login-checkbox input[type="checkbox"] {
  display: none;
}

.mobile-login-checkbox .checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid #e9ecef;
  border-radius: 0;
  margin-right: 8px;
  position: relative;
  transition: all 0.2s;
}

.mobile-login-checkbox input[type="checkbox"]:checked + .checkmark {
  background: #1e3a8a;
  border-color: #1e3a8a;
}

.mobile-login-checkbox input[type="checkbox"]:checked + .checkmark::after {
  content: '✓';
  position: absolute;
  top: -2px;
  left: 2px;
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.mobile-login-forgot {
  color: #1e3a8a;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s;
}

.mobile-login-forgot:hover {
  text-decoration: underline;
}

.mobile-login-button {
  width: 100%;
  padding: 16px;
  background: #82b347;
  border: none;
  border-radius: 0;
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  margin: 10px 0;
  box-shadow: 0 2px 4px rgba(130, 179, 71, 0.2);
}

.mobile-login-button:hover {
  background: #7aa340;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(130, 179, 71, 0.3);
}

.mobile-login-button:active {
  transform: translateY(0);
}

.mobile-login-divider {
  width: 100%;
  text-align: center;
  margin: 30px 0 20px;
  position: relative;
  color: #6c757d;
  font-size: 14px;
}

/* Login modal social buttons - circular */
#mobileLoginModal .mobile-login-social-buttons {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 30px;
}

#mobileLoginModal .mobile-login-social-button {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#mobileLoginModal .mobile-login-social-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mobile-sms-login-button {
  background: #4285f4;
  border: none;
  border-radius: 0;
  color: white;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 30px;
  box-shadow: 0 2px 4px rgba(66, 133, 244, 0.2);
}

.mobile-sms-login-button:hover {
  background: #3367d6;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(66, 133, 244, 0.3);
}

.mobile-login-register-section {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
  width: 100%;
}

.mobile-login-register-text {
  color: #6c757d;
  font-size: 14px;
  margin-bottom: 15px;
}

.mobile-login-register-button {
  background: #4285f4;
  border: none;
  border-radius: 0;
  color: white;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 auto;
  box-shadow: 0 2px 4px rgba(66, 133, 244, 0.2);
  min-width: 120px;
}

.mobile-login-register-button:hover {
  background: #3367d6;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(66, 133, 244, 0.3);
}

/* Registration modal social buttons - inline horizontal */
#mobileRegisterModal .mobile-login-social-buttons {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 30px;
  justify-content: space-between;
}

#mobileRegisterModal .mobile-login-social-button {
  flex: 1;
  min-width: calc(25% - 6px);
  height: auto;
  min-height: 50px;
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  font-size: 10px;
  color: white;
  font-weight: 500;
  text-align: center;
}

.mobile-login-social-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mobile-login-social-button span {
  color: white;
  font-weight: 500;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-register-terms {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #e9ecef;
}

.mobile-register-terms p {
  margin: 8px 0;
}

.mobile-register-terms a {
  text-decoration: none;
}

.mobile-register-terms a:hover {
  text-decoration: underline;
}

/* Select dropdown styling */
.mobile-login-input[type="text"],
.mobile-login-input[type="password"],
select.mobile-login-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: none;
}

select.mobile-login-input {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 40px;
}

select.mobile-login-input option {
  background: white;
  color: #495057;
  padding: 10px;
}

/* Animation for modal opening/closing */
@keyframes slideInUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideOutDown {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(100%);
    opacity: 0;
  }
}

.mobile-login-modal.show {
  animation: slideInUp 0.3s ease-out;
}

.mobile-login-modal.hide {
  animation: slideOutDown 0.3s ease-in;
}

/* Responsive adjustments */
@media (max-height: 700px) {
  .mobile-login-content {
    padding: 20px 30px max(env(safe-area-inset-bottom), 20px);
  }
  
  .mobile-login-form {
    gap: 15px;
    margin-bottom: 20px;
  }
  
  .mobile-login-divider {
    margin: 20px 0 15px;
  }
  
  .mobile-login-register-section {
    margin-top: 20px;
  }
}

@media (max-height: 600px) {
  .mobile-login-header {
    padding: max(env(safe-area-inset-top), 12px) 20px 12px;
  }
  
  .mobile-login-content {
    padding: 15px 30px max(env(safe-area-inset-bottom), 15px);
  }
  
  .mobile-login-form {
    gap: 12px;
    margin-bottom: 15px;
  }
  
  .mobile-login-input {
    padding: 12px 45px 12px 16px;
  }
  
  .mobile-login-button {
    padding: 12px;
  }
  
  .mobile-login-social-button {
    width: 40px;
    height: 40px;
  }
  
  .mobile-sms-login-button {
    padding: 10px 20px;
    font-size: 12px;
  }
}

/* Hide on desktop */
@media (min-width: 769px) {
  .mobile-login-modal {
    display: none !important;
  }
}

/* Special handling for landscape mode on mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .mobile-login-modal {
    overflow-y: scroll;
  }
  
  .mobile-login-content {
    padding: 10px 30px max(env(safe-area-inset-bottom), 10px);
    min-height: auto;
  }
  
  .mobile-login-form {
    gap: 8px;
    margin-bottom: 10px;
  }
  
  .mobile-login-input {
    padding: 10px 40px 10px 14px;
  }
    .mobile-login-button {
    padding: 10px;
  }
  
  .mobile-login-divider {
    margin: 15px 0 10px;
  }
  
  .mobile-login-register-section {
    margin-top: 15px;
    padding-top: 15px;
  }
  
  .mobile-login-social-button {
    width: 36px;
    height: 36px;
  }
  
  .mobile-sms-login-button {
    padding: 8px 16px;
    font-size: 11px;
  }
}

@media (max-height: 700px) {
  .mobile-login-social-buttons {
    gap: 8px;
    margin-bottom: 20px;
  }
  
  .mobile-login-social-button {
    min-height: 50px;
    padding: 8px;
    font-size: 11px;
  }
  
  .mobile-register-terms {
    margin-top: 15px;
    padding-top: 10px;
  }
  
  .mobile-register-terms p {
    font-size: 10px !important;
    margin: 5px 0;
  }
}

@media (max-height: 600px) {
  .mobile-login-social-buttons {
    gap: 6px;
    margin-bottom: 15px;
  }
  
  .mobile-login-social-button {
    min-height: 45px;
    padding: 6px;
    font-size: 10px;
  }
  
  .mobile-login-social-button svg {
    width: 16px;
    height: 16px;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .mobile-login-social-buttons {
    gap: 4px;
    margin-bottom: 10px;
  }
  
  .mobile-login-social-button {
    min-height: 40px;
    padding: 4px;
    font-size: 9px;
    gap: 2px;
  }
  
  .mobile-login-social-button svg {
    width: 14px;
    height: 14px;
  }
  
  .mobile-register-terms {
    margin-top: 10px;
    padding-top: 8px;
  }
  
  .mobile-register-terms p {
    font-size: 9px !important;
    margin: 3px 0;
  }
}

/* Responsive adjustments for very small screens */
@media (max-width: 360px) {
  #mobileRegisterModal .mobile-login-social-buttons {
    gap: 6px;
  }
  
  #mobileRegisterModal .mobile-login-social-button {
    min-width: calc(50% - 3px);
    font-size: 9px;
    padding: 6px 2px;
  }
}

/* Country search input styling */
.country-search {
  border: 1px solid #ddd !important;
  background-color: #f8f9fa !important;
  font-size: 13px !important;
  padding: 8px 12px !important;
}

.country-search:focus {
  border-color: #6BA1D1 !important;
  background-color: white !important;
}

/* Custom Country Dropdown Styles */
.custom-dropdown {
  position: relative;
  width: 100%;
}

.dropdown-selected {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  border: 1px solid #e9ecef;
  border-radius: 0;
  background: white;
  cursor: pointer;
  min-height: 44px;
  font-size: 16px;
  transition: all 0.2s;
}

.dropdown-selected:hover,
.dropdown-selected.active {
  border-color: #6BA1D1;
}

.flag-icon {
  width: 20px;
  height: 15px;
  margin-right: 10px;
  border-radius: 2px;
  object-fit: cover;
}

.selected-text {
  flex-grow: 1;
  color: #495057;
}

.dropdown-arrow {
  color: #6c757d;
  transition: transform 0.2s;
}

.dropdown-selected.active .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #e9ecef;
  border-top: none;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

.dropdown-options.show {
  display: block;
}

.dropdown-search {
  padding: 10px;
  border-bottom: 1px solid #e9ecef;
  background: #f8f9fa;
}

.country-search-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 0;
  font-size: 14px;
  outline: none;
}

.country-search-input:focus {
  border-color: #6BA1D1;
}

.options-container {
  max-height: 150px;
  overflow-y: auto;
}

.country-option {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.country-option:hover {
  background-color: #f8f9fa;
}

.country-option.selected {
  background-color: #e3f2fd;
}

.country-name {
  color: #495057;
  font-size: 14px;
}
