body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: url('static/photos/bg.png') no-repeat center center fixed;
  background-size: cover;
  font-family: 'Poppins', sans-serif;
  padding: 20px;
  margin: 0;
  overflow: auto;
  box-sizing: border-box;
}
.container {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 50px;
  width: 100%;
  max-width: 1200px;
  height: 100%;
}
.logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 300px;
  flex-shrink: 0;
}
.logo {
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background-color: white;
  padding: 10px;
  display: block;
  margin: 0 auto;
  object-fit: contain;
}
.logo-text {
  font-family: 'Playfair Display', serif;
  font-size: clamp(18px, 4vw, 30px);
  font-weight: bold;
  margin-top: 10px;
  color: #e2e2e2;
  text-transform: uppercase;
  line-height: 1.2;
}
.modal {
  max-width: 400px;
  width: 100%;
  padding: 35px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  animation: fadeIn 1.5s ease-out;
  text-align: center;
  box-sizing: border-box;
}
#signup-modal.modal {
  max-width: 700px;
  width: 90%;
  padding: 40px;
  max-height: 90vh;
  overflow-y: auto;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  animation: fadeInCentered 1.5s ease-out;
}
#forgot-password-modal.modal {
  max-width: 400px;
  width: 90%;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  animation: fadeInCentered 1.5s ease-out;
}
.banner {
  width: 100%;
  max-height: 120px;
  object-fit: contain;
  margin-bottom: 15px;
}
.title {
  text-align: center;
  color: #333;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.description {
  text-align: center;
  color: #666;
  font-size: clamp(0.85rem, 2vw, 0.9rem);
  margin-bottom: 25px;
}
.benefits {
  margin: 20px 0;
}
.group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
  margin-bottom: 20px;
  width: 100%;
  max-width: 350px;
  min-height: 80px; /* Reserve space for label + input + error */
}
#signup-modal .group {
  max-width: 600px;
}
.location-group {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  min-height: auto; /* Override for location group */
}
.location-field {
  flex: 1;
  min-width: 120px;
}
.province-field {
  order: 1;
}
.city-field {
  order: 2;
}
.input-label {
  display: block;
  margin-bottom: 8px;
  font-size: clamp(12px, 2.5vw, 14px);
  color: #333;
  font-weight: 500;
}
.required-label {
  color: #ff4444;
}
.input {
  width: 100%;
  height: 40px;
  padding: 0 40px 0 10px;
  border: 2px solid transparent;
  border-radius: 8px;
  outline: none;
  background-color: #f8fafc;
  color: #0d0c22;
  font-size: clamp(14px, 3vw, 0.9rem);
  transition: all 0.3s ease;
  box-sizing: border-box;
}
.input-login {
  width: 100%;
  height: 40px;
  padding: 0 40px 0 10px;
  border: 2px solid transparent;
  border-radius: 8px;
  outline: none;
  background-color: #f8fafc;
  color: #0d0c22;
  font-size: clamp(14px, 3vw, 0.9rem);
  transition: all 0.3s ease;
  box-sizing: border-box;
}
.input::placeholder,
.input-login::placeholder {
  color: #94a3b8;
  font-size: clamp(12px, 2.5vw, 0.85rem);
}
.input:focus,
.input:hover,
.input-login:focus,
.input-login:hover {
  border-color: #81d4fa;
  background-color: #fff;
  box-shadow: 0 0 0 5px rgba(129, 140, 248, 0.3);
}
.input.error {
  border-color: #ff4444;
  background-color: #fff1f1;
}
.input.valid ~ .valid-icon {
  display: inline-block;
}
.valid-icon {
  position: absolute;
  right: 1rem;
  top: 60%;
  transform: translateY(-50%);
  color: #4CAF50;
  font-size: 0.9rem;
  pointer-events: none;
  z-index: 2;
  display: none;
}
.error-message {
  color: #ff4444;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
  position: absolute;
  bottom: -1.5rem;
  left: 0;
  width: 100%;
  margin-top: 5px;
  margin-bottom: 10px;
}
.error-message::before {
  font-size: 14px;
}
.error-summary {
  background-color: #fff1f1;
  border: 2px solid #ff4444;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  color: #ff4444;
  font-size: 14px;
  text-align: left;
}
.error-summary p {
  margin: 0 0 10px;
  font-weight: 600;
}
.error-summary ul {
  margin: 0;
  padding-left: 20px;
}
.error-summary li {
  margin-bottom: 5px;
}
.upgrade-btn {
  width: 100%;
  padding: 12px;
  background-color: #0ea5e9;
  color: #fff;
  border: none;
  border-radius: 25px;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 15px;
  min-height: 48px; /* Touch-friendly */
}
.upgrade-btn:hover {
  background-color: #0eacf5;
  transform: translateY(-3px);
  box-shadow: 0 6px 25px rgba(88, 188, 130, 0.3);
}
.cancel-btn {
  width: 100%;
  padding: 12px;
  background: #fff;
  color: #0ea5e9;
  border: 2px solid #0ea5e9;
  border-radius: 25px;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.2s, color 0.2s, border 0.2s;
  min-height: 48px; /* Touch-friendly */
}
.cancel-btn:hover {
  background: #f0f9ff;
  color: #0284c7;
  border-color: #0284c7;
}
.remember-me {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #555;
  margin: 10px 0;
}
.remember-me input[type="checkbox"] {
  width: auto;
  height: auto;
  min-height: 20px;
  min-width: 20px;
}
.toggle-password {
  position: absolute;
  right: 0.8rem;
  top: 60%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  color: #555;
  user-select: none;
  z-index: 2;
  background: none;
  border: none;
  padding: 0;
  width: 24px;
  height: 24px;
}
.toggle-password:hover {
  color: #333;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
}
.forgot-password {
  text-align: center;
  margin-top: 10px;
}
.forgot-password a {
  color: #0ea5e9;
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.3s ease;
}
.forgot-password a:hover {
  color: #0eacf5;
  text-decoration: underline;
}
.file-upload-section {
  margin: 15px 0;
  width: 100%;
}
.file-upload-container {
  border: 2px dashed #ddd;
  border-radius: 8px;
  padding: 15px;
  text-align: center;
  transition: border-color 0.3s ease;
  cursor: pointer;
  position: relative;
  min-height: 60px; /* Touch-friendly */
}
.file-upload-container:hover {
  border-color: #4CAF50;
}
.file-upload-container.dragover {
  border-color: #4CAF50;
  background-color: #f0f8ff;
}
.file-upload-container.error {
  border-color: #ff4444;
  background-color: #fff1f1;
}
.file-upload-container.valid {
  border-color: #4CAF50;
}
.file-upload-input {
  display: none;
}
.file-upload-label {
  display: block;
  font-size: 14px;
  color: #333;
  margin-bottom: 5px;
  font-weight: 500;
}
.file-upload-text {
  color: #888;
  font-size: 12px;
  margin-top: 5px;
}
.file-preview {
  margin-top: 10px;
  display: none;
}
.file-preview img {
  max-width: 180px;
  max-height: 120px;
  border-radius: 4px;
  border: 1px solid #ddd;
}
.file-info {
  margin-top: 10px;
  padding: 8px;
  background-color: #f8f9fa;
  border-radius: 4px;
  font-size: 12px;
  color: #666;
  display: none;
}
.remove-file {
  background: #ff4444;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  margin-top: 5px;
  min-height: 32px; /* Touch-friendly */
}
.remove-file:hover {
  background: #cc0000;
}
.upload-icon {
  font-size: 20px;
  color: #4CAF50;
  margin-bottom: 8px;
}
.hidden {
  display: none;
}
@keyframes fadeIn {
  0% { opacity: 0; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes fadeInCentered {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
#loader {
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  z-index: 9999;
}
#loader.hidden {
  display: none;
}
.dot {
  width: 10px;
  height: 10px;
  margin: 5px;
  background-color: #0ea5e9;
  border-radius: 50%;
  animation: blink 1.2s infinite ease-in-out both;
}
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }
.dot:nth-child(4) { animation-delay: 0.6s; }
.dot:nth-child(5) { animation-delay: 0.8s; }
@keyframes blink {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}
.verification-section {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  padding: 30px;
  text-align: center;
  z-index: 1001;
  max-width: 400px;
  width: 90%;
  animation: fadeIn 0.5s ease-out;
}
.verification-section.hidden {
  display: none;
}
.verification-message {
  color: #666;
  font-size: 1rem;
  margin-bottom: 15px;
  line-height: 1.4;
}
#resend-verification {
  width: 100%;
  padding: 12px;
  background-color: #0ea5e9;
  color: #fff;
  border: none;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
  min-height: 48px;
}
#resend-verification:hover:not(:disabled) {
  background-color: #0eacf5;
  transform: translateY(-2px);
}
#resend-verification:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
#signup-verification-content {
  padding: 20px;
  text-align: center;
}
#signup-verification-content.hidden {
  display: none;
}
.verification-state-title {
  color: #333;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.verification-state-description {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 20px;
}
.verification-state-message {
  color: #666;
  font-size: 1rem;
  margin-bottom: 15px;
  line-height: 1.4;
}
.go-to-login-btn {
  background-color: #0ea5e9;
  color: #fff;
  border: none;
  border-radius: 25px;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 15px;
  min-height: 48px;
}
.go-to-login-btn:hover {
  background-color: #0eacf5;
  transform: translateY(-2px);
}

