/* Reset + shared components (buttons, inputs). Reused by every producer page.
   All sizes are in rem. The root font size grows with the screen width, so the
   whole page scales up on big monitors. Change the middle value (1.25vw) to make
   everything bigger or smaller everywhere. */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: clamp(17px, 1.25vw, 26px);
  height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--page-bg);
  color: var(--neutral-100);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
}

img { display: block; max-width: 100%; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--blue-600);
  outline-offset: 2px;
}

/* Input field: label + input (+ optional error text) */
.field { display: flex; flex-direction: column; gap: 0.75rem; }

.field__label { font-weight: 500; }

.field__input {
  width: 100%;
  padding: 1rem;
  background: var(--neutral-0);
  border: 1px solid var(--neutral-30);
  border-radius: var(--radius-input);
  box-shadow: var(--shadow-xs);
  font: 400 1rem/1.5 var(--font-body);
  color: var(--neutral-100);
}
.field__input::placeholder { color: var(--neutral-60); }
.field__input:focus { outline: none; border-color: var(--blue-600); }

/* Primary button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 3.125rem;
  padding: 0 1.5rem;
  border: 0;
  border-radius: var(--radius-button);
  font: 500 1rem/1.25rem var(--font-display);
  cursor: pointer;
  text-decoration: none;
}
.btn--primary {
  background: var(--blue-600);
  color: var(--neutral-0);
  box-shadow: 0 0.25rem 0.625rem var(--blue-shadow);
}
.btn--primary:hover { filter: brightness(0.95); }
.btn--block { width: 100%; }

/* Secondary button */
.btn--secondary {
  background: var(--neutral-0);
  color: var(--neutral-100);
  border: 1px solid var(--neutral-30);
}
.btn--secondary:hover { background: var(--page-bg); }

/* Blue text link */
.link {
  color: var(--blue-600);
  font-weight: 500;
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}
.link:hover { text-decoration: underline; }

/* Password field with show/hide eye button (button is added by js/password-toggle.js) */
.password-wrap { position: relative; }
.field .password-wrap .field__input { padding-right: 3.5rem; }

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.75rem;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  transform: translateY(-50%);
  background: none;
  border: 0;
  border-radius: 0.5rem;
  color: var(--neutral-60);
  cursor: pointer;
}
.password-toggle:hover { color: var(--neutral-100); }
.password-toggle svg { width: 1.375rem; height: 1.375rem; }

/* Status badge: <span class="badge badge--active">Active</span> */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 100px;
  font: 500 0.75rem/normal var(--font-body);
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: var(--badge-dot, currentColor);
}
.badge--active    { background: var(--green-50);  color: var(--green-700);       --badge-dot: var(--green-500); }
.badge--pending   { background: var(--orange-50); color: var(--orange-700);      --badge-dot: var(--orange-500); }
.badge--completed { background: #f2f2f2;          color: var(--neutral-text-soft); --badge-dot: #98a2b3; }

/* Compact field (used by signup and the in-app forms) */
.field--compact { gap: 0.5rem; }
.field--compact .field__label { font-size: 0.875rem; }
.field--compact .field__input {
  height: 3rem;
  padding: 0 1rem;
  border-radius: 0.625rem;
  box-shadow: none;
  font-size: 0.875rem;
}
.field-row { display: flex; gap: 1rem; }
.field-row > .field { flex: 1; min-width: 0; }

select.field__input {
  appearance: none;
  padding-right: 2.75rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' fill='none' stroke='%23878787' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4.5 6.75 4.5 4.5 4.5-4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.125rem;
  cursor: pointer;
}
select.field__input:invalid { color: var(--neutral-60); }

.field__hint { margin: 0; color: var(--neutral-60); font-size: 0.75rem; }


.btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

/* Make the hidden attribute always win over display rules */
[hidden] { display: none !important; }

.badge--purchased { background: var(--blue-100); color: var(--blue-700); --badge-dot: var(--blue-600); }
.badge--expired   { background: var(--red-50);   color: var(--red-700);  --badge-dot: var(--red-500); }

/* Alert levels */
.badge--high   { background: var(--red-50);    color: var(--red-700);    --badge-dot: var(--red-500); }
.badge--medium { background: var(--orange-50); color: var(--orange-700); --badge-dot: var(--orange-500); }
.badge--info   { background: var(--blue-100);  color: var(--blue-700);   --badge-dot: var(--blue-600); }

/* Field with an error: red border + message under the box */
.field--error .field__input { border-color: var(--red-500); }
.field__error { margin: 0; color: var(--red-600); font-size: 0.75rem; }

/* Red message box (for example "Incorrect email or password") */
.alert-box {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.75rem 0.875rem;
  background: var(--red-50);
  border: 1px solid var(--red-border);
  border-radius: 0.75rem;
  color: var(--red-700);
}
.alert-box .icon { display: inline-grid; flex-shrink: 0; color: var(--red-600); margin-top: 0.125rem; }
.alert-box .icon svg { width: 1.125rem; height: 1.125rem; }
.alert-box__title { margin: 0; font: 500 0.875rem/1.5 var(--font-body); }
.alert-box__text { margin: 0.125rem 0 0; font-size: 0.8125rem; line-height: 1.5; }
