/* Base */

body {
  font-family: var(--font-sans);
  line-height: var(--line-height);
  color: var(--text-main);
  font-size: var(--text-size);
}

.justify {
  text-align: justify;
}

/* Titles */

h1, h2, h3, h4, h5, h6 {
  margin: 1rem 0;
  line-height: 1.15;
  font-weight: 650;
  letter-spacing: 0.02em;
}

h1 { font-size: 2em; }
h2 { font-size: 1.8em; }
h3 { font-size: 1.6em; }
h4 { font-size: 1.4em; }
h5 { font-size: 1.2em; }
h6 { font-size: 1em;  }

/* Text */

p {
  font-size: 1em;
  margin: 1rem 0;
}

/* Links */

a {
  text-decoration: none;
  cursor: pointer;
}

a, a:hover, a:focus {
  color: inherit;
  text-decoration: inherit;
  transition: 0.25s;
}

/* Inputs and buttons */

input, button, textarea {
  font-family: var(--font-sans);
  line-height: var(--line-height);
  font-size: 1em;
  background: var(--light-main);
  color: inherit;
  transition: 0.25s;
}

textarea {
  resize: none;
  min-height: 120px;
}

input:not([type="radio"]):not([type="checkbox"]):not([type="range"]), button, textarea {
  padding: 0.55rem 0.75rem;
  border: var(--border);
  border-radius: var(--radius-sm);
}

input[type="text"], input[type="password"], input[type="email"], input[type="tel"], input[type="number"], input[type="url"], input[type="search"], textarea {
  width: 100%;
}

input[type="color"], input[type="date"], input[type="time"], input[type="range"] {
  inline-size: 160px;
  block-size: 46px;
}

/* Number input spinners */

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Checkbox and radio */

input[type="checkbox"], input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 0;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--light-muted);
  cursor: pointer;
  position: relative;
  margin: 0 0.5rem 0 0;
  top: 3px;
}
input[type="checkbox"] {
  border-radius: 0.3rem;
}
input[type="radio"] {
  border-radius: 1rem;
}

input[type="checkbox"]:checked {
  background: var(--accent-main);
  border-color: var(--accent-main);
}

input[type="checkbox"]:checked::after {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-alt);
  font-weight: bold;
  content: '✓';
  font-size: 13px;
}

input[type="radio"]:checked{
  border-color: var(--accent-main);
  border-width: 0.3rem;
}

input[type="checkbox"]:hover , input[type="radio"]:hover {
  border-color: var(--accent-muted);
  box-shadow: var(--hover-focus);
}

/* Submit button */

input[type="submit"]:hover, button:hover, button[type="submit"]:hover, button[aria-expanded="true"] {
  outline: none;
}

/* Lien simple */
p a, .btn-link {
  color: var(--accent-muted);
  text-decoration: none;
  transition: 0.25s;
}

p a:hover, h2 a:hover, .btn-link:hover {
  color: var(--accent-main);
}

/* Lien de navigation */
header nav ul li a, header nav ul.sub-menu a, .btn-nav {
  color: inherit;
  text-decoration: none;
  transition: 0.25s;
}

header nav ul li a:hover, header nav ul.sub-menu a:hover, header nav .nav-action:hover header nav .nav-action, .btn-nav:hover {
  color: var(--accent-main);
  background: var(--hover-focus);
  outline: none;
}

/* Bouton principal - par défaut pour tous les boutons */
button, button[type="submit"], input[type="submit"] {
  color: var(--text-alt);
  text-decoration: none;
  padding: 0.25rem 0.75rem;
  border: var(--border);
  border-radius: var(--radius-sm);
  background: var(--accent-main);
  transition: 0.25s;
  cursor: pointer;
}

.btn-primary {
  color: var(--text-alt);
  text-decoration: none;
  padding: 0.55rem 0.75rem;
  border: var(--border);
  border-radius: var(--radius-sm);
  background: var(--accent-main);
  transition: 0.25s;
  cursor: pointer;
}

button:hover, button[type="submit"]:hover, input[type="submit"]:hover, .btn-primary:hover {
  color: var(--accent-main);
  background: var(--hover-focus);
  outline: none;
}

/* Bouton secondaire */
.btn-secondary {
  color: var(--accent-main);
  text-decoration: none;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--hover-focus);
  transition: 0.25s;
}

.btn-secondary:hover {
  color: var(--text-alt);
  background: var(--accent-main);
  outline: none;
}

/* Bouton supprimer */
.btn-delete {
  color: var(--text-alt);
  text-decoration: none;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  border-color: var(--error);
  background: var(--error);
  transition: 0.25s;
}

.btn-delete:hover {
  color: var(--error);
  outline: none;
}

/* Select dropdown */

select {
  font-family: var(--font-sans);
  line-height: var(--line-height);
  font-size: 1em;
  margin: 0.5rem 0;
  background-color: var(--light-main);
  color: inherit;
  transition: 0.25s;
  padding: 0.55rem 0.75rem;
  border: var(--border);
  border-radius: var(--radius-sm);
  width: 100%;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: none;
  position: relative;
}

select:hover {
  border-color: var(--accent-muted);
  box-shadow: var(--hover-focus);
}

select option {
  font-family: var(--font-sans);
  line-height: var(--line-height);
  font-size: 1em;
  background: var(--light-menu);
  color: var(--text-main);
  padding: 0.55rem 0.75rem;
  border: none;
  border-radius: 10px;
}

select option:hover,
select option:checked {
  color: var(--accent-main);
  background: var(--hover-focus);
}

select::-webkit-scrollbar {
  width: 8px;
}

select::-webkit-scrollbar-track {
  background: var(--light-menu);
}

select::-webkit-scrollbar-thumb {
  background: var(--light-muted);
  border-radius: 4px;
}

select::-webkit-scrollbar-thumb:hover {
  background: var(--accent-muted);
}

select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: var(--light-menu);
}

/* Fieldset */

fieldset {
  border-radius: var(--radius-sm);
  border: var(--border);
}

legend {
  padding: 0 0.5rem;
}