* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  margin-top: -65px;
  font-family: 'Inter', 'Arial', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #009df9, #ffffff);
  color: #333;
  transition: background 0.3s ease, color 0.3s ease;
}

body[data-theme="dark"] {
  background: linear-gradient(135deg, #1a2a2a, #2a3a3a);
  color: #d9e1e6;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.background-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(0, 0, 0, 0.05) 10px, rgba(0, 0, 0, 0.05) 20px);
  opacity: 0.05;
  z-index: -1;
}

.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: inherit;
  cursor: pointer;
  transition: transform 0.2s;
}

.theme-toggle:hover {
  transform: scale(1.1);
}

.theme-icon {
  width: 1.5rem;
  height: 1.5rem;
}

header {
  text-align: center;
  margin: 2rem 0;
  animation: fade-in 1s ease-in-out;
}

.logo-container {
  margin-bottom: 1rem;
}

.logo {
  width: 120px;
  height: 40px;
}

header h1 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

header p {
  font-size: 1rem;
  opacity: 0.8;
}

.container {
  max-width: 400px;
  width: 100%;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 1rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  margin: 1rem;
  position: relative;
  animation: slide-up 0.6s ease-in-out;
}

body[data-theme="dark"] .container {
  background: rgba(20, 30, 30, 0.95);
}

.container::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(135deg, #006666, transparent);
  border-radius: 1rem;
  z-index: -1;
}

body[data-theme="dark"] .container::before {
  background: linear-gradient(135deg, #006666, #2a3a3a);
}

.form {
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.form.active {
  display: block;
  opacity: 1;
}

h2 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  text-align: center;
}

.input-group {
  position: relative;
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: translateY(10px);
  animation: fade-in-field 0.3s ease-in-out forwards;
}

.form.active .input-group:nth-child(1) { animation-delay: 0.1s; }
.form.active .input-group:nth-child(2) { animation-delay: 0.2s; }
.form.active .input-group:nth-child(3) { animation-delay: 0.3s; }
.form.active .input-group:nth-child(4) { animation-delay: 0.4s; }
.form.active .input-group:nth-child(5) { animation-delay: 0.5s; }

.input-label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
  color: #333;
}

.input-wrapper {
  position: relative;
}

.input-field {
  width: 100%;
  padding: 0.75rem 2.5rem;
  border: 1px solid #b0b0b0;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  background: #fff;
  color: #333;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.input-field:focus {
  border-color: #006666;
  box-shadow: 0 0 6px rgba(0, 102, 102, 0.2);
  outline: 2px solid #006666;
  outline-offset: 2px;
}

.input-field::placeholder {
  color: #666;
}

.input-icon, .toggle-password {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: #666;
}

.input-icon {
  left: 0.75rem;
}

.toggle-password {
  right: 0.75rem;
  cursor: pointer;
}

.password-container .input-field {
  padding-right: 3.5rem;
}

.input-wrapper.password-match::after {
  content: '✓';
  position: absolute;
  right: 2.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: #00a3a3;
  font-size: 1rem;
}

.generate-password {
  background: none;
  border: none;
  color: #006666;
  font-size: 0.85rem;
  margin-top: 0.5rem;
  cursor: pointer;
  text-decoration: underline;
}

.generate-password:hover {
  color: #008080;
}

[data-theme="dark"] .input-field,
[data-theme="dark"] .input-label,
[data-theme="dark"] .input-icon,
[data-theme="dark"] .toggle-password {
  background: #2a3a3a;
  color: #d9e6e6;
  border-color: #4a5a5a;
}

[data-theme="dark"] .input-field::placeholder {
  color: #a0b0b0;
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
}

.form-options label {
  display: flex;
  align-items: center;
}

.forgot-password,
.switch-form button {
  background: none;
  border: none;
  color: #006666;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.85rem;
}

.forgot-password:hover,
.switch-form button:hover {
  text-decoration: underline;
}

