/*
 * Shared design system for Digital Equity Partner auth / utility pages.
 * Tokens, reset, brand logo, buttons, and motion utilities.
 */

:root {
  /* Surfaces */
  --color-neutral-50: #fafafa;
  --color-base-white: #ffffff;
  --color-bg-primary: #ffffff;

  /* Text */
  --color-text-primary: #171717;
  --color-text-secondary: #404040;
  --color-text-tertiary: #525252;
  --color-text-placeholder: #737373;
  --color-text-white: #ffffff;
  --color-text-error: #d92d20;

  /* Borders */
  --color-border-primary: #d4d4d4;
  --color-border-secondary: #e5e5e5;

  /* Brand */
  --color-brand: #3448c5;
  --color-brand-hover: #2b3ba8;
  --color-brand-active: #243390;

  /* Icons */
  --color-fg-quaternary: #a3a3a3;

  /* Elevation */
  --shadow-xs: 0px 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md:
    0px 4px 6px -1px rgba(0, 0, 0, 0.1),
    0px 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-btn-hover: 0 8px 20px rgba(52, 72, 197, 0.22);
  --shadow-btn-inner:
    inset 0px 0px 0px 1px rgba(0, 0, 0, 0.18),
    inset 0px -2px 0px 0px rgba(0, 0, 0, 0.05);

  /* Spacing */
  --spacing-xxs: 2px;
  --spacing-xs: 4px;
  --spacing-sm: 6px;
  --spacing-md: 8px;
  --spacing-lg: 12px;
  --spacing-xl: 16px;
  --spacing-2xl: 20px;
  --spacing-3xl: 24px;
  --spacing-4xl: 32px;
  --spacing-6xl: 48px;
  --spacing-9xl: 96px;

  /* Typography */
  --font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-size-display-xl: 60px;
  --line-height-display-xl: 72px;
  --font-size-display-xs: 24px;
  --line-height-display-xs: 32px;
  --font-size-text-xl: 20px;
  --line-height-text-xl: 30px;
  --font-size-text-md: 16px;
  --line-height-text-md: 24px;
  --font-size-text-sm: 14px;
  --line-height-text-sm: 20px;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;

  /* Radius & layout */
  --radius-md: 8px;
  --card-max-width: 420px;
  --logo-height: 32px;
  --header-padding-y: 40px;
  --header-padding-x: 54px;
  --container-padding: 32px;
  --header-height: calc(var(--logo-height) + (var(--header-padding-y) * 2));
}

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

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-text-md);
  line-height: var(--line-height-text-md);
  font-weight: var(--font-weight-regular);
  color: var(--color-text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Brand lockup — top-left on desktop (same position on all pages) */
.page-logo {
  position: absolute;
  top: var(--header-padding-y);
  left: var(--header-padding-x);
  z-index: 1;
  display: inline-block;
  height: var(--logo-height);
}

.page-logo img {
  display: block;
  height: 100%;
  width: auto;
}

/* Primary button */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  min-height: 44px;
  padding: 10px var(--spacing-xl);
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-brand);
  color: var(--color-text-white);
  font-family: inherit;
  font-size: var(--font-size-text-md);
  line-height: var(--line-height-text-md);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  transition:
    background-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: var(--shadow-btn-inner);
  pointer-events: none;
}

.btn:hover {
  background: var(--color-brand-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-btn-hover);
}

.btn:active {
  background: var(--color-brand-active);
  transform: translateY(0);
  box-shadow: none;
}

.btn:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

.btn-full {
  width: 100%;
}

/* Motion utilities */
.fade-down {
  opacity: 0;
  animation: fade-down 0.7s ease forwards;
}

.fade-up {
  opacity: 0;
  transform: translateY(16px);
  animation: fade-up 0.8s ease forwards;
}

.fade-up-delay-1 {
  animation-delay: 0.15s;
}

.fade-up-delay-2 {
  animation-delay: 0.35s;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-down {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  :root {
    --header-padding-y: 24px;
    --header-padding-x: 20px;
    --container-padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fade-down,
  .fade-up {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .btn {
    transition: none;
  }

  .btn:hover {
    transform: none;
    box-shadow: none;
  }
}