/* Enhanced Responsive Design: Base adjustments for all elements using viewport units and clamp where possible */
* {
  box-sizing: border-box;
}

/* Tablet and below (max-width: 1024px) */
@media (max-width: 1024px) {
  .container {
    flex-direction: column;
    gap: 20px;
  }
  .logo-container {
    max-width: 200px;
  }
  .logo {
    width: 150px;
    height: 150px;
  }
  .modal {
    max-width: 90%;
    padding: 30px;
  }
  #signup-modal.modal,
  #forgot-password-modal.modal {
    max-width: 90%;
    width: 90%;
    padding: 30px;
  }
  .location-group {
    flex-wrap: wrap;
  }
  .input-label {
    margin-right: 0;
  }
  .group {
    max-width: 100%;
  }
  .banner {
    max-height: 100px;
  }
  .benefits {
    margin: 15px 0;
  }
  .file-upload-section {
    margin: 12px 0;
  }
  .verification-section {
    max-width: 90%;
    padding: 25px;
  }
}

/* Mobile Large (max-width: 768px) */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }
  .container {
    flex-direction: column;
    align-items: center;
    padding: 10px;
    gap: 15px;
  }
  .logo-container {
    margin-bottom: 20px;
  }
  .modal {
    max-width: 95%;
    margin: 0 auto;
    padding: 25px;
  }
  #signup-modal.modal,
  #forgot-password-modal.modal {
    max-width: 95%;
    width: 95%;
    max-height: 85vh;
    padding: 20px;
  }
  .logo {
    width: 120px;
    height: 120px;
  }
  .title {
    font-size: 1.5rem;
  }
  .description {
    font-size: 0.95rem;
  }
  .location-group {
    flex-direction: column;
    gap: 5px;
  }
  .location-field {
    min-width: 100%;
  }
  .input-label {
    margin-right: 0;
  }
  .toggle-password {
    right: 0.5rem;
    font-size: 0.8rem;
    width: 20px;
    height: 20px;
  }
  .group {
    margin: 8px auto;
    min-height: 75px; /* Adjust for mobile */
  }
  #signup-modal .group {
    max-width: 100%;
  }
  .file-upload-container {
    padding: 12px;
    min-height: 70px;
  }
  .file-preview img {
    max-width: 140px;
    max-height: 100px;
  }
  .error-summary {
    padding: 12px;
    font-size: 13px;
  }
  .forgot-password {
    margin-top: 8px;
  }
  .verification-section {
    max-width: 95%;
    padding: 20px;
  }
  .verification-state-title {
    font-size: 1.5rem;
  }
  #resend-verification,
  .go-to-login-btn {
    padding: 12px;
    font-size: 0.95rem;
    min-height: 48px;
  }
}

