/* Ported from www's app/dash/dash.less + app/shared/ui/index.less (LESS
   variables computed to plain CSS). Class names match the old React dash so
   the pages look identical. */

[hidden] {
  display: none !important;
}

:root {
  --color-chili-red: hsl(13, 97%, 44%);
  --color-baby-powder: hsl(50, 60%, 98%);
  --color-floral-white: hsl(40, 55%, 96%);
  --color-floral-white-dark: hsl(40, 55%, 86%); /* darken(floral-white, 10%) */
  --color-dim-grey: hsla(60, 3%, 38%, 0.98);
  --color-eerie-black: hsla(0, 0%, 13%, 0.98);
  --color-jasper: hsl(9, 53%, 54%);
  --color-white: hsl(0, 0%, 100%);

  --primary-color: var(--color-chili-red);
  --secondary-color: hsl(44, 86%, 70%);
  --secondary-color-dark: hsl(44, 86%, 16%); /* darken(secondary, 54%) */

  --border-radius-md: 0.75rem;

  --ui-btn-bg-color: var(--primary-color);
  --ui-btn-color: var(--color-white);
  --ui-btn-border-color: rgb(155, 35, 2); /* mix(black, chili-red, 30%) */
  --ui-btn-shadow-color: rgba(0, 0, 0, 0.2);
  --ui-outline-color: var(--secondary-color);
  --ui-invalid-color: var(--color-jasper);
  --ui-link-color: var(--color-eerie-black);
  --ui-link-color-faded: hsla(0, 0%, 13%, 0.5);
  --ui-muted-color: var(--color-dim-grey);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  font-family: "Lexend", system-ui, Roboto, sans-serif;
  line-height: 1.25;
  background-color: var(--color-baby-powder);
  color: var(--color-eerie-black);
  font-size: clamp(16px, 1.5vw, 28px);
  height: 100%;
}

/* ---------- ui kit (shared/ui/index.less) ---------- */

.ui-form > *:not(:first-child) {
  margin-top: 1.5rem;
}

.ui-field > *:not(:first-child) {
  margin-top: 0.625rem;
}

.ui-label {
  font-weight: 600;
  user-select: none;
  display: block;
}

.ui-input,
.ui-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font: inherit;
  color: inherit;
  line-height: 1.5;
  outline: 2px solid transparent;
  outline-offset: 2px;
  background-color: var(--color-white);
  border: 1px solid hsl(0, 0%, 0%);
  border-bottom-width: 2px;
  border-radius: 0.75rem;
}

.ui-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  appearance: none;
}

.ui-input--invalid,
.ui-select--invalid,
.ui-form--was-validated .ui-input:invalid,
.ui-form--was-validated .ui-select:invalid {
  border-color: var(--ui-invalid-color);
}

.ui-input:disabled,
.ui-select:disabled {
  background-color: rgba(0, 0, 0, 0.05);
  color: rgba(0, 0, 0, 0.5);
  border-color: rgba(0, 0, 0, 0.1);
}

.ui-input:focus,
.ui-select:focus {
  border-color: var(--ui-outline-color);
  box-shadow: 0 0 0 0.25rem hsla(44, 86%, 70%, 0.25);
}

.ui-btn {
  --btn-color: var(--ui-btn-color);
  --btn-bg-color: var(--ui-btn-bg-color);
  --btn-shadow-color: var(--ui-btn-shadow-color);
  --btn-border-color: var(--ui-btn-border-color);

  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  padding: 0.5em 0.85em;
  cursor: pointer;
  font: inherit;
  background-color: var(--btn-bg-color);
  border: none;
  color: var(--btn-color);
  z-index: 20;
  border-radius: 0.75rem;
  box-shadow:
    var(--btn-shadow-color) 0px 3px 8px,
    var(--btn-border-color) 0px -2px 1px inset;
  transition:
    box-shadow 0.2s,
    transform 0.2s;
  will-change: box-shadow, transform;
  text-decoration: none;
}

.ui-btn:disabled,
.ui-btn--disabled {
  opacity: 0.5;
}

.ui-btn:hover {
  box-shadow:
    var(--btn-shadow-color) 0px 4px 8px,
    var(--btn-shadow-color) 0px 8px 12px -3px,
    var(--btn-border-color) 0px -3px 2px inset;
  transform: translateY(-1px);
}

.ui-btn:active {
  box-shadow: var(--btn-border-color) 0px -1px 0px;
  transform: translateY(1px);
}

.ui-btn.ui-btn--secondary {
  --btn-color: var(--secondary-color-dark);
  --btn-bg-color: var(--secondary-color);
  --btn-border-color: var(--secondary-color);
  box-shadow: none;
}

.ui-btn:not(.ui-btn--circle).ui-btn--with-icon > .fa-stack {
  margin-right: -8px;
}

.ui-btn:not(.ui-btn--with-icon):not(.ui-btn--circle) > .fa-stack {
  margin: 0 -8px;
}

.ui-btn-icon {
  font-size: 0.8em;
  display: inline-block;
  position: relative;
  width: 2.5em;
  height: 2em;
  line-height: 2em;
  vertical-align: middle;
}

