@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --auth-bg: #f8fafc;
  --auth-primary: #4f46e5;
  --auth-primary-hover: #4338ca;
  --auth-text-dark: #0f172a;
  --auth-text-light: #64748b;
  --auth-border: #e2e8f0;
  --auth-card-bg: #ffffff;
  --auth-error: #ef4444;
  --auth-success: #10b981;
}

body.auth-body {
  font-family: 'Inter', sans-serif;
  background-color: var(--auth-bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 2rem 1rem;
}

.auth-card {
  background: var(--auth-card-bg);
  width: 100%;
  max-width: 440px;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0,0,0,0.02);
  padding: 3rem;
  box-sizing: border-box;
  animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeUp {
  0% { opacity: 0; transform: translateY(15px); }
  100% { opacity: 1; transform: translateY(0); }
}

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo img {
  height: 48px;
  width: auto;
}

.auth-title {
  color: var(--auth-text-dark);
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  margin: 0 0 0.5rem 0;
}

.auth-subtitle {
  color: var(--auth-text-light);
  font-size: 0.95rem;
  text-align: center;
  margin: 0 0 2.5rem 0;
}

/* Input Styles */
.auth-form-group {
  margin-bottom: 1.25rem;
  position: relative;
}

.auth-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--auth-text-dark);
  margin-bottom: 0.5rem;
}

.auth-input-wrapper {
  position: relative;
}

.auth-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  color: var(--auth-text-dark);
  background-color: #fff;
  border: 1px solid var(--auth-border);
  border-radius: 8px;
  transition: all 0.2s ease-in-out;
  box-sizing: border-box;
}

.auth-input:focus {
  outline: none;
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.auth-input::-webkit-input-placeholder {
  color: #adb5bd;
}

.pwd-toggle {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--auth-text-light);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  transition: color 0.2s;
}

.pwd-toggle:hover {
  color: var(--auth-primary);
}

/* Dropdown */
select.auth-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1em;
  padding-right: 2.5rem;
}

/* Validation styling */
.auth-error-msg {
  display: none;
  color: var(--auth-error);
  font-size: 0.8rem;
  margin-top: 0.4rem;
  font-weight: 500;
}

.has-error .auth-input {
  border-color: var(--auth-error);
  background-color: #fef2f2;
}

.has-error .auth-error-msg {
  display: block;
}

.has-success .auth-input {
  border-color: var(--auth-success);
}

/* Auth Actions */
.auth-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: -10px 0 1.5rem 0;
}

.auth-checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-checkbox {
  width: 1rem;
  height: 1rem;
  accent-color: var(--auth-primary);
  border-radius: 4px;
}

.auth-checkbox-label {
  font-size: 0.85rem;
  color: var(--auth-text-light);
  user-select: none;
  cursor: pointer;
}

.auth-link {
  font-size: 0.85rem;
  color: var(--auth-primary);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s;
}

.auth-link:hover {
  opacity: 0.8;
}

/* Submit Button */
.auth-btn {
  width: 100%;
  padding: 0.875rem;
  background: linear-gradient(135deg, var(--auth-primary) 0%, #6366f1 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.auth-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}

.auth-btn:disabled {
  background: #cbd5e1;
  color: #94a3b8;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.auth-footer {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--auth-text-light);
}

/* Spinner */
.spinner {
  display: none;
  width: 1.2rem;
  height: 1.2rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading .spinner {
  display: inline-block;
}

/* Alerts */
.auth-alert-error {
  background-color: #fef2f2;
  border-left: 4px solid var(--auth-error);
  color: #b91c1c;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-alert-success {
  background-color: #ecfdf5;
  border-left: 4px solid var(--auth-success);
  color: #047857;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@media (max-width: 480px) {
  .auth-card {
    padding: 2rem 1.5rem;
    box-shadow: none;
    background: transparent;
  }
  body.auth-body {
    background-color: var(--auth-card-bg);
  }
}
