/* ===== CONSOLIDATED LOGIN PAGE STYLES ===== */
/* All login page CSS in one file for better organization */

/* ===================== BASE STYLES ===================== */

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body, html {
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #ffffff;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(17, 153, 142, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(56, 239, 125, 0.05) 0%, transparent 50%);
  color: #000000;
  height: 100%;
  overflow: hidden;
  line-height: 1.6;
}

/* ===================== LAYOUT & CONTAINER ===================== */

/* Centered Design */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  height: 100vh;
  width: 100%;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

/* Center Auth Form */
.auth-center {
  width: 100%;
  max-width: 550px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
}

/* ===================== BACKGROUND DECORATION ===================== */

.background-decoration {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.circle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(17, 153, 142, 0.12), rgba(56, 239, 125, 0.06));
  backdrop-filter: blur(80px);
  animation: float 20s infinite ease-in-out;
  border: 1.5px solid rgba(17, 153, 142, 0.15);
  box-shadow: 0 8px 32px rgba(17, 153, 142, 0.1);
}

.circle-1 {
  width: 400px;
  height: 400px;
  top: -100px;
  left: -100px;
  animation-delay: 0s;
}

.circle-2 {
  width: 300px;
  height: 300px;
  bottom: -50px;
  right: -50px;
  animation-delay: 7s;
}

.circle-3 {
  width: 250px;
  height: 250px;
  top: 50%;
  right: 10%;
  animation-delay: 14s;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) scale(1) rotate(0deg);
  }
  25% {
    transform: translate(25px, -25px) scale(1.08) rotate(3deg);
  }
  50% {
    transform: translate(-15px, 15px) scale(0.95) rotate(-2deg);
  }
  75% {
    transform: translate(20px, 10px) scale(1.05) rotate(2deg);
  }
}

/* ===================== LOGO ===================== */

.logo-container {
  text-align: center;
  position: relative;
  margin-bottom: 20px;
}

.logo-container img {
  pointer-events: auto;
}

.logo-above-login {
  filter: drop-shadow(0 2px 8px rgba(17, 153, 142, 0.2));
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), filter 0.3s ease;
  max-width: 220px !important;
  height: auto;
}

.logo-above-login:hover {
  transform: scale(1.03) translateY(-1px);
  filter: drop-shadow(0 4px 12px rgba(17, 153, 142, 0.3));
}

/* ===================== DECORATIVE ELEMENTS ===================== */

/* Leaf Accents */
.leaf-accent {
  position: absolute;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle at 30% 30%, rgba(17, 153, 142, 0.08), transparent);
  border-radius: 50% 0 50% 50%;
  opacity: 0.5;
  animation: leafFloat 15s infinite ease-in-out;
  pointer-events: none;
}

.leaf-1 {
  top: 10%;
  left: 5%;
  animation-delay: 3s;
}

.leaf-2 {
  bottom: 15%;
  right: 8%;
  transform: rotate(180deg);
  animation-delay: 8s;
}

@keyframes leafFloat {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(10deg);
  }
}

/* Agricultural Icons */
.agri-icon {
  position: absolute;
  width: 100px;
  height: 100px;
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 4px 12px rgba(17, 153, 142, 0.2));
}

.agri-icon:hover {
  opacity: 0.8;
  transform: scale(1.15) rotate(5deg);
  filter: drop-shadow(0 6px 20px rgba(17, 153, 142, 0.35));
}

.rice-icon {
  top: 12%;
  right: 8%;
  animation: float 20s infinite ease-in-out;
  animation-delay: 1s;
}

.pesticide-icon {
  bottom: 18%;
  left: 6%;
  animation: float 22s infinite ease-in-out;
  animation-delay: 6s;
}

.paddy-field-icon {
  top: 48%;
  left: 3%;
  animation: float 24s infinite ease-in-out;
  animation-delay: 11s;
}

/* ===================== FORM CONTAINER ===================== */

.login-section {
  background: #ffffff;
  backdrop-filter: blur(20px);
  padding: 30px 30px;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12),
              0 6px 16px rgba(17, 153, 142, 0.1),
              0 0 0 1px rgba(17, 153, 142, 0.15) inset;
  border: 2px solid rgba(17, 153, 142, 0.25);
  width: 100%;
  position: relative;
  max-height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.login-section:hover {
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.18),
              0 12px 28px rgba(17, 153, 142, 0.15),
              0 0 0 1px rgba(17, 153, 142, 0.2) inset;
  transform: translateY(-2px);
}