.ui-btn-icon__bg {
  color: var(--btn-color);
}

.ui-btn-icon__fg {
  color: var(--btn-bg-color);
}

.ui-icon__circle {
  color: var(--primary-color);
}

.ui-icon__icon {
  color: var(--color-white);
}

i.fa-solid:not(.fa-stack-1x):not(.fa-stack-2x),
i.fa-regular:not(.fa-stack-1x):not(.fa-stack-2x),
i.fa-brands:not(.fa-stack-1x):not(.fa-stack-2x) {
  display: inline-block;
  min-width: 1em;
  aspect-ratio: 1;
  text-align: center;
}

i.fa-fw:not(.fa-stack-1x):not(.fa-stack-2x) {
  min-width: 1.25em;
}

.ui-link {
  display: inline-block;
  border: none;
  background: none;
  cursor: pointer;
  font: inherit;
  padding: 0;
  color: var(--ui-link-color);
  text-decoration: underline;
  text-decoration-color: var(--ui-link-color-faded);
}

.ui-link:hover {
  text-decoration-color: var(--ui-link-color);
}

.ui-message {
  display: flex;
  gap: 6px;
  align-items: center;
}

.ui-message--error {
  color: var(--ui-invalid-color);
  font-size: 0.875rem;
}

.ui-message--muted {
  color: var(--ui-muted-color);
}

.ui-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.4em 0.8em;
  background-color: var(--primary-color);
  color: var(--color-white);
  border-radius: 9999px;
  font-size: 0.75rem;
}

