.form {
  margin: 0 auto;
  max-width: 30rem;
  border: var(--border);
  font-size: 1.2rem;

  /* An explicit background is required here, as it's actually transparent by default, and we
       don't want to see the shadow element behind */
  background: var(--background-color);

  /* This shadow is separated from the edges by 0.75rem, and shrunk by 0.2rem on the
  top and bottom. */
  box-shadow: 0.75rem 0.75rem 0 -0.2rem var(--form-shadow-colour, var(--accent-colour));
}

.form__container {
  padding: 2.5rem 1.5rem 1.5rem 1.5rem;
}

/* The following media queries allow for more padding inside the form as the window
   size increases */
@media screen and (min-width: 24.75em) {
  .form__container {
    padding-left: 2rem;
  }
}

@media screen and (min-width: 30em) {
  .form__container {
    padding-left: 2.5rem;
  }
}

.form__group {
  /* Surrounds the label and input fields, placing the label above the input */
  display: flex;
  flex-direction: column;
  margin-bottom: 1.5rem;
}

.form__label {
  margin-bottom: 0.5rem;
}

.form__field {
  /* Removes the border and the outline highlight when the text field is in focus */
  outline: none;
  border: none;

  /* Re-adds a bottom border which will be replaces when the field is in focus. This
       is going to prevent any jumping when we add the border later */
  border-bottom: 3px solid #fff;

  /* We have to be explicit about our text fields inheriting font properties */
  font-size: inherit;
  font-family: inherit;

  padding: 0.75rem 0.5rem;
  background: var(--background-color);
}

:where(input, select).form__field {
  height: var(--control-height, 2.75rem);
  min-height: var(--control-height, 2.75rem);
  line-height: 1.2;
  padding-top: 0;
  padding-bottom: 0;
  box-sizing: border-box;
}

select.form__field,
.form__select {
  padding-right: 2rem;
}

.button--form {
  height: var(--control-height, 2.75rem);
  min-height: var(--control-height, 2.75rem);
  padding-top: 0;
  padding-bottom: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* When the field is in focus, we change the border colour at the bottom to the accent colour */
.form__field:focus {
  border-bottom: var(--border);
}

.form__small {
  font-size: 0.83rem;
  color: var(--text-muted);
}

.form__link {
  text-decoration: none;
  color: var(--accent-colour);
}

.form__link:hover {
  color: var(--accent-colour-hover, #954a2e);
}

.form__error {
  margin-top: 0.5rem;
}

.form__error,
.form__flash {
  display: block;
  padding: 0.5rem;
  color: var(--text-light);
}

.form__error,
.form__flash--danger {
  background: var(--accent-colour);
}

.form__flash {
  margin: 0.5rem;
}

.form__flash--success {
  background: var(--accent-colour-2);
}

/* Styles specific to the form buttons */
.button--form {
  margin: 2rem 0 0 auto;
  padding: 0.75rem 3rem;
  border: none;
  background: var(--background-color);
}

.button--form:hover {
  background: var(--background-color-hover);
}

/* Styles for the summary section */
.summary-section {
  display: flex;
  justify-content: flex-start;
  gap: 2px; /* Add gap between items */
  margin-top: 20px;
}

.summary-item {
  border: 1px solid #ddd;
  padding: 10px;
  border-radius: 5px;
  background-color: transparent;
  flex: 0 0 auto; /* Prevent items from stretching */
  max-width: 200px; /* Adjust the width as needed */
  font-size: 0.9rem; /* Smaller font size */
}

.summary-item:last-child {
  margin-right: 0;
}

.summary-item p {
  margin: 0;
}

/* Login: no sidebar, full-width content */
body.page--login .sidebar,
body.page--login .sidebar-mobile-toggle,
body.page--login .sidebar-overlay {
  display: none;
}

body.page--login .main {
  margin-left: 0;
}

body.page--login .form {
  border: 3px solid #cdd4da;
  box-shadow: 0.75rem 0.75rem 0 -0.2rem var(--form-shadow-colour, var(--accent-colour));
}

.login-theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border: var(--border);
  border-radius: 50%;
  background: var(--background-color);
  color: var(--text-dark);
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.login-theme-toggle:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
}

.login-theme-toggle__icon {
  width: 1.35rem;
  height: 1.35rem;
}

html.dark-mode body.page--login .login-theme-toggle {
  box-shadow: 0 4px 14px rgba(7, 23, 57, 0.45), 0 0 0 1px rgba(183, 100, 59, 0.35);
}

html.dark-mode body.page--login .login-theme-toggle:hover {
  box-shadow: 0 6px 18px rgba(7, 23, 57, 0.55), 0 0 0 1px rgba(183, 100, 59, 0.45);
}