.login-section::before {
  /* content: '';\n  position: absolute; */
  top: 0;
  left: 14px;
  right: 14px;
  height: 4px;
  background: #11998e;
  border-radius: 20px 20px 0 0;
}

/* Decorative Corners */
.decorative-corner {
  position: absolute;
  width: 38px;
  height: 38px;
  border: 2.5px solid rgba(17, 153, 142, 0.6);
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  animation: cornerPulse 3s infinite ease-in-out;
}

@keyframes cornerPulse {
  0%, 100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

.corner-top-left {
  top: 15px;
  left: 15px;
  border-right: none;
  border-bottom: none;
  border-radius: 10px 0 0 0;
}

.corner-top-right {
  top: 15px;
  right: 15px;
  border-left: none;
  border-bottom: none;
  border-radius: 0 10px 0 0;
  animation-delay: 1.5s;
}

/* ===================== TYPOGRAPHY ===================== */

h1 {
  font-size: 30px;
  margin-bottom: 6px;
  text-align: center;
  color: #1a1a1a;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.5px;
}

.subtitle {
  text-align: center;
  color: #666;
  font-size: 13.5px;
  margin-bottom: 20px;
  font-weight: 400;
  letter-spacing: 0.3px;
  line-height: 1.4;
}

.highlight {
  color: #11998e;
  font-weight: 800;
  position: relative;
  display: inline-block;
}

/* ===================== TAB NAVIGATION ===================== */

.tab-container {
  margin-top: 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.tab-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.5vh;
}

.tab-btn {
  background-color: #ffffff;
  padding: 12px 30px;
  border-radius: 50px;
  border: 2px solid #e9ecef;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 14px;
  min-width: 130px;
  text-align: center;
  color: #495057;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.tab-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(17, 153, 142, 0.1);
  transition: width 0.4s ease, height 0.4s ease, top 0.4s ease, left 0.4s ease;
  transform: translate(-50%, -50%);
}

.tab-btn:hover::before {
  width: 300px;
  height: 300px;
}

.tab-btn:hover {
  background: #11998e;
  color: #ffffff;
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(17, 153, 142, 0.35);
}

.tab-btn.active {
  background: #11998e;
  color: white;
  border-color: transparent;
  box-shadow: 0 8px 25px rgba(17, 153, 142, 0.4),
              0 0 0 3px rgba(17, 153, 142, 0.1);
  transform: translateY(-2px) scale(1.02);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 3px;
  background: #ffffff;
  border-radius: 2px 2px 0 0;
}

/* Tab Content */
.tab-content {
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.tab-content.active {
  display: flex;
  flex-direction: column;
  opacity: 1;
  transform: translateY(0);
  height: 100%;
}

/* Custom scrollbar for tab content */
.tab-content::-webkit-scrollbar {
  width: 6px;
}

.tab-content::-webkit-scrollbar-track {
  background: rgba(17, 153, 142, 0.05);
  border-radius: 10px;
}

.tab-content::-webkit-scrollbar-thumb {
  background: rgba(17, 153, 142, 0.3);
  border-radius: 10px;
}

.tab-content::-webkit-scrollbar-thumb:hover {
  background: rgba(17, 153, 142, 0.5);
}

/* ===================== FORM ELEMENTS ===================== */

form {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 3px;
}

label {
  font-weight: 600;
  margin-top: 8px;
  margin-bottom: 5px;
  color: #333333;
  font-size: 13.5px;
  letter-spacing: 0.4px;
}

input, select, textarea {
  padding: 11px 13px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  margin-bottom: 5px;
  width: 100%;
  font-size: 14.5px;
  background-color: #fafafa;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  color: #000000;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: #11998e;
  box-shadow: 0 0 0 4px rgba(17, 153, 142, 0.1);
  background-color: #ffffff;
  transform: translateY(-1px);
}

/* Password Field Wrapper */
.password-field-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  margin-bottom: 5px;
}

.password-field-wrapper input {
  padding-right: 45px;
  margin-bottom: 0;
}

.eye-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
}