/* Mobile Medium (max-width: 600px) */
@media (max-width: 600px) {
  .container {
    gap: 10px;
    padding: 5px;
  }
  .logo-container {
    max-width: 150px;
  }
  .logo {
    width: 100px;
    height: 100px;
    padding: 5px;
  }
  .modal {
    padding: 20px;
  }
  #signup-modal.modal,
  #forgot-password-modal.modal {
    padding: 15px;
    max-height: 90vh;
  }
  .group {
    margin-bottom: 15px;
    min-height: 70px;
  }
  .file-upload-section {
    margin: 12px 0;
  }
  .file-upload-container {
    padding: 10px;
    min-height: 65px;
  }
  .banner {
    max-height: 80px;
  }
  .title {
    margin-bottom: 15px;
  }
  .description {
    margin-bottom: 20px;
  }
  .benefits {
    margin: 15px 0;
  }
  .error-message {
    bottom: -1.70rem;
    font-size: 11px;
  }
  .valid-icon {
    right: 0.8rem;
    font-size: 0.8rem;
  }
  #loader .dot {
    width: 8px;
    height: 8px;
    margin: 3px;
  }
}

/* Mobile Small (max-width: 480px) */
@media (max-width: 480px) {
  body {
    padding: 5px;
  }
  .container {
    gap: 10px;
    padding: 5px;
  }
  .logo {
    width: 100px;
    height: 100px;
    padding: 5px;
  }
  .logo-text {
    font-size: 18px;
  }
  .title {
    font-size: 1.3rem;
  }
  .description {
    font-size: 0.85rem;
  }
  .input-label {
    font-size: 13px;
  }
  .input,
  .input-login {
    height: 48px; /* Touch-friendly */
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 0 45px 0 12px; /* Adjust for mobile toggle */
  }
  .toggle-password {
    right: 0.3rem;
    width: 24px;
    height: 24px;
    font-size: 1rem;
  }
  .group {
    margin: 6px auto;
    min-height: 80px;
  }
  .file-upload-container {
    padding: 10px;
    min-height: 60px;
  }
  .file-preview img {
    max-width: 120px;
    max-height: 80px;
  }
  .upgrade-btn,
  .cancel-btn {
    padding: 14px;
    font-size: 1rem;
    min-height: 52px; /* Extra touch-friendly */
  }
  .verification-section {
    max-width: 95%;
    width: 95%;
    padding: 20px;
  }
  .verification-state-title {
    font-size: 1.5rem;
  }
  .go-to-login-btn {
    padding: 14px 20px;
    min-height: 52px;
  }
  .remember-me {
    font-size: 0.85rem;
    gap: 6px;
  }
  .remember-me input[type="checkbox"] {
    min-height: 18px;
    min-width: 18px;
  }
  .file-upload-label {
    font-size: 13px;
  }
  .file-upload-text {
    font-size: 11px;
  }
  .remove-file {
    padding: 6px 12px;
    font-size: 11px;
    min-height: 34px;
  }
  .upload-icon {
    font-size: 18px;
  }
}