.forgot-password:focus,
.switch-form button:focus {
  outline: 2px solid #006666;
  outline-offset: 2px;
}

.btn {
  width: 100%;
  padding: 0.75rem;
  background: #006666;
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
  background: #008080;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 102, 102, 0.3);
}

.btn:focus {
  outline: 2px solid #006666;
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.social-login {
  margin-top: 1.5rem;
  text-align: center;
}

.social-login p {
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.social-buttons {
  display: flex;
  gap: 1rem;
}

.social-btn {
  flex: 1;
  padding: 0.75rem;
  border: none;
  border-radius: 0.5rem;
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-btn:hover {
  transform: translateY(-2px);
}

.social-btn:focus {
  outline: 2px solid #006666;
  outline-offset: 2px;
}

.social-btn.google {
  background: #4285f4;
}

.social-btn.google:hover {
  background: #3267d6;
}

.social-btn.linkedin {
  background: #0a66c2;
}

.social-btn.linkedin:hover {
  background: #0854a0;
}

.social-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #006666;
  color: #fff;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  margin-bottom: 0.5rem;
}

.social-btn:hover::after {
  opacity: 1;
  visibility: visible;
}

.social-icon {
  width: 1rem;
  height: 1rem;
  margin-right: 0.5rem;
}

.password-strength {
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.strength-bar {
  height: 6px;
  background: #b0b0b0;
  border-radius: 3px;
  margin-top: 0.5rem;
  transition: width 0.3s, background 0.3s;
}

body[data-theme="dark"] .strength-bar {
  background: #4a5a5a;
}

.password-feedback {
  display: block;
  font-size: 0.8rem;
  color: #ff5555;
  margin-top: 0.5rem;
}

body[data-theme="dark"] .password-feedback {
  color: #ff7777;
}

.password-requirements {
  font-size: 0.8rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.requirement {
  display: flex;
  align-items: center;
  margin: 0.25rem 0;
  transition: color 0.3s ease;
}

.requirement.met .req-icon {
  stroke: #00a3a3;
}

body[data-theme="dark"] .requirement.met .req-icon {
  stroke: #34caca;
}

.req-icon {
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.5rem;
  stroke: #666;
}

body[data-theme="dark"] .req-icon {
  stroke: #a0b0b0;
}

.error-message {
  color: #ff5555;
  font-size: 0.8rem;
  margin-top: 0.25rem;
  text-align: left;
}

body[data-theme="dark"] .error-message {
  color: #ff7777;
}

.loading-spinner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.spinner {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #006666;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

.popup-message {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  animation: slide-down 0.4s ease-in-out;
}

.popup-message.error {
  background: #ff5555;
  color: #fff;
}

.popup-message.success {
  background: #00a3a3;
  color: #fff;
}

.popup-message svg {
  width: 1rem;
  height: 1rem;
  margin-right: 0.5rem;
}

footer {
  margin: 2rem 0 1rem;
  font-size: 0.8rem;
  opacity: 0.7;
  text-align: center;
}

footer a {
  color: #006666;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slide-down {
  from { opacity: 0; transform: translate(-50%, -20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes fade-in-field {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@media (max-width: 480px) {
  .container {
      margin: 0.5rem;
      padding: 1.5rem;
  }

  header {
      margin: 1.5rem 0;
  }

  header h1 {
      font-size: 1.5rem;
  }

  header p {
      font-size: 0.9rem;
  }

  .logo {
      width: 100px;
      height: 32px;
  }

  .theme-toggle {
      top: 15px;
      right: 15px;
      font-size: 1.2rem;
  }

  .input-field {
      padding: 1rem 3rem;
      font-size: 1rem;
  }

  .btn, .social-btn {
      padding: 1rem;
      font-size: 1rem;
  }

  .input-group {
      margin-bottom: 2rem;
  }

  .social-buttons {
      flex-direction: column;
      gap: 0.5rem;
  }
}