/* Password toggle button */
.password-field-wrapper .password-toggle {
  position: absolute;
  right: 12px;
  background: none !important;
  border: none !important;
  cursor: pointer;
  padding: 0 !important;
  margin: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999999;
  width: auto !important;
  height: auto !important;
  box-shadow: none !important;
  font-size: 18px;
  line-height: 1;
  transform: none !important;
  min-width: unset !important;
  max-width: unset !important;
  letter-spacing: normal !important;
  border-radius: 0 !important;
  align-self: auto !important;
}

.password-field-wrapper .password-toggle:hover {
  background: none !important;
  color: #666666 !important;
  box-shadow: none !important;
  transform: none !important;
}

.password-field-wrapper .password-toggle:active {
  color: #999999 !important;
  background: none !important;
  transform: none !important;
  box-shadow: none !important;
}

.password-field-wrapper .password-toggle:focus {
  outline: none;
  background: none !important;
  box-shadow: none !important;
}

/* Buttons */
button, button[type="submit"] {
  padding: 13px 35px;
  background: #11998e;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  cursor: pointer;
  font-weight: 600;
  align-self: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 6px 20px rgba(17, 153, 142, 0.35);
  letter-spacing: 0.4px;
  margin-top: 6px;
}

/* Signin button - centered on desktop only */
@media screen and (min-width: 769px) {
  #signin button:not(.password-toggle), #signin button[type="submit"]:not(.password-toggle) {
    align-self: center;
    width: auto;
    min-width: 220px;
    max-width: 320px;
  }
}

button:not(.password-toggle):hover {
  background: #0d7a72;
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(17, 153, 142, 0.6);
}

/* Form Layout */
.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 3px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.full-width {
  grid-column: 1 / -1;
}

/* Form Cards (Admin/Customer forms) */
.form-card {
  padding: 0 0 20px 0;
  margin: 0;
  width: 100%;
}

.form-card[style*="display: none"] {
  display: none !important;
}

.form-card[style*="display: block"] {
  display: block !important;
  width: 100%;
}

/* ===================== SIGNIN TAB ===================== */

#signin {
  overflow: visible;
}

/* ===================== SIGNUP TAB ===================== */

#signup {
  max-height: 65vh;
  overflow-y: auto;
  overflow-x: hidden;
  /* padding: 0 0 110px 0; */
  margin: 0;
  background: transparent;
  width: 100%;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(17, 153, 142, 0.3) transparent;
}

#signup::-webkit-scrollbar {
  width: 6px;
}

#signup::-webkit-scrollbar-track {
  background: transparent;
}

#signup::-webkit-scrollbar-thumb {
  background-color: rgba(17, 153, 142, 0.3);
  border-radius: 3px;
}

#signup::-webkit-scrollbar-thumb:hover {
  background-color: rgba(17, 153, 142, 0.5);
}

/* Role selector */
#signup > label:first-of-type {
  font-size: 14px;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 6px;
  color: #333333;
  display: block;
}

#signup-role {
  width: 100%;
  padding: 12px;
  border: 2px solid #d0d0d0;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 14px;
  background: #ffffff;
  box-sizing: border-box;
}

/* Form cards proper alignment */
#admin-form, #customer-form {
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

#admin-form form, #customer-form form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
}

/* Signup form elements */
#signup label {
  font-size: 13px;
  font-weight: 600;
  margin-top: 12px;
  margin-bottom: 4px;
  color: #333333;
  display: block;
  width: 100%;
}

#signup input, 
#signup select, 
#signup textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #d0d0d0;
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 14px;
  background: #ffffff;
  box-sizing: border-box;
  transition: all 0.3s ease;
}

#signup input:focus, 
#signup select:focus, 
#signup textarea:focus {
  border-color: #11998e;
  box-shadow: 0 0 0 3px rgba(17, 153, 142, 0.1);
  outline: none;
}

/* Form row layout */
#signup .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 0;
  width: 100%;
  box-sizing: border-box;
}

#signup .form-group {
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
}

#signup .full-width {
  grid-column: 1 / -1;
  width: 100%;
}

/* Textarea specific */
#signup textarea {
  min-height: 80px;
  resize: vertical;
}

/* Submit buttons */
#signup button[type="submit"] {
  width: 100%;
  padding: 14px;
  background: #11998e;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  margin-top: 20px;
  margin-bottom: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

