@font-face {
  font-family: "JetBrains Mono Bold";
  src: url(./assets/JetBrainsMono-Bold.ttf);
}

:root {
  /* ===== BASE COLORS ===== */

  --grey-950: #08070b;
  --grey-900: #14131b;
  --grey-850: #18171f;
  --grey-800: #24232c;
  --grey-700: #54535b;
  --grey-600: #817d92;
  --grey-200: #e6e5ea;

  --green-200: #a4ffaf;
  --yellow-300: #f8cd65;
  --orange-400: #fb7c58;
  --red-500: #f64a4a;

  --gradient-1: linear-gradient(to right, var(--grey-900), var(--grey-950));

  /* ===== BASE SPACING ===== */

  --spacing-100: 8px;
  --spacing-200: 16px;
  --spacing-300: 24px;
  --spacing-400: 32px;
  --spacing-700: 56px;
  --spacing-1000: 80px;
  --spacing-1300: 104px;
  --spacing-1600: 128px;
  --spacing-2000: 160px;
  --spacing-2200: 176px;
  --spacing-2300: 184px;
}

/* ===== RESET ===== */

html {
  min-height: 100%;
}

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

body,
h1,
h2,
p,
label,
blockquote {
  margin-block-end: 0;
  margin: 0;
  font-family: "JetBrains Mono Bold";
  color: var(--grey-200);
}

img,
picture {
  max-width: 100%;
  display: block;
}

button {
  padding: 0;
  background: none;
  border-radius: 0;
  border: none;
  cursor: pointer;
}

/* ===== INPUT RESETS ===== */

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  background: transparent;
  width: 100%;
  outline: none;
}

input[type="range"]::-webkit-slider-runnable-track {
  background: transparent;
  border: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  border: none;
}

input[type="range"]::-moz-range-track {
  background: transparent;
  border: none;
}

input[type="range"]::-moz-range-thumb {
  border: none;
  border-radius: 0;
}

input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
}

/* ===== BASE STYLES / MOBILE ===== */

body {
  background: var(--gradient-1);
}

h1 {
  font-size: 1.3rem;
  color: var(--grey-600);
  text-align: center;
}

.app-container {
  max-width: 345px;
  margin: auto;
  margin-top: 4rem;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-200);
}

.password-output-box {
  height: 65px;
  background: var(--grey-800);
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  padding: var(--spacing-200);
}

.generator-box {
  background: var(--grey-800);
  padding: var(--spacing-200);
}

.password-output {
  font-size: 1.4rem;
  color: var(--grey-700);
}

.final-password {
  color: var(--grey-200);
}

.copied-icon {
  display: flex;
  flex-direction: row;
  gap: var(--spacing-100);
  align-items: center;
}

.copied {
  font-size: 0.9rem;
  color: var(--green-200);
}

.copy-btn:focus-visible {
  outline: 2px solid #5af36c;
  outline-offset: 2px;
}

.copy-btn:disabled {
  cursor: default;
}

.copy-btn:disabled .copy-svg {
  fill: var(--grey-700);
}

.copy-btn:disabled:hover .copy-svg {
  fill: var(--grey-700);
}

.copy-svg {
  fill: var(--green-200);
}

.copy-btn:hover .copy-svg {
  fill: white;
}

.number-length {
  font-size: 1.4rem;
  color: var(--green-200);
}

.number-error,
.copy-error {
  color: var(--red-500);
}

.password-copy-wrapper,
.char-length-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* RANGE SLIDER STYLING */

.char-slider {
  margin-top: var(--spacing-300);
}

input[type="range"]::-webkit-slider-runnable-track {
  height: var(--spacing-100);
  background: linear-gradient(
    to right,
    var(--green-200) var(--progress, 0%),
    var(--grey-850) var(--progress, 0%)
  );
}

input[type="range"]::-webkit-slider-thumb {
  width: 24px;
  height: 24px;
  background: var(--grey-200);
  border-radius: 50%;
  border: none;
  margin-top: -8px;
}

input[type="range"]:focus-visible::-webkit-slider-thumb {
  border-color: #5af36c;
  box-shadow: 0 0 5px 3px #5af36c;
  outline: none;
}

input[type="range"]:hover::-webkit-slider-thumb {
  background: var(--green-200);
}

input[type="range"]:active::-webkit-slider-thumb {
  background: var(--grey-850);
  border: 2px solid var(--green-200);
}

input[type="range"]::-moz-range-track {
  height: var(--spacing-100);
  background: linear-gradient(
    to right,
    var(--green-200) var(--progress, 0%),
    var(--grey-850) var(--progress, 0%)
  );
}

input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  background: var(--grey-200);
  border-radius: 50%;
  border: none;
}

input[type="range"]:focus-visible::-moz-range-thumb {
  border-color: #5af36c;
  box-shadow: 0 0 5px 3px #5af36c;
  outline: none;
}

input[type="range"]:hover::-moz-range-thumb {
  background: var(--green-200);
}

