* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  background: #f7f3f8;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  animation: rotate 20s linear infinite;
}

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.container {
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
  margin: 40px auto;
}

.form-box {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  padding: 40px 35px;
  border-radius: 20px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transform: translateY(20px);
  opacity: 0;
  animation: slideUp 0.6s ease forwards;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes slideUp {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.form-box h1 {
  font-size: 28px;
  color: #333;
  text-align: center;
  margin-bottom: 30px;
  font-weight: 600;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.error-message,
.success-message {
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  animation: shake 0.5s ease;
}

.error-message {
  background: linear-gradient(135deg, #ff6b6b, #ee5a52);
  color: white;
}

.success-message {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: white;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

.input-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 25px;
}

.input-box {
  position: relative;
  margin-bottom: 25px;
  transition: all 0.3s ease;
}

.input-box input {
  width: 100%;
  height: 55px;
  background: rgba(255, 255, 255, 0.8);
  border: 2px solid rgba(102, 126, 234, 0.2);
  border-radius: 15px;
  font-size: 16px;
  color: #333;
  padding: 0 50px 0 20px;
  outline: none;
  transition: all 0.3s ease;
}

.input-box input:focus {
  border-color: #667eea;
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  transform: translateY(-2px);
}

.input-box input::placeholder {
  color: #999;
  font-weight: 400;
}

.input-box i {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: #667eea;
  cursor: pointer;
  transition: all 0.3s ease;
}

.input-box i:not([id*="toggle"]) {
  cursor: default;
}

.file-upload-box {
  position: relative;
  border: 2px dashed rgba(102, 126, 234, 0.3);
  border-radius: 15px;
  padding: 25px;
  text-align: center;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.5);
  margin-bottom: 25px;
  cursor: pointer;
}

.file-upload-box:hover {
  border-color: #667eea;
  background: rgba(102, 126, 234, 0.05);
  transform: translateY(-2px);
}

.file-upload-box.file-selected {
  border-color: #27ae60;
  background: rgba(46, 204, 113, 0.05);
}

.file-upload-box input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  top: 0;
  left: 0;
}

.file-upload-content {
  pointer-events: none;
}

.file-upload-icon {
  font-size: 32px;
  color: #667eea;
  margin-bottom: 10px;
  transition: all 0.3s ease;
}

.file-upload-text {
  color: #666;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 5px;
}

.file-upload-subtext {
  color: #999;
  font-size: 12px;
}

.btn {
  width: 100%;
  height: 55px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border: none;
  border-radius: 15px;
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  margin-bottom: 25px;
}

.btn::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 ease;
}

.btn:hover::before {
  left: 100%;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.btn:active {
  transform: translateY(0);
}

.btn.loading {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

.login-link,
.home-link {
  text-align: center;
  margin-top: 15px;
}

.login-link p,
.home-link a {
  color: #666;
  font-size: 14px;
  text-decoration: none;
}

.login-link a,
.home-link a {
  color: #667eea;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}

.login-link a:hover,
.home-link a:hover {
  color: #764ba2;
  text-decoration: underline;
}

.home-link {
  padding-top: 15px;
  border-top: 1px solid rgba(102, 126, 234, 0.2);
}

.home-link a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Password Strength Indicator */
.password-strength {
  height: 4px;
  background: #f0f0f0;
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.password-strength-bar {
  height: 100%;
  width: 0%;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.strength-weak {
  background: #ff6b6b;
  width: 33%;
}
.strength-medium {
  background: #ffa500;
  width: 66%;
}
.strength-strong {
  background: #27ae60;
  width: 100%;
}

/* Validation Indicators */
.input-box.valid input {
  border-color: #27ae60;
}

.input-box.invalid input {
  border-color: #e74c3c;
}

.validation-message {
  font-size: 12px;
  margin-top: 8px;
  transition: all 0.3s ease;
}

.validation-message.valid {
  color: #27ae60;
}

.validation-message.invalid {
  color: #e74c3c;
}

/* Loading Animation */
.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 8px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Progress Indicator */
.progress-bar {
  height: 4px;
  background: #f0f0f0;
  border-radius: 2px;
  margin-bottom: 30px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
}

/* Responsive Design */
@media (max-width: 640px) {
  .container {
    max-width: 100%;
  }

  .form-box {
    padding: 30px 25px;
    margin: 10px;
  }

  .input-group {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .form-box h1 {
    font-size: 24px;
  }

  .input-box input {
    height: 50px;
    font-size: 15px;
  }

  .btn {
    height: 50px;
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  html,
  body {
    height: auto !important;
    overflow: auto !important;
    max-width: 100vw;
  }
  .container {
    max-width: 100vw;
    width: 100vw;
    padding: 0 8px;
    overflow-x: hidden;
  }
  .form-box {
    max-height: none !important;
    overflow-y: visible !important;
  }

  .form-box h1 {
    font-size: 20px;
    margin-bottom: 18px;
  }

  .input-group {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .input-box input {
    height: 44px;
    font-size: 14px;
    padding: 0 38px 0 12px;
    border-radius: 10px;
  }

  .input-box i {
    font-size: 16px;
    right: 12px;
  }

  .file-upload-box {
    padding: 15px;
    border-radius: 10px;
    font-size: 13px;
  }

  .btn {
    height: 44px;
    font-size: 15px;
    border-radius: 10px;
    margin-bottom: 18px;
  }

  .register-link,
  .login-link,
  .home-link {
    font-size: 13px;
    margin-top: 12px;
  }

  .home-link {
    padding-top: 10px;
  }

  .g-recaptcha {
    transform: scale(0.88);
    transform-origin: 0 0;
    margin-bottom: 10px;
  }
}