#signup button[type="submit"]:hover {
  background: #0d7a72;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(17, 153, 142, 0.3);
}

/* ===================== TOAST NOTIFICATIONS ===================== */

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 350px;
  pointer-events: none;
}

.toast {
  padding: 15px 45px 15px 15px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  font-size: 14px;
  color: #333;
  background-color: #fff;
  position: relative;
  overflow: hidden;
  margin-bottom: 10px;
  animation: slideInToast 0.3s ease-out forwards;
  border-left: 4px solid #ccc;
  word-wrap: break-word;
  pointer-events: auto;
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.4;
}

.toast.success {
  border-left-color: #000000;
}

.toast.info {
  border-left-color: #000000;
}

.toast.warning {
  border-left-color: #000000;
}

.toast.error {
  border-left-color: #000000;
}

.toast-close {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #666;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
  padding: 0;
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Arial, sans-serif;
}

.toast-close:hover {
  color: #333;
  background-color: rgba(0, 0, 0, 0.1);
}

.toast-close:focus {
  outline: 2px solid rgba(17, 153, 142, 0.5);
  outline-offset: 1px;
}

@keyframes slideInToast {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOutToast {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* ===================== RESPONSIVE STYLES ===================== */

/* ===== TABLET RESPONSIVE (769px - 1023px) ===== */
@media screen and (min-width: 769px) and (max-width: 1023px) {
  .auth-container {
    padding: 15px;
    height: 100vh;
  }

  .auth-center {
    max-width: 500px;
    max-height: calc(100vh - 40px);
  }

  .logo-container {
    margin-bottom: 18px;
  }

  .logo-above-login {
    max-width: 200px !important;
  }

  .login-section {
    padding: 28px 25px;
    border-radius: 20px;
    max-height: 100%;
  }

  h1 {
    font-size: 28px;
  }
  
  /* Adjust scrollable area for signup */
  #signup {
    max-height: 70vh;
  }
  
  .tab-content {
    max-height: 75vh;
  }
}

/* ===== MOBILE RESPONSIVE DESIGN (≤768px) ===== */
@media screen and (max-width: 768px) {
  body, html {
    background-color: #f5f5f5;
    overflow: hidden;
    height: 100vh;
  }

  .auth-container {
    flex-direction: column;
    height: 100vh;
    min-height: 100vh;
    box-shadow: none;
    background-color: #f5f5f5;
    overflow: hidden;
    position: relative;
    padding: 15px;
  }

  .auth-center {
    max-width: 100%;
    max-height: calc(100vh - 30px);
  }

  .logo-container {
    margin-bottom: 15px;
  }

  .logo-above-login {
    max-width: 180px !important;
  }

  .login-section {
    padding: 24px 20px;
    border-radius: 18px;
    max-height: 100%;
    overflow: hidden;
  }

  h1 {
    font-size: 26px;
    margin-bottom: 5px;
  }

  .subtitle {
    font-size: 13px;
    margin-bottom: 16px;
  }

  .background-decoration {
    position: fixed;
  }
  
  /* Scale down agricultural icons for mobile */
  .agri-icon {
    width: 50px;
    height: 50px;
    opacity: 0.3;
  }
  
  .rice-icon {
    top: 10%;
    right: 5%;
  }
  
  .pesticide-icon {
    bottom: 15%;
    left: 5%;
  }
  
  .paddy-field-icon {
    top: 45%;
    left: 2%;
  }

  .circle-1 {
    width: 250px;
    height: 250px;
    top: -50px;
    left: -50px;
  }

  .circle-2 {
    width: 200px;
    height: 200px;
    bottom: -30px;
    right: -30px;
  }

  .circle-3 {
    width: 180px;
    height: 180px;
    top: 40%;
    right: -20px;
  }

  .auth-center {
    max-width: 100%;
    padding: 0;
  }

  .logo-above-login {
    max-width: 200px !important;
    margin-bottom: 25px !important;
  }

  .login-section {
    padding: 25px;
    background: #ffffff;
    border-radius: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.06);
    margin: 0;
    width: 100%;
    position: relative;
    backdrop-filter: blur(20px);
    overflow: hidden;
  }

  .login-section::before {
    height: 4px;
    border-radius: 25px 25px 0 0;
  }
  
  /* Mobile Typography */
  h1 {
    font-size: 24px;
    text-align: center;
    margin-bottom: 10px;
    color: #333333;
    margin-top: 0;
    line-height: 1.3;
  }

  /* Mobile Tab Navigation */
  .tab-container {
    margin-top: 12px;
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .tab-content {
    overflow-y: auto;
    overflow-x: hidden;
    height: auto;
    min-height: 0;
    flex: 1;
  }

  .tab-content.active {
    display: flex;
    flex-direction: column;
  }

  .tab-nav {
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
    margin-top: 0.5vh;
  }

  .tab-btn {
    flex: 1;
    min-width: 110px;
    max-width: 140px;
    padding: 10px 16px;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: 50px;
  }

  .tab-btn.active {
    transform: translateY(-1px);
  }

  /* Mobile signin section */
  #signin {
    overflow-y: auto;
    overflow-x: hidden;
    height: auto;
    min-height: auto;
  }

  #signin input {
    font-size: 15px;
  }

  #signin button[type="submit"] {
    width: 100%;
    padding: 11px;
    font-size: 15px;
    margin-top: 8px;
  }

  /* Mobile signup adjustments */
  #signup {
    height: auto;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 20px;
  }

  /* Single column layout on mobile */
  #signup .form-row {
    grid-template-columns: 1fr;
    gap: 0;
    margin-bottom: 0;
    width: 100%;
  }

  #signup .form-group {
    width: 100%;
    margin-bottom: 0;
  }

  #signup input, 
  #signup select, 
  #signup textarea {
    width: 100%;
    padding: 11px;
    font-size: 15px;
    margin-bottom: 8px;
    box-sizing: border-box;
  }

  #signup label {
    font-size: 13px;
    margin-top: 6px;
    margin-bottom: 3px;
    width: 100%;
  }

  #signup textarea {
    min-height: 55px;
  }

  #signup button[type="submit"] {
    width: 100%;
    padding: 11px;
    font-size: 15px;
    margin-top: 12px;
    margin-bottom: 15px;
    box-sizing: border-box;
  }

  #signup-role {
    width: 100%;
    font-size: 15px;
    margin-bottom: 12px;
  }

  /* Mobile Form Layout */
  .form-row {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 4px;
  }

  /* Mobile Form Inputs */
  input, select, textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    border-radius: 12px;
    margin-bottom: 10px;
  }

  /* Mobile Button */
  button, button[type="submit"] {
    width: 100%;
    padding: 14px 22px;
    font-size: 16px;
    border-radius: 12px;
    margin-top: 18px;
    margin-bottom: 20px;
    min-width: unset;
  }

  /* Mobile Labels */
  label {
    font-size: 14px;
    margin-top: 8px;
    margin-bottom: 4px;
  }

  /* Mobile Toast Adjustments */
  .toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
  
  .toast {
    padding: 12px 40px 12px 12px;
    font-size: 13px;
    border-radius: 6px;
  }
  
  .toast-close {
    top: 5px!important;
    right: 10px;
    width: 22px;
    height: 22px;
    font-size: 18px;
  }
}

