@import url('variables.css');

/* ===========================================
   SOLO GLOBAL DESIGN SYSTEM
   ===========================================
   Minimal shared styles for auth pages
   =========================================== */

/* ===========================================
   1. CSS CUSTOM PROPERTIES (Design Tokens)
   =========================================== */
:root {
  /* Spacing Scale (4px base unit) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Typography Scale */
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 32px;
  --text-4xl: 40px;

  /* Line Heights */
  --leading-none: 1;
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 2;

  /* Font Weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  /* Letter Spacing */
  --tracking-tight: -0.025em;
  --tracking-normal: 0;
  --tracking-wide: 0.025em;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(13, 13, 13, 0.03);
  --shadow-sm: 0 1px 2px 0 rgba(13, 13, 13, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(13, 13, 13, 0.07), 0 2px 4px -2px rgba(13, 13, 13, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(13, 13, 13, 0.08), 0 4px 6px -4px rgba(13, 13, 13, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(13, 13, 13, 0.1), 0 8px 10px -6px rgba(13, 13, 13, 0.05);
  --shadow-2xl: 0 25px 50px -12px rgba(13, 13, 13, 0.25);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Component-specific tokens */
  --input-height-mobile: 56px;
  --input-height-desktop: 60px;
  --button-height-mobile: 48px;
  --button-height-desktop: 54px;
}

/* ===========================================
   2. BASE RESET
   =========================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--colour-neutral-900);
  background-color: #ffffff;
  min-height: 100vh;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ===========================================
   3. APP CONTAINER (Shared Layout)
   =========================================== */
.app {
  width: 100%;
  min-height: 100vh;
  padding: 48px 24px 64px;
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

/* ===========================================
   4. SHARED LAYOUT COMPONENTS
   =========================================== */

/* Header */
.header {
  margin-bottom: 32px;
  display: flex;
}

.logo-part {
  height: 24px;
  width: auto;
  display: block;
}

/* Content */
.content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--colour-neutral-900);
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 16px;
  line-height: 1.5;
  color: var(--colour-neutral-700);
}

/* Utility */
.text-danger {
  color: var(--colour-red-400);
}

/* Hides an element via a class instead of an inline style attribute, so the
   strict (no 'unsafe-inline') Content-Security-Policy doesn't drop it. JS that
   reveals an element sets an explicit inline display, which wins over this. */
.hidden {
  display: none;
}

/* ===========================================
   5. BUTTON COMPONENT
   =========================================== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--button-height-mobile);
  padding: 0 var(--space-6);
  border-radius: var(--radius-full);
  border: none;
  background: var(--colour-brand-500);
  color: var(--colour-neutral-900);
  font-family: var(--font-family);
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  line-height: var(--leading-none);
  text-decoration: none;
  cursor: pointer;
  transition: filter var(--transition-fast),
              transform var(--transition-fast),
              box-shadow var(--transition-fast);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(254, 218, 0, 0.4);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  filter: brightness(0.95);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--colour-blue-400);
  outline-offset: 2px;
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* ===========================================
   6. RESPONSIVE – Desktop (768px+)
   =========================================== */
@media (min-width: 576px) {
  body {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
  }

  .app {
    min-height: auto;
    padding: 56px 48px;
  }

  .header {
    justify-content: center;
  }

  h1 {
    font-size: 28px;
    text-align: center;
  }

  .subtitle {
    text-align: center;
  }

  .btn-primary {
    height: var(--button-height-desktop);
    font-size: var(--text-lg);
  }
}

/* ===========================================
   7. ACCESSIBILITY FEATURES
   =========================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .btn-primary:hover {
    transform: none !important;
  }
}

:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--colour-blue-400);
  outline-offset: 2px;
}

/* Safe area support */
@supports (padding-top: env(safe-area-inset-top)) {
  body {
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
  }
}
