/* ------------------------------------------------------------- fonty ----
   Te same pliki, których używał next/font (Inter + Roboto Mono, subset
   latin) — trzymane lokalnie, więc strona działa też bez internetu.       */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/inter-latin.woff2') format('woff2');
  unicode-range: u+00??, u+0131, u+0152-0153, u+02bb-02bc, u+02c6, u+02da, u+02dc,
    u+0304, u+0308, u+0329, u+2000-206f, u+20ac, u+2122, u+2191, u+2193, u+2212,
    u+2215, u+feff, u+fffd;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: u+0100-02ba, u+02bd-02c5, u+02c7-02cc, u+02ce-02d7, u+02dd-02ff,
    u+0304, u+0308, u+0329, u+1d00-1dbf, u+1e00-1e9f, u+1ef2-1eff, u+2020,
    u+20a0-20ab, u+20ad-20c0, u+2113, u+2c60-2c7f, u+a720-a7ff;
}

@font-face {
  font-family: 'Roboto Mono';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/roboto-mono-latin.woff2') format('woff2');
  unicode-range: u+00??, u+0131, u+0152-0153, u+02bb-02bc, u+02c6, u+02da, u+02dc,
    u+0304, u+0308, u+0329, u+2000-206f, u+20ac, u+2122, u+2191, u+2193, u+2212,
    u+2215, u+feff, u+fffd;
}

/* metryki zastępcze jak w next/font (żeby brak fontu nie przesuwał layoutu) */
@font-face {
  font-family: 'Inter Fallback';
  src: local('Arial');
  ascent-override: 90.44%;
  descent-override: 22.52%;
  line-gap-override: 0%;
  size-adjust: 107.12%;
}

@font-face {
  font-family: 'Roboto Mono Fallback';
  src: local('Arial');
  ascent-override: 77.84%;
  descent-override: 20.13%;
  line-gap-override: 0%;
  size-adjust: 134.61%;
}

/* ============================================================================
   styles.css — odpowiednik Tailwind + shadcn/ui z oryginału (Next.js).
   Zmienne kolorów przepisane 1:1 z src/app/globals.css.
   ========================================================================= */

:root {
  --background: 222 83% 4%;
  --foreground: 210 40% 98%;

  --card: 222 83% 6%;
  --card-foreground: 210 40% 98%;

  --popover: 222 83% 4%;
  --popover-foreground: 210 40% 98%;

  --primary: 188 100% 50%;
  --primary-foreground: 200 100% 10%;

  --secondary: 217 33% 17%;
  --secondary-foreground: 210 40% 98%;

  --muted: 217 33% 17%;
  --muted-foreground: 215 20% 65%;

  --accent: 217 33% 22%;
  --accent-foreground: 210 40% 98%;

  --destructive: 0 63% 50%;
  --destructive-foreground: 0 0% 98%;

  --border: 217 33% 20%;
  --input: 217 33% 18%;
  --ring: 188 100% 65%;

  --radius: 0.5rem;

  --strength-weak: 0 70% 55%;
  --strength-medium: 45 90% 55%;
  --strength-strong: 120 60% 55%;

  --font-sans: Inter, 'Inter Fallback', sans-serif;
  --font-mono: 'Roboto Mono', 'Roboto Mono Fallback', monospace;
}

/* --------------------------------------------------------------- reset --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  border: 0 solid hsl(var(--border));
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
p {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}

button,
input {
  font-family: inherit;
  font-size: 100%;
  line-height: inherit;
  color: inherit;
  margin: 0;
}

button {
  padding: 0;
  background-color: transparent;
  cursor: pointer;
}

svg {
  display: block;
  flex-shrink: 0;
}

[hidden] {
  display: none !important;
}

.font-sans {
  font-family: var(--font-sans);
}

/* ---------------------------------------------------------- HomePage ----- */
.page {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background-color: hsl(var(--background));
}

@media (min-width: 640px) {
  .page {
    padding: 2rem;
  }
}

.page-inner {
  width: 100%;
  max-width: 28rem;
}

.page-header {
  margin-bottom: 2rem;
  text-align: center;
}

.page-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.icon-shield {
  height: 3rem;
  width: 3rem;
  color: hsl(var(--primary));
}

.page-title {
  font-size: 2.25rem;
  line-height: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: hsl(var(--foreground));
}

.page-subtitle {
  margin-top: 0.5rem;
  font-size: 1.125rem;
  line-height: 1.75rem;
  color: hsl(var(--muted-foreground));
}

.page-footer {
  margin-top: 3rem;
  text-align: center;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: hsl(var(--muted-foreground));
}

/* -------------------------------------------------------------- Card ----- */
.card {
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  color: hsl(var(--card-foreground));
  width: 100%;
}