.ui-checkbox {
  display: grid;
  grid-template-columns: 1rem 1fr;
  column-gap: 0.5rem;
  row-gap: 0.25rem;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.ui-checkbox__label {
  cursor: pointer;
}

.ui-checkbox__input {
  cursor: pointer;
  margin-top: 2px;
}

.ui-checkbox__description {
  font-size: 0.875em;
  color: var(--ui-muted-color);
  grid-column: 2;
}

.ui-help-text {
  font-size: 0.875rem;
  color: var(--color-dim-grey);
}

/* ---------- dash page chrome (dash.less) ---------- */

.dash-page {
  height: max-content;
  min-height: 100%;
  width: 100%;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2rem;
}

.dash-page--sm {
  max-width: 28rem;
}

.dash-page--md {
  max-width: 32rem;
}

.dash-page__top {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.dash-page__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.875rem;
}

.dash-page__back {
  display: flex;
  align-items: center;
  justify-content: center;
}

.dash-page__heading {
  font-size: 1.5rem;
  text-align: center;
  line-height: 1.25;
}

.dash-page__title {
  font-weight: 600;
}

.dash-page__intro {
  font-weight: 300;
}

.dash-page__logo {
  display: flex;
  justify-content: center;
}

.dash-page__logo-img {
  aspect-ratio: 1 / 1;
  width: 3rem;
}

.dash-page__logo--sm .dash-page__logo-img {
  width: 2rem;
}

.dash-page__logo--muted .dash-page__logo-img {
  opacity: 0.3;
}

.dash-page__footer {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem 0;
  color: var(--color-dim-grey);
  text-align: center;
  font-size: 0.8125rem;
}

.dash-page__footer-block {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dash-page__footer-links {
  display: flex;
  gap: 0.875rem;
  justify-content: center;
}

.dash-page__footer-links .ui-link {
  color: var(--color-dim-grey);
  text-decoration: underline;
  text-decoration-color: hsla(60, 3%, 38%, 0.5);
}

.dash-page__footer-links .ui-link:hover {
  text-decoration-color: var(--color-dim-grey);
}

/* ---------- dash building blocks ---------- */

.dash-sections {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dash-section {
  border-radius: var(--border-radius-md);
  background-color: var(--color-floral-white);
  overflow: hidden;
  padding: 1.5rem;
}

.dash-section--spaced > *:not(:first-child) {
  margin-top: 1rem;
}

.dash-section--centered {
  text-align: center;
}

.dash-deck-carousel {
  position: relative;
}

@keyframes dash-deck-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.dash-deck--fade-in {
  animation: dash-deck-fade-in 0.25s ease;
}

@media (prefers-reduced-motion: reduce) {
  .dash-deck--fade-in {
    animation: none;
  }
}

.dash-deck-carousel__actions {
  position: absolute;
  top: calc(50% - 50px);
  left: 0;
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 0 0.25rem;
  pointer-events: none;
  z-index: 5;
}

.dash-deck-carousel__btn {
  pointer-events: auto;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.5rem;
}

.dash-deck-carousel__btn:disabled {
  opacity: 0.25;
  cursor: default;
}

.dash-deck {
  display: flex;
  padding: 1.25rem;
  gap: 1rem;
  flex-direction: column;
  align-items: center;
  background-color: var(--color-floral-white);
  border-radius: var(--border-radius-md);
}

.dash-deck__header {
  text-align: center;
  font-size: 0.875rem;
}

.dash-deck__date {
  font-weight: 300;
}

.dash-deck__img {
  aspect-ratio: 1 / 1;
  width: 8.75rem;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

.dash-deck__footer {
  font-size: 0.875rem;
}

.dash-nav {
  background-color: var(--color-floral-white);
  border-radius: var(--border-radius-md);
  padding: 0 0.5rem;
}

.dash-nav__item {
  padding: 0.5rem 0;
}

.dash-nav__item:not(:last-child) {
  border-bottom: 1px solid var(--color-floral-white-dark);
}

.dash-nav__item--danger {
  color: var(--color-dim-grey);
}

.dash-nav__link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: var(--border-radius-md);
  text-decoration: none;
  color: inherit;
  transition: background-color 0.2s ease;
}

.dash-nav__link:hover {
  background-color: var(--color-floral-white-dark);
}

.dash-nav__content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.dash-nav__title {
  font-weight: 600;
}

.dash-nav__icon {
  font-size: 1.125rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.25em;
  height: 1.25em;
}

.dash-nav__chevron {
  color: var(--color-dim-grey);
}

.dash-nav__img {
  aspect-ratio: 1 / 1;
  width: 4rem;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

.dash-info-block__heading {
  font-weight: 600;
  line-height: 1.5;
  font-size: 1.125rem;
}

.dash-info-block__subtext {
  font-weight: 300;
  font-size: 0.875rem;
}

.dash-info-block__content--spaced > *:not(:first-child) {
  margin-top: 0.5rem;
}

.dash-info-block__content--flexing {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.dash-info-block__content--muted {
  color: var(--color-dim-grey);
  font-size: 0.875rem;
}

.dash-info-block--muted {
  color: var(--color-dim-grey);
  font-size: 0.875rem;
}

.dash-info-block--muted .dash-info-block__heading {
  font-size: 1rem;
}

.dash-flash-message {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  max-width: 16rem;
  border-radius: var(--border-radius-md);
  box-shadow: rgba(0, 0, 0, 0.04) 0px 3px 5px;
  font-size: 0.875rem;
}

.dash-flash-message--success {
  background-color: #daf1db;
  color: #2a7e3b;
}

.dash-flash-message--error {
  background-color: #feebe7;
  color: #d13415;
}

.dash-flash-message__content {
  padding: 0.5rem 0.875rem;
}

/* ---------- content-level picker ---------- */

.dash-content-levels {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0.875rem 0;
  font-size: 0.875rem;
  gap: 0.5rem;
}

.dash-content-levels__item {
  padding: 0.5rem 0.875rem;
  white-space: nowrap;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--color-floral-white-dark);
  cursor: pointer;
}

.dash-content-levels__item:hover {
  background-color: var(--color-floral-white-dark);
}

.dash-content-levels__item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.dash-content-levels__item:has(input:checked) {
  background-color: var(--primary-color);
  color: var(--color-white);
  border-color: var(--primary-color);
}

.dash-content-levels__description {
  display: none;
  padding: 0 1rem;
  color: var(--color-dim-grey);
  font-size: 0.875rem;
}

/* Show the description matching the checked level. Level ids are the fixed
   uuids in ui/options.go. */
.dash-content-level-picker:has(input[value="9c6ea3d8-aa0d-4b1e-9a14-acc2aad17abf"]:checked)
  .dash-content-levels__description[data-level="9c6ea3d8-aa0d-4b1e-9a14-acc2aad17abf"],
.dash-content-level-picker:has(input[value="99d1b983-b900-41ef-8517-7cc6abc50651"]:checked)
  .dash-content-levels__description[data-level="99d1b983-b900-41ef-8517-7cc6abc50651"],
.dash-content-level-picker:has(input[value="edd0dc86-a01f-4006-8292-85cbfd6ad027"]:checked)
  .dash-content-levels__description[data-level="edd0dc86-a01f-4006-8292-85cbfd6ad027"],
.dash-content-level-picker:has(input[value="cb65cc05-15ba-491c-84dd-de6038940c91"]:checked)
  .dash-content-levels__description[data-level="cb65cc05-15ba-491c-84dd-de6038940c91"] {
  display: block;
}

/* ---------- birthdays ---------- */

.dash-birthday-grid {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.dash-birthday-grid__row {
  display: grid;
  grid-template-columns: 2fr 1fr auto;
  gap: 0.5rem;
  align-items: center;
}

.dash-birthday-grid__row--removed .ui-select,
.dash-birthday-grid__row--removed .ui-input {
  opacity: 0.45;
}

.dash-birthday-add {
  display: flex;
  justify-content: flex-end;
}

.dash-birthday-empty {
  color: var(--ui-muted-color);
  text-align: center;
  font-size: 0.875rem;
}

/* ---------- thank-you ---------- */

.dash-thank-you {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin: 2rem 0;
}

.dash-thank-you__icon {
  color: var(--primary-color);
  font-size: 3rem;
}

.dash-thank-you__text {
  font-size: 0.875rem;
}

/* ---------- misc ---------- */

.dash-home-bridge-img {
  max-width: 100%;
  margin-top: 1rem;
}

.error-main {
  flex: 1;
  display: flex;
  align-items: center;
  text-align: center;
  justify-content: center;
}

.error-main h1 {
  margin-bottom: 0.25rem;
}
