/* Import theme system */
@import url('theme.css');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-image: linear-gradient(135deg,
      rgba(46, 125, 50, 0.15) 0%,
      rgba(27, 94, 32, 0.25) 100%),
    url("images/registration.avif");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow-x: hidden;
  padding: 20px 0;
  color: var(--text-primary, #333);
}

/* Animated background particles */
body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 80%,
      rgba(46, 125, 50, 0.1) 0%,
      transparent 50%),
    radial-gradient(circle at 80% 20%,
      rgba(27, 94, 32, 0.08) 0%,
      transparent 50%),
    radial-gradient(circle at 40% 40%,
      rgba(46, 125, 50, 0.05) 0%,
      transparent 50%);
  animation: float 20s ease-in-out infinite;
  pointer-events: none;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }

  33% {
    transform: translateY(-10px) rotate(1deg);
  }

  66% {
    transform: translateY(5px) rotate(-1deg);
  }
}

/* Form container styling */
.form-container {
  background: var(--bg-primary, rgba(255, 255, 255, 0.98));
  backdrop-filter: blur(15px);
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 20px 40px var(--shadow-medium, rgba(0, 0, 0, 0.15)),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  width: 100%;
  max-width: 550px;
  position: relative;
  transform: translateY(0);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(46, 125, 50, 0.1);
  color: var(--text-primary, #333);
}

.form-container:hover {
  transform: translateY(-5px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.15);
}

.form-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #2e7d32, #1b5e20, #2e7d32);
  border-radius: 20px 20px 0 0;
  background-size: 200% 100%;
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {

  0%,
  100% {
    background-position: -200% 0;
  }

  50% {
    background-position: 200% 0;
  }
}

/* Logo/Brand area */
.brand-section {
  text-align: center;
  margin-bottom: 35px;
}

.brand-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #2e7d32, #1b5e20);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
  box-shadow: 0 10px 25px rgba(46, 125, 50, 0.3);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

.brand-icon i {
  color: white;
  font-size: 28px;
}

/* Heading styling */
.form-container h2 {
  text-align: center;
  margin: 0;
  color: #1b5e20;
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #2e7d32, #1b5e20);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.form-subtitle {
  text-align: center;
  color: #666;
  font-size: 14px;
  margin-top: 8px;
  margin-bottom: 30px;
}

/* Form elements styling */
.form-container form {
  display: flex;
  flex-direction: column;
}

.input-group {
  position: relative;
  margin-bottom: 20px;
}

.input-group i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #2e7d32;
  font-size: 16px;
  z-index: 1;
}

.form-container select,
.form-container input[type="text"],
.form-container input[type="email"],
.form-container input[type="password"] {
  padding: 15px 15px 15px 45px;
  border: 2px solid #e8f5e8;
  border-radius: 12px;
  font-size: 16px;
  width: 100%;
  background: var(--bg-secondary, rgba(248, 250, 248, 0.8));
  color: var(--text-primary, #333);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  appearance: none;
}

.form-container select {
  cursor: pointer;
  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 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 40px;
}

.form-container select:focus,
.form-container input[type="text"]:focus,
.form-container input[type="email"]:focus,
.form-container input[type="password"]:focus {
  border-color: #2e7d32;
  background: var(--bg-primary, white);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1),
    0 8px 20px rgba(46, 125, 50, 0.1);
  transform: translateY(-2px);
}

.form-container input::placeholder {
  color: var(--text-muted, #999);
  font-size: 15px;
}

.form-container select option {
  color: var(--text-primary, #333);
  background: var(--bg-primary, white);
  padding: 10px;
}

/* Password strength indicator */
.password-strength {
  height: 3px;
  background: #e0e0e0;
  border-radius: 3px;
  margin-top: 5px;
  overflow: hidden;
}

.strength-bar {
  height: 100%;
  width: 0%;
  transition: all 0.3s ease;
  border-radius: 3px;
}

.strength-weak {
  background: #f44336;
  width: 25%;
}

.strength-fair {
  background: #ff9800;
  width: 50%;
}

.strength-good {
  background: #4caf50;
  width: 75%;
}

.strength-strong {
  background: #2e7d32;
  width: 100%;
}

.strength-text {
  font-size: 12px;
  margin-top: 5px;
  color: #666;
}

.password-toggle {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: none !important;
  border: none !important;
  color: #666;
  cursor: pointer;
  padding: 0 !important;
  border-radius: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover,
.password-toggle:focus,
.password-toggle:active {
  background: none !important;
  outline: none !important;
  box-shadow: none !important;
}

/* Button styling */
.form-container button[type="submit"] {
  padding: 16px;
  background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 20px rgba(46, 125, 50, 0.3);
  margin: 25px 0;
}

.form-container button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(46, 125, 50, 0.4);
}

.form-container button[type="submit"]:active {
  transform: translateY(0);
}

.form-container button[type="submit"]::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.2),
      transparent);
  transition: left 0.5s;
}

.form-container button[type="submit"]:hover::before {
  left: 100%;
}

/* Loading state */
.loading {
  pointer-events: none;
  opacity: 0.7;
}

.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid transparent;
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Registration link */
.form-container p {
  text-align: center;
  margin: 0;
  font-size: 15px;
  color: #666;
}

.form-container a {
  color: #2e7d32;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.form-container a:hover {
  color: #1b5e20;
  text-decoration: underline;
}

/* Success/Error states */
.success {
  border-color: #4caf50 !important;
  background-color: rgba(76, 175, 80, 0.05) !important;
}

.error {
  border-color: #f44336 !important;
  background-color: rgba(244, 67, 54, 0.05) !important;
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px);
  }

  75% {
    transform: translateX(5px);
  }
}

/* Role icons */
.role-buyer {
  color: #2196f3;
}

.role-farmer {
  color: #4caf50;
}

.role-equipment {
  color: #ff9800;
}

.role-grocery {
  color: #9c27b0;
}

/* Form progress indicator */
.form-progress {
  display: flex;
  justify-content: space-between;
  margin-bottom: 25px;
  padding: 0 10px;
}

.progress-step {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e0e0e0;
  transition: all 0.3s ease;
}

.progress-step.active {
  background: #2e7d32;
  transform: scale(1.2);
}

.progress-step.completed {
  background: #4caf50;
}

/* Responsive design */
@media (max-width: 500px) {
  .form-container {
    padding: 30px 25px;
    margin: 20px;
    border-radius: 16px;
    max-width: 100%;
  }

  .brand-icon {
    width: 50px;
    height: 50px;
  }

  .brand-icon i {
    font-size: 24px;
  }

  .form-container h2 {
    font-size: 24px;
  }

  .form-container select,
  .form-container input[type="text"],
  .form-container input[type="email"],
  .form-container input[type="password"] {
    font-size: 16px;
  }
}

@media (max-height: 700px) {
  body {
    padding: 10px 0;
  }

  .form-container {
    margin: 10px;
    padding: 25px 30px;
  }

  .brand-section {
    margin-bottom: 25px;
  }
}