/* Jae's Cakes — shared design tokens.

   A patisserie palette rather than the shop's old website colours: a warm blush
   paper, berry glaze for the brand and every primary action, baked caramel for
   anything countable (the tray, prices, order numbers), and pistachio reserved
   for a good state. Text sits on deep cocoa-plum, never plain black. */

:root {
  /* neutrals — warm, never grey */
  --ink: #3a2128;
  --ink-soft: #6a4c53;
  --muted: #9c8087;
  --paper: #faede5;
  --paper-deep: #f3ded2;
  --card: #ffffff;
  --line: #eed9cf;
  --line-strong: #dfbeb1;

  /* berry — the brand, and every primary action */
  --berry: #c04a63;
  --berry-deep: #9b3149;
  --berry-soft: #e7a6b4;
  --berry-wash: #fceef1;

  /* caramel — anything countable: the tray, prices, order numbers */
  --caramel: #c9862f;
  --caramel-deep: #8f5c1a;
  --caramel-soft: #e2b880;
  --caramel-wash: #fbf0dd;

  /* pistachio — a good state only: open, confirmed, ready */
  --pistachio: #6f9463;
  --pistachio-deep: #4c6a42;
  --pistachio-soft: #b7cdac;
  --pistachio-wash: #eef4ea;

  /* alert — errors, sold out, destructive */
  --alert: #a8342f;
  --alert-soft: #e6b3ae;
  --alert-wash: #fbeae6;

  /* type */
  --display: "Playfair Display", Georgia, "Times New Roman", serif;
  --body: "Karla", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* the eyebrow / label treatment used throughout both screens */
  --label-size: 0.688rem;
  --label-spacing: 0.16em;

  /* geometry */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(58, 33, 40, 0.06);
  --shadow: 0 2px 4px rgba(58, 33, 40, 0.05), 0 10px 30px -14px rgba(58, 33, 40, 0.24);
  --shadow-lg: 0 4px 8px rgba(58, 33, 40, 0.06), 0 24px 60px -22px rgba(58, 33, 40, 0.32);

  --page-max: 1120px;
  --ease: cubic-bezier(0.22, 0.68, 0.35, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Screens and panels are toggled with the hidden attribute, and several of them
   carry a display: grid/flex class. Without !important the class wins and the
   "hidden" element stays on screen. */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -0.012em;
  margin: 0;
}

p {
  margin: 0;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
}

a {
  color: var(--berry-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* Focus is always visible — this is the accessibility floor, not a style. */
:focus-visible {
  outline: 2px solid var(--berry);
  outline-offset: 2px;
  border-radius: 3px;
}

/* The small uppercase eyebrow that labels every region on both screens. */
.eyebrow {
  font-family: var(--body);
  font-size: var(--label-size);
  font-weight: 700;
  letter-spacing: var(--label-spacing);
  text-transform: uppercase;
  color: var(--berry);
  margin: 0;
}

.mono {
  font-family: var(--mono);
  font-feature-settings: "tnum" 1;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------- controls */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.72rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.938rem;
  letter-spacing: 0.005em;
  transition: background 0.18s var(--ease), color 0.18s var(--ease),
    border-color 0.18s var(--ease), transform 0.18s var(--ease);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--berry);
  color: #fff;
}

.btn--primary:hover:not(:disabled) {
  background: var(--berry-deep);
}

.btn--ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
}

.btn--ghost:hover:not(:disabled) {
  border-color: var(--berry);
  color: var(--berry-deep);
}

.btn--danger {
  background: transparent;
  color: var(--alert);
  border: 1px solid var(--alert-soft);
}

.btn--danger:hover:not(:disabled) {
  background: var(--alert-wash);
}

.btn--sm {
  padding: 0.44rem 0.8rem;
  font-size: 0.844rem;
}

/* ------------------------------------------------------------------ fields */

.field {
  display: block;
  margin-bottom: 1rem;
}

.field__label {
  display: block;
  font-size: 0.813rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 0.32rem;
}

.field__hint {
  display: block;
  font-size: 0.813rem;
  font-weight: 400;
  color: var(--muted);
  margin-top: 0.28rem;
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 0.62rem 0.75rem;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--berry);
  box-shadow: 0 0 0 3px var(--berry-wash);
}

.input[aria-invalid="true"],
.textarea[aria-invalid="true"] {
  border-color: var(--alert);
}

.textarea {
  min-height: 5.5rem;
  resize: vertical;
}

.field__error {
  display: block;
  font-size: 0.813rem;
  color: var(--alert);
  margin-top: 0.28rem;
}

/* ---------------------------------------------------------------- messages */

.notice {
  display: flex;
  gap: 0.7rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.938rem;
  border: 1px solid transparent;
}

.notice--error {
  background: var(--alert-wash);
  border-color: var(--alert-soft);
  color: var(--alert);
}

.notice--ok {
  background: var(--pistachio-wash);
  border-color: var(--pistachio-soft);
  color: var(--pistachio-deep);
}

.notice--warn {
  background: var(--caramel-wash);
  border-color: var(--caramel-soft);
  color: var(--caramel-deep);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