.card-shadow-2xl {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.card-header {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
}

.card-header > * + * {
  margin-top: 0.375rem;
}

.card-title {
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.card-description {
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: hsl(var(--muted-foreground));
}

.card-content {
  padding: 0 1.5rem 1.5rem;
}

.card-content > * + * {
  margin-top: 1.5rem;
}

.card-footer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
  padding: 0 1.5rem 1.5rem;
}

/* -------------------------------------------------------------- Form ----- */
.form-item > * + * {
  margin-top: 0.5rem;
}

.form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.form-label {
  /* shadcn Label = element inline (tworzy linię o wysokości 24px w bloku) */
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
}

.form-description {
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: hsl(var(--muted-foreground));
}

.form-message {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: hsl(var(--destructive));
}

.length-value {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: hsl(var(--primary));
}

/* ------------------------------------------------------------- Input ----- */
.input {
  display: flex;
  height: 2.5rem;
  width: 100%;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--input));
  background-color: hsl(var(--background));
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5rem;
  outline: none;
}

.input::placeholder {
  color: hsl(var(--muted-foreground));
}

.input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
}

.input:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

@media (min-width: 768px) {
  .input {
    font-size: 0.875rem;
  }
}

/* ------------------------------------------------------------ Slider ----- */
.slider {
  position: relative;
  display: flex;
  width: 100%;
  align-items: center;
  touch-action: none;
  user-select: none;
  height: 0.5rem;
  margin-top: 0.5rem;
}

.slider-track {
  position: relative;
  height: 0.5rem;
  width: 100%;
  flex-grow: 1;
  overflow: hidden;
  border-radius: 9999px;
  background-color: hsl(var(--secondary));
}

.slider-range {
  position: absolute;
  height: 100%;
  left: 0;
  width: 0;
  background-color: hsl(var(--primary));
}

.slider-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  display: block;
  height: 1.25rem;
  width: 1.25rem;
  border-radius: 9999px;
  border: 2px solid hsl(var(--primary));
  background-color: hsl(var(--background));
  transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1),
    background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.slider-input:focus-visible ~ .slider-thumb {
  box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
}

/* natywny suwak leży przezroczysty na wierzchu — obsługa myszy i klawiatury */
.slider-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

.slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 1.25rem;
  width: 1.25rem;
}

.slider-input::-moz-range-thumb {
  height: 1.25rem;
  width: 1.25rem;
  border: 0;
}

.slider-input:disabled {
  pointer-events: none;
  opacity: 0.5;
}

.slider.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ------------------------------------------------------------ Select ----- */
.select {
  position: relative;
  margin-top: 0.5rem;
}

.select-trigger {
  display: flex;
  height: 2.5rem;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--input));
  background-color: hsl(var(--background));
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  outline: none;
}

.select-trigger:focus-visible {
  box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
}

.select-trigger:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.select-chevron {
  height: 1rem;
  width: 1rem;
  opacity: 0.5;
}

.select-content {
  position: absolute;
  z-index: 50;
  top: calc(100% + 0.25rem);
  left: 0;
  width: 100%;
  max-height: 24rem;
  min-width: 8rem;
  overflow: hidden;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  animation: select-in 150ms ease-out;
}

@keyframes select-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-0.5rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.select-viewport {
  padding: 0.25rem;
}

.select-item {
  position: relative;
  display: flex;
  width: 100%;
  cursor: default;
  user-select: none;
  align-items: center;
  border-radius: calc(var(--radius) - 4px);
  padding: 0.375rem 0.5rem 0.375rem 2rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  outline: none;
}

.select-item:hover,
.select-item.is-active {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.select-item-indicator {
  position: absolute;
  left: 0.5rem;
  display: flex;
  height: 0.875rem;
  width: 0.875rem;
  align-items: center;
  justify-content: center;
}

.select-check {
  height: 1rem;
  width: 1rem;
  visibility: hidden;
}

.select-item.is-selected .select-check {
  visibility: visible;
}

/* ------------------------------------------------------------ Button ----- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
    color 150ms cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.button svg {
  height: 1rem;
  width: 1rem;
  pointer-events: none;
  flex-shrink: 0;
}

.button:focus-visible {
  box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
}

.button:disabled {
  pointer-events: none;
  opacity: 0.5;
}

.button-default {
  height: 2.5rem;
  padding: 0.5rem 1rem;
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.button-default:hover {
  background-color: hsl(var(--primary) / 0.9);
}

.button-ghost:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.button-icon {
  height: 2.5rem;
  width: 2.5rem;
}

/* w-full text-base py-6 */
.button-generate {
  width: 100%;
  font-size: 1rem;
  line-height: 1.5rem;
  padding: 1.5rem 1rem;
}

.button-generate svg {
  margin-right: 0.5rem;
}

.spin {
  animation: spin 1s linear infinite;
}

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

/* --------------------------------------------------------- Error box ----- */
.error-box {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: hsl(var(--destructive));
  background-color: hsl(var(--destructive) / 0.1);
}

.error-box > * + * {
  margin-left: 0.5rem;
}

.icon-alert {
  height: 1.25rem;
  width: 1.25rem;
}

/* ------------------------------------------------- Wynik + wskaźnik ------ */
.result {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px dashed hsl(var(--primary) / 0.5);
  border-radius: var(--radius);
  background-color: hsl(var(--primary) / 0.05);
  animation: fade-in 500ms ease-out;
}

.result > * + * {
  margin-top: 0.75rem;
}

@keyframes fade-in {
  from {
    opacity: 0.5;
  }
  to {
    opacity: 1;
  }
}

.result-label {
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
}

.result-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-top: 0.25rem;
}

