:root {
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --border-color: #e5e7eb;
  --input-bg: #f3f4f6;
  --primary-cmd: #4e8e24;
  --primary-cmd-hover: #5ea531;
  --font-family: 'Cairo', 'Inter', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image: linear-gradient(to right, #e2e8f0 1px, transparent 1px),
    linear-gradient(to bottom, #e2e8f0 1px, transparent 1px);
  background-size: 40px 40px;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s;
}

.auth-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 1.5rem 2rem;
}

.auth-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 10;
}

.logo {
  font-size: 1.25rem;
  font-weight: 500;
}

.logo strong {
  font-weight: 700;
}

.support-link {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.support-link:hover {
  color: var(--text-primary);
}

.auth-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 2rem 0;
}

.auth-card {
  background: var(--card-bg);
  width: 100%;
  max-width: 440px;
  border-radius: 1.5rem;
  padding: 3rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
  position: relative;
  z-index: 10;
}

.auth-title {
  text-align: center;
  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

.auth-tabs {
  display: flex;
  background: var(--input-bg);
  border-radius: 0.75rem;
  padding: 0.375rem;
  margin-bottom: 2rem;
}

.auth-tab {
  flex: 1;
  text-align: center;
  padding: 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.auth-tab.active {
  background: white;
  color: var(--primary-cmd);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.auth-tab:not(.active):hover {
  color: var(--text-primary);
}

.social-login {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.social-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #f4f6fa;
  border: none;
  padding: 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.2s;
}

.social-btn:hover {
  background: #e9ecef;
}

.social-btn img {
  width: 18px;
  height: 18px;
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: #9ca3af;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin: 1.5rem 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.divider::before {
  margin-right: 1rem;
}

.divider::after {
  margin-left: 1rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-link {
  font-size: 0.8rem;
  color: var(--primary-cmd);
  font-weight: 500;
}

.form-link:hover {
  text-decoration: underline;
}

.input-container {
  position: relative;
}

.form-control {
  width: 100%;
  padding: 1rem 1.25rem;
  background: #f4f6fa;
  border: 1px solid transparent;
  border-radius: 0.75rem;
  font-size: 1rem;
  color: var(--text-primary);
  transition: all 0.2s;
  font-family: inherit;
}

.form-control::placeholder {
  color: #9ca3af;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-cmd);
  background: white;
  box-shadow: 0 0 0 4px rgba(78, 142, 36, 0.1);
}

.password-toggle {
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  cursor: pointer;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover {
  color: var(--text-primary);
}

.btn-primary {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, var(--primary-cmd-hover), var(--primary-cmd));
  border: none;
  border-radius: 0.75rem;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s;
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
  font-family: inherit;
}

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

.btn-primary:hover {
  box-shadow: 0 4px 12px rgba(78, 142, 36, 0.2);
}

.terms-text {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 0 1rem;
}

.terms-text a {
  color: var(--text-primary);
  font-weight: 600;
}

.terms-text a:hover {
  text-decoration: underline;
}

.security-badges {
  display: flex;
  gap: 2rem;
  margin-top: 1.5rem;
  color: #9ca3af;
  font-size: 0.875rem;
}

.security-badges span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.invalid-feedback {
  display: block;
  color: #dc2626;
  font-size: 0.8rem;
  margin-top: 0.3rem;
  font-weight: 500;
}

.form-control.is-invalid {
  border-color: #fca5a5;
  background: #fef2f2;
}

.auth-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding-top: 1.5rem;
  border-top: 1px solid #f3f4f6;
  position: relative;
  z-index: 10;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a:hover {
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .auth-footer {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .auth-wrapper {
    padding: 1rem;
  }

  .auth-card {
    padding: 2rem;
  }
}