/* Landscape orientation adjustments for small screens */
@media (max-height: 600px) and (orientation: landscape) {
  .modal {
    max-height: 95vh;
    padding: 20px;
  }
  #signup-modal.modal {
    max-height: 95vh;
    padding: 15px;
  }
  .group {
    min-height: 70px;
    margin-bottom: 12px;
  }
  .file-upload-container {
    min-height: 55px;
    padding: 8px;
  }
  .verification-section {
    max-height: 95vh;
    padding: 15px;
  }
  .title,
  .verification-state-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
  }
  .description,
  .verification-state-description {
    font-size: 0.8rem;
    margin-bottom: 15px;
  }
}

/* Extra small screens and high-density displays (e.g., foldables or very small mobiles, max-width: 360px) */
@media (max-width: 360px) {
  body {
    padding: 3px;
  }
  .container {
    gap: 8px;
    padding: 3px;
  }
  .logo {
    width: 80px;
    height: 80px;
    padding: 3px;
  }
  .logo-container {
    max-width: 120px;
  }
  .logo-text {
    font-size: 16px;
  }
  .modal,
  #signup-modal.modal,
  #forgot-password-modal.modal {
    padding: 12px;
  }
  .group {
    margin-bottom: 12px;
    min-height: 75px;
  }
  .input-label {
    font-size: 12px;
    margin-bottom: 6px;
  }
  .input,
  .input-login {
    height: 44px;
    padding: 0 40px 0 10px;
  }
  .toggle-password {
    right: 0.2rem;
    width: 20px;
    height: 20px;
  }
  .error-message {
    font-size: 10px;
    bottom: -1.5rem;
  }
  .upgrade-btn,
  .cancel-btn,
  #resend-verification,
  .go-to-login-btn {
    padding: 12px;
    min-height: 48px;
    font-size: 0.95rem;
  }
  .file-upload-container {
    padding: 8px;
    min-height: 55px;
  }
  .file-preview img {
    max-width: 100px;
    max-height: 70px;
  }
  .verification-section {
    padding: 15px;
  }
  .verification-state-title {
    font-size: 1.3rem;
  }
  .verification-message,
  .verification-state-message {
    font-size: 0.9rem;
  }
}

/* Print styles for completeness (though not mobile-specific) */
@media print {
  body {
    background: none;
    padding: 0;
  }
  .modal,
  .container {
    max-width: none;
    box-shadow: none;
  }
  .hidden {
    display: none !important;
  }
}