input[type="range"]:active::-moz-range-thumb {
  background: var(--grey-850);
  border: 2px solid var(--green-200);
}

/* END OF RANGE SLIDER STYLING */

/* CHECKBOX STYLING */

input[type="checkbox"] {
  margin: 0;
  width: 20px;
  height: 20px;
  border: 2px solid var(--grey-200);
  display: grid;
  place-content: center;
  cursor: pointer;
}

input[type="checkbox"].checkbox-error {
  border: 2px solid var(--red-500);
}

input[type="checkbox"]:hover {
  border-color: var(--green-200);
}

input[type="checkbox"]:focus-visible {
  border: 2px solid #5af36c;
  box-shadow: 0 0 5px 3px #5af36c;
  outline: none;
}

input[type="checkbox"]:checked {
  background-color: var(--green-200);
  border-color: var(--green-200);
  background-image: url("./assets/icon-check.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 0.75rem;
}

/* END OF CHECKBOX STYLING */

li {
  display: flex;
  align-items: center;
}

ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-200);
  margin-top: 42px;
}

.inclusion {
  margin-left: var(--spacing-200);
}

.strength-box {
  background: var(--grey-850);
  height: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  padding-left: var(--spacing-200);
  padding-right: var(--spacing-200);
  margin-top: var(--spacing-400);
  margin-bottom: var(--spacing-300);
}

.strength {
  color: var(--grey-600);
}

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

.strength-level-wrapper {
  display: flex;
  flex-direction: row;
  gap: var(--spacing-200);
  align-items: center;
}

.strength-markers {
  display: flex;
  flex-direction: row;
  gap: var(--spacing-100);
}

.marker {
  width: 10px;
  height: 28px;
  border: 2px solid var(--grey-200);
}

.too-weak {
  border-color: var(--red-500);
  background-color: var(--red-500);
}

.weak {
  border-color: var(--orange-400);
  background-color: var(--orange-400);
}

.medium {
  border-color: var(--yellow-300);
  background-color: var(--yellow-300);
}

.strong {
  border-color: var(--green-200);
  background-color: var(--green-200);
}

.generate-btn {
  height: 56px;
  width: 100%;
  font-family: "JetBrains Mono Bold";
  font-size: 1rem;
  border: 2px solid var(--green-200);
  background-color: var(--green-200);
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-200);
  transition:
    background-color 0.1s ease,
    color 0.1s ease;
}

.btn-text {
  color: var(--grey-800);
  fill: var(--grey-800);
}

.generate-btn:focus-visible {
  border: 2px solid #5af36c;
  box-shadow: 0 0 5px 3px #5af36c;
  background-color: var(--grey-800);
  outline: none;
  color: var(--grey-800);
  fill: var(--grey-800);
}

.generate-btn:hover {
  background-color: var(--grey-800);
  border: 2px solid var(--green-200);
}

.generate-btn:focus-visible .btn-text {
  color: var(--green-200);
  fill: var(--green-200);
}

.generate-btn:hover .btn-text {
  color: var(--green-200);
  fill: var(--green-200);
}

.error-state {
  background-color: var(--grey-800);
  border: 2px solid var(--red-500);
}

.error-state .btn-text {
  color: var(--red-500);
  fill: var(--red-500);
}

.error-state:hover {
  background-color: var(--grey-800);
  border: 2px solid var(--red-500);
}

.error-state:hover .btn-text {
  color: var(--red-500);
  fill: var(--red-500);
}

.error-msg {
  margin-top: 5px;
  font-size: 0.7rem;
  color: var(--red-500);
  text-align: center;
  word-spacing: -2px;
  line-height: 12px;
  height: 0.8rem;
}

/* ===== TABLET & DESKTOP ===== */

@media (min-width: 600px) {
  h1 {
    font-size: 1.7rem;
    margin-bottom: 0.3rem;
  }

  .app-container {
    max-width: 540px;
    font-size: 1.2rem;
  }

  .password-output-box {
    height: 70px;
    padding-left: var(--spacing-400);
    padding-right: var(--spacing-400);
  }

  .password-output {
    font-size: 1.6rem;
  }

  .copied-icon {
    gap: var(--spacing-200);
  }

  .copied {
    font-size: 1.1rem;
  }

  .copy-btn,
  .arrow-icon {
    transform: scale(1.3);
  }

  .generator-box {
    padding: var(--spacing-400);
    padding-bottom: var(--spacing-200);
  }

  .number-length {
    font-size: 1.6rem;
  }

  .inclusion {
    margin-left: var(--spacing-300);
  }

  .strength-box {
    height: 72px;
    padding-left: var(--spacing-400);
    padding-right: var(--spacing-400);
    margin-bottom: 1.6rem;
  }

  .generate-btn {
    height: 65px;
  }

  .btn-text {
    font-size: 1.2rem;
  }

  .error-msg {
    font-size: 0.9rem;
    margin-top: 10px;
  }
}