/* ===== SMALL MOBILE (≤480px) ===== */
@media screen and (max-width: 480px) {
  .auth-container {
    padding: 12px;
    height: 100vh;
  }

  .auth-center {
    max-height: calc(100vh - 24px);
  }

  .logo-container {
    margin-bottom: 12px;
  }

  .logo-above-login {
    max-width: 150px !important;
  }

  .login-section {
    padding: 20px 16px;
    border-radius: 16px;
    max-height: 100%;
  }

  h1 {
    font-size: 22px;
    margin-bottom: 4px;
  }

  .subtitle {
    font-size: 12px;
    margin-bottom: 14px;
  }

  /* Further scale down agricultural icons */
  .agri-icon {
    width: 40px;
    height: 40px;
    opacity: 0.25;
  }
  
  .rice-icon {
    top: 8%;
    right: 3%;
  }
  
  .pesticide-icon {
    bottom: 12%;
    left: 3%;
  }
  
  .paddy-field-icon {
    display: none;
  }

  /* Small mobile signup adjustments */
  #signup {
    height: auto;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 20px;
  }

  #signup input, 
  #signup select, 
  #signup textarea {
    width: 100%;
    padding: 10px;
    font-size: 14.5px;
    margin-bottom: 6px;
    box-sizing: border-box;
  }

  #signup label {
    font-size: 12.5px;
    margin-top: 5px;
    margin-bottom: 3px;
    width: 100%;
  }

  #signup textarea {
    min-height: 50px;
  }

  #signup button[type="submit"] {
    width: 100%;
    padding: 10px;
    font-size: 14.5px;
    margin-top: 10px;
    margin-bottom: 15px;
    box-sizing: border-box;
  }

  #signup-role {
    width: 100%;
    padding: 10px;
    font-size: 14.5px;
  }

  #signin input {
    font-size: 14.5px;
  }

  #signin button[type="submit\"] {
    width: 100%;
    font-size: 14.5px;
    padding: 10px;
  }

  .tab-btn {
    min-width: 100px;
    padding: 9px 14px;
    font-size: 12.5px;
  }
  
  input, select, textarea {
    padding: 10px 12px;
    font-size: 14.5px;
    margin-bottom: 5px;
  }

  label {
    font-size: 12.5px;
    margin-top: 5px;
    margin-bottom: 3px;
  }

  /* Small mobile toast adjustments */
  .toast-container {
    top: 5px;
    right: 5px;
    left: 5px;
  }
  
  .toast {
    padding: 10px 35px 10px 10px;
    font-size: 12px;
  }
  
  .toast-close {
    right: 8px;
    width: 20px;
    height: 20px;
    font-size: 16px;
  }
}

