/* Base styles */

:root {
  --color-bg: #fafafa;
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-text-muted: #6b7280;
  --color-primary: #6d28d9;
  --color-primary-hover: #5b21b6;
  --color-accent-warm: #e11d48;
  --color-accent-cool: #06b6d4;
  --color-gradient-warm: linear-gradient(135deg, #e11d48, #f97316);
  --color-gradient-cool: linear-gradient(135deg, #06b6d4, #3b82f6);
  --color-gradient-fun: linear-gradient(135deg, #e11d48, #6d28d9, #06b6d4);
  --color-border: #e5e7eb;
  --color-error: #dc2626;
  --color-error-bg: #fef2f2;
  --color-error-border: #fecaca;
  --color-success: #059669;
  --radius: 8px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0f0f0f;
    --color-surface: #1a1a1a;
    --color-text: #f0f0f0;
    --color-text-muted: #9ca3af;
    --color-primary: #a78bfa;
    --color-primary-hover: #c4b5fd;
    --color-accent-warm: #fb7185;
    --color-accent-cool: #22d3ee;
    --color-border: #2d2d2d;
    --color-error: #f87171;
    --color-error-bg: #451a1a;
    --color-error-border: #7f1d1d;
    --color-success: #34d399;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.4);
  }
}

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

html {
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Shared form elements */

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="url"] {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease;
}

input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.15);
}

button,
input[type="submit"] {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #ffffff;
  background-color: var(--color-primary);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

button:hover,
input[type="submit"]:hover {
  background-color: var(--color-primary-hover);
}

button:active,
input[type="submit"]:active {
  transform: scale(0.98);
}

fieldset {
  border: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Main content */

main {
  max-width: 64rem;
  margin: 1rem auto;
  padding: 2rem 2.5rem;
}

/* Utility: screen reader only */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Utility: gradient text */

.gradient-text {
  background: var(--color-gradient-fun);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
