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

:root {
  --background: #ffffff;
  --foreground: hsl(220, 20%, 15%);
  --primary: hsl(158, 64%, 45%);
  --primary-hover: hsl(158, 64%, 38%);
  --primary-foreground: #ffffff;
  --secondary: hsl(220, 20%, 96%);
  --secondary-foreground: hsl(220, 20%, 15%);
  --muted: hsl(220, 15%, 94%);
  --muted-foreground: hsl(220, 10%, 45%);
  --accent: hsl(158, 64%, 92%);
  --accent-foreground: hsl(158, 64%, 25%);
  --border: hsl(220, 15%, 90%);
  --input: hsl(220, 15%, 90%);
  --ring: hsl(158, 64%, 45%);
  --radius: 0.75rem;
  --gradient-start: hsl(158, 50%, 97%);
  --gradient-end: hsl(35, 60%, 97%);
}

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

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  color: var(--foreground);
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.auth-container {
  width: 100%;
  max-width: 460px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.auth-card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 6px 16px rgba(0, 0, 0, 0.04);
}

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

.auth-logo a {
  text-decoration: none;
  color: var(--foreground);
}

.auth-logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-logo-text span {
  color: var(--primary);
}

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

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

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

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.375rem;
  color: var(--foreground);
}

.form-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--foreground);
  background: var(--background);
  border: 1px solid var(--input);
  border-radius: calc(var(--radius) - 2px);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px hsla(158, 64%, 45%, 0.15);
}

.form-input.error {
  border-color: hsl(0, 84%, 60%);
}

.form-error {
  font-size: 0.75rem;
  color: hsl(0, 84%, 60%);
  margin-top: 0.25rem;
  display: none;
}

.form-error.visible {
  display: block;
}

.captcha-wrapper {
  margin: 1.25rem 0;
  display: flex;
  justify-content: center;
}

.btn-primary {
  width: 100%;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--primary-foreground);
  background: var(--primary);
  border: none;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  transition: background-color 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-footer {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.auth-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.success-message {
  text-align: center;
  padding: 1rem 0;
}

.success-message h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--foreground);
}

.success-message p {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.6;
}

.success-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-icon svg {
  width: 24px;
  height: 24px;
  color: var(--primary);
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--primary-foreground);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.form-message {
  display: none;
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: hsl(0, 72%, 50%);
  background: hsl(0, 100%, 97%);
  border: 1px solid hsl(0, 80%, 88%);
  border-left: 3px solid hsl(0, 84%, 60%);
  border-radius: calc(var(--radius) - 2px);
  text-align: left;
  line-height: 1.4;
}

@media (max-width: 480px) {
  .auth-card {
    padding: 1.75rem;
  }
}