.result-input {
  padding-right: 3rem;
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  background-color: hsl(var(--background) / 0.3);
  border-color: hsl(var(--border));
}

.result-input:focus-visible {
  box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--primary));
}

.copy-button {
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  height: 2rem;
  width: 2rem;
  color: hsl(var(--muted-foreground));
}

.copy-button:hover {
  color: hsl(var(--primary));
}

.copy-button svg {
  height: 1.25rem;
  width: 1.25rem;
}

.icon-check-circle {
  color: rgb(34 197 94); /* text-green-500 */
}

.result-reason {
  font-size: 0.75rem;
  line-height: 1rem;
  font-style: italic;
  color: hsl(var(--muted-foreground));
}

.strength > * + * {
  margin-top: 0.25rem;
}

.strength-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.strength-caption {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
}

.strength-label {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.strength-label.is-weak {
  color: hsl(var(--strength-weak));
}
.strength-label.is-medium {
  color: hsl(var(--strength-medium));
}
.strength-label.is-strong {
  color: hsl(var(--strength-strong));
}

.progress {
  position: relative;
  height: 0.5rem;
  width: 100%;
  overflow: hidden;
  border-radius: 9999px;
  background-color: hsl(var(--secondary));
}

.progress-indicator {
  height: 100%;
  width: 100%;
  flex: 1 1 0%;
  background-color: hsl(var(--muted));
  transform: translateX(-100%);
  transition: transform 500ms cubic-bezier(0.4, 0, 0.2, 1),
    background-color 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-indicator.is-weak {
  background-color: hsl(var(--strength-weak));
}
.progress-indicator.is-medium {
  background-color: hsl(var(--strength-medium));
}
.progress-indicator.is-strong {
  background-color: hsl(var(--strength-strong));
}

/* ------------------------------------------------------------- Toast ----- */
.toast-viewport {
  position: fixed;
  top: 0;
  z-index: 100;
  display: flex;
  max-height: 100vh;
  width: 100%;
  flex-direction: column-reverse;
  padding: 1rem;
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .toast-viewport {
    bottom: 0;
    right: 0;
    top: auto;
    flex-direction: column;
  }
}

@media (min-width: 768px) {
  .toast-viewport {
    max-width: 420px;
  }
}

.toast {
  pointer-events: auto;
  position: relative;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  padding: 1.5rem 2rem 1.5rem 1.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  animation: toast-in 150ms ease-out;
}

.toast > * + * {
  margin-left: 1rem;
}

.toast.is-destructive {
  border-color: hsl(var(--destructive));
  background-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}

.toast.is-closing {
  animation: toast-out 150ms ease-in forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

.toast-body > * + * {
  margin-top: 0.25rem;
}

.toast-title {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
}

.toast-description {
  font-size: 0.875rem;
  line-height: 1.25rem;
  opacity: 0.9;
}

.toast-close {
  position: absolute;
  right: 0.5rem;
  top: 0.5rem;
  border-radius: calc(var(--radius) - 2px);
  padding: 0.25rem;
  color: hsl(var(--foreground) / 0.5);
  opacity: 0;
  transition: opacity 150ms, color 150ms;
}

.toast:hover .toast-close {
  opacity: 1;
}

.toast-close:hover {
  color: hsl(var(--foreground));
}

.toast.is-destructive .toast-close {
  color: rgb(252 165 165);
}

.toast.is-destructive .toast-close:hover {
  color: rgb(254 242 242);
}

.toast-close svg {
  height: 1rem;
  width: 1rem;
}

.toast-action-icon {
  color: rgb(34 197 94);
  height: 1.5rem;
  width: 1.5rem;
}