/* ===== LANDSCAPE MOBILE ORIENTATION ===== */
@media screen and (max-width: 768px) and (orientation: landscape) {
  body, html {
    overflow: hidden;
    height: 100vh;
  }

  .auth-container {
    flex-direction: row;
    height: 100vh;
    min-height: 100vh;
    padding: 12px;
  }

  .auth-center {
    max-height: calc(100vh - 24px);
  }

  .logo-container {
    margin-bottom: 10px;
  }

  .logo-above-login {
    max-width: 120px !important;
  }

  .login-section {
    padding: 18px 16px;
    max-height: 100%;
  }

  h1 {
    font-size: 20px;
  }

  .subtitle {
    font-size: 11px;
    margin-bottom: 12px;
  }

  /* Landscape signup adjustments */
  #signup {
    height: auto;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 20px;
  }

  /* Two column layout in landscape if space allows */
  #signup .form-row {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 0;
    width: 100%;
  }

  #signup .form-group {
    width: 100%;
  }

  #signup input, 
  #signup select, 
  #signup textarea {
    width: 100%;
    padding: 8px;
    font-size: 14px;
    margin-bottom: 6px;
    box-sizing: border-box;
  }

  #signup label {
    font-size: 12px;
    margin-top: 4px;
    margin-bottom: 2px;
    width: 100%;
  }

  #signup textarea {
    min-height: 50px;
  }

  #signup button[type="submit"] {
    width: 100%;
    padding: 8px;
    font-size: 14px;
    margin-top: 10px;
    margin-bottom: 20px;
    box-sizing: border-box;
  }

  #signup-role {
    width: 100%;
    padding: 8px;
    font-size: 14px;
  }

  /* General landscape form adjustments */
  .form-row {
    gap: 8px;
  }
  
  input, select, textarea {
    padding: 8px 10px;
    font-size: 14px;
    margin-bottom: 5px;
  }
  
  label {
    font-size: 12px;
    margin-top: 5px;
    margin-bottom: 2px;
  }
  
  button, button[type="submit"] {
    padding: 10px 15px;
    margin-top: 10px;
    margin-bottom: 20px;
  }

  h1 {
    font-size: 20px;
    margin-bottom: 6px;
  }

  .tab-container {
    margin-top: 8px;
  }

  .tab-nav {
    margin-bottom: 12px;
    margin-top: 1vh;
  }

  .tab-btn {
    padding: 8px 14px;
    font-size: 12px;
  }
}

/* ===== ACCESSIBILITY & PERFORMANCE ===== */

/* Focus States for Accessibility */
input:focus, select:focus, textarea:focus, button:focus {
  outline: 3px solid rgba(17, 153, 142, 0.3);
  outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print Styles */
@media print {
  .auth-container {
    box-shadow: none;
    background: white;
  }
  
  .auth-right {
    display: none;
  }
  
  .auth-left {
    width: 100%;
    padding: 20px;
  }
}
