/* ----- RESET & BASE ----- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: #f8f7f4;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
  padding: 2rem 0;
}

/* ----- ANIMATED BACKGROUND ----- */
.auth-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.3;
  animation: floatOrb 20s infinite alternate ease-in-out;
}

.auth-orb1 {
  width: 600px;
  height: 600px;
  background: #ffb347;
  top: -20%;
  left: -15%;
  animation-delay: 0s;
}

.auth-orb2 {
  width: 500px;
  height: 500px;
  background: #ff6b6b;
  bottom: -20%;
  right: -15%;
  animation-delay: -7s;
}

.auth-orb3 {
  width: 350px;
  height: 350px;
  background: #4ecdc4;
  top: 40%;
  right: 5%;
  animation-delay: -14s;
}

@keyframes floatOrb {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(40px, -50px) scale(1.3);
  }
}

/* ----- BACK BUTTON ----- */
.back-btn {
  position: fixed;
  top: 2rem;
  left: 2rem;
  z-index: 10;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1c1c1e;
  text-decoration: none;
  font-size: 1.3rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.95);
  transform: translateX(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

/* ----- MAIN CONTAINER ----- */
.auth-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 500px;
  padding: 2rem;
  animation: slideUp 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 40px;
  padding: 2.5rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: transform 0.3s ease;
}

.auth-card:hover {
  transform: translateY(-2px);
}

/* ----- LOGO ----- */
.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-decoration: none;
  font-size: 2rem;
  font-weight: 700;
  color: #1c1c1e;
  margin-bottom: 0.5rem;
  transition: transform 0.3s ease;
}

.auth-logo:hover {
  transform: scale(1.02);
}

.auth-logo img {
  height: 45px;
  width: auto;
}

.auth-logo span {
  color: #e4572e;
}

.auth-subtitle {
  text-align: center;
  color: #6e6e73;
  font-size: 0.95rem;
  margin-bottom: 2rem;
  font-weight: 400;
}

/* ----- FORM ROW (First & Last Name) ----- */
.form-row {
  display: flex;
  gap: 1rem;
}

.form-group.half {
  flex: 1;
}

/* ----- FORM ----- */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1c1c1e;
  letter-spacing: -0.01em;
}

.form-group .input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.form-group .input-wrapper i {
  position: absolute;
  left: 1rem;
  color: #8e8e93;
  font-size: 1.1rem;
  transition: color 0.3s ease;
  z-index: 1;
}

.form-group input {
  width: 100%;
  padding: 0.9rem 1rem 0.9rem 3rem;
  border: 2px solid #e2e0d8;
  border-radius: 16px;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  background: rgba(255, 255, 255, 0.6);
  transition: all 0.3s ease;
  color: #1c1c1e;
  outline: none;
}

.form-group input:focus {
  border-color: #e4572e;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 4px rgba(228, 87, 46, 0.1);
}

.form-group input:focus ~ i,
.form-group input:focus + i {
  color: #e4572e;
}

.form-group input::placeholder {
  color: #aeaeb2;
  font-weight: 400;
}

/* ----- PASSWORD TOGGLE ----- */
.password-toggle {
  position: absolute;
  right: 1rem;
  background: none;
  border: none;
  color: #8e8e93;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.3rem;
  transition: color 0.3s ease;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover {
  color: #1c1c1e;
}

.password-toggle:focus {
  outline: none;
}

/* ----- PASSWORD REQUIREMENTS ----- */
.password-requirements {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.3rem;
  font-size: 0.8rem;
}

.req-item {
  color: #8e8e93;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.req-item.valid {
  color: #34c759;
}

.req-item.invalid {
  color: #e4572e;
}

/* ----- FORM OPTIONS ----- */
.form-options {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  font-size: 0.9rem;
  margin-top: 0.2rem;
}

.form-options label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #4a4a4e;
  cursor: pointer;
  font-weight: 400;
}

.form-options input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: #e4572e;
  cursor: pointer;
  border-radius: 4px;
}

.form-options a {
  color: #e4572e;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.form-options a:hover {
  color: #c43d1a;
  text-decoration: underline;
}

/* ----- SUBMIT BUTTON ----- */
.auth-btn {
  width: 100%;
  padding: 1rem;
  background: #1c1c1e;
  color: white;
  border: none;
  border-radius: 16px;
  font-size: 1.05rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  position: relative;
  overflow: hidden;
}

.auth-btn:hover {
  background: #e4572e;
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(228, 87, 46, 0.3);
}

.auth-btn:active {
  transform: translateY(0);
}

.auth-btn i {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.auth-btn:hover i {
  transform: translateX(4px);
}

/* ----- DIVIDER ----- */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0 1.2rem;
  color: #8e8e93;
  font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e0d8;
}

/* ----- SOCIAL LOGIN ----- */
.social-login {
  display: flex;
  gap: 1rem;
}

.social-btn {
  flex: 1;
  padding: 0.8rem;
  border: 2px solid #e2e0d8;
  border-radius: 16px;
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: #1c1c1e;
}

.social-btn:hover {
  background: rgba(0, 0, 0, 0.02);
  border-color: #1c1c1e;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.social-btn i {
  font-size: 1.3rem;
}

.social-btn.google i {
  color: #ea4335;
}

.social-btn.facebook i {
  color: #1877f2;
}

.social-btn.apple i {
  color: #1c1c1e;
}

/* ----- FOOTER ----- */
.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  color: #6e6e73;
  font-size: 0.95rem;
}

.auth-footer a {
  color: #e4572e;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.auth-footer a:hover {
  color: #c43d1a;
  text-decoration: underline;
}

/* ----- ERROR STATES ----- */
.shake {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

.form-group.error input {
  border-color: #e4572e;
  background: rgba(228, 87, 46, 0.04);
}

.form-group.error .input-wrapper i {
  color: #e4572e;
}

.error-message {
  color: #e4572e;
  font-size: 0.8rem;
  margin-top: 0.2rem;
  display: none;
}

.form-group.error .error-message {
  display: block;
}

/* ----- LOADING STATE ----- */
.auth-btn.loading {
  pointer-events: none;
  opacity: 0.7;
}

.auth-btn.loading .btn-text {
  visibility: hidden;
}

.auth-btn.loading .btn-loader {
  display: block;
}

.btn-loader {
  display: none;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  position: absolute;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ----- SUCCESS STATE ----- */
.auth-btn.success {
  background: #34c759;
}

.auth-btn.success i {
  transform: scale(1.2);
}

/* ----- RESPONSIVE ----- */
@media (max-width: 520px) {
  .auth-container {
    padding: 1rem;
  }

  .auth-card {
    padding: 1.8rem;
    border-radius: 30px;
  }

  .auth-logo {
    font-size: 1.6rem;
  }

  .auth-logo img {
    height: 36px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .form-options {
    flex-direction: column;
    gap: 0.8rem;
    align-items: flex-start;
  }

  .social-login {
    flex-direction: column;
  }

  .back-btn {
    top: 1rem;
    left: 1rem;
    width: 42px;
    height: 42px;
    font-size: 1.1rem;
  }

  .password-requirements {
    font-size: 0.7rem;
  }
}