/* Atelier – zajednički izgled (stranica za klijentice i nadzorna ploča) */

@font-face {
  font-family: 'Bodoni Moda';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(/fonts/bodoni-moda-latin-standard-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Bodoni Moda';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(/fonts/bodoni-moda-latin-ext-standard-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Bodoni Moda';
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url(/fonts/bodoni-moda-latin-standard-italic.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Bodoni Moda';
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url(/fonts/bodoni-moda-latin-ext-standard-italic.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fonts/jost-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fonts/jost-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ivory: #f9f6ef; /* slonovača – podloga */
  --ivory-2: #f3ede1; /* dublja slonovača – plohe */
  --champagne: #eadcc4; /* šampanjac – centimetar, odabrano */
  --champagne-2: #f2e9d9; /* svijetli šampanjac */
  --gold: #a8865a; /* prigušena zlatna – niti, detalji */
  --gold-ink: #85683e; /* zlatna za tekst (dovoljan kontrast) */
  --charcoal: #2e2b27; /* ugljen – tekst */
  --charcoal-2: #6a6359; /* ugljen, svjetliji – sporedni tekst */
  --hair: rgba(46, 43, 39, 0.14);
  --hair-2: rgba(46, 43, 39, 0.26);
  --wine: #8c3b3b;
  --sage: #55704f;

  --serif: 'Bodoni Moda', Didot, 'Bodoni 72', 'Bodoni MT', Georgia, serif;
  --sans: 'Jost', Futura, 'Century Gothic', 'Avenir Next', system-ui, sans-serif;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-thread: cubic-bezier(0.65, 0.05, 0.36, 1);
  --slow: 650ms;
}

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

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

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--ivory);
  color: var(--charcoal);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  font-family: var(--serif);
  font-weight: 400;
  font-optical-sizing: auto;
  line-height: 1.12;
  margin: 0;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: color var(--slow) var(--ease), text-decoration-color var(--slow) var(--ease);
}
a:hover {
  color: var(--gold-ink);
}

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

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

:focus-visible {
  outline: 2px solid var(--gold-ink);
  outline-offset: 3px;
  border-radius: 2px;
}

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

.num {
  font-variant-numeric: tabular-nums lining-nums;
}

/* ---- gumbi: polagano širenje i prijelaz boje ---- */

.btn {
  --btn-bg: var(--charcoal);
  --btn-fg: var(--ivory);
  --btn-border: var(--charcoal);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  min-height: 3rem;
  padding: 0.8rem 1.75rem;
  border: 1px solid var(--btn-border);
  border-radius: 2px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 700ms var(--ease),
    background-color 900ms var(--ease),
    color 900ms var(--ease),
    border-color 900ms var(--ease);
}
.btn:hover {
  transform: scale(1.025);
  --btn-bg: #47423b;
  --btn-border: #47423b;
}
.btn:active {
  transform: scale(0.995);
  transition-duration: 200ms;
}
.btn[disabled],
.btn[aria-disabled='true'] {
  cursor: not-allowed;
  opacity: 0.38;
  transform: none;
}

.btn-line {
  --btn-bg: transparent;
  --btn-fg: var(--charcoal);
  --btn-border: var(--hair-2);
}
.btn-line:hover {
  --btn-bg: var(--champagne-2);
  --btn-border: var(--gold);
}

.btn-quiet {
  --btn-bg: transparent;
  --btn-fg: var(--charcoal);
  --btn-border: transparent;
  padding-inline: 0.25rem;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-underline-offset: 0.3em;
}
.btn-quiet:hover {
  --btn-bg: transparent;
  --btn-border: transparent;
  --btn-fg: var(--gold-ink);
  transform: none;
}

.btn-danger {
  --btn-bg: transparent;
  --btn-fg: var(--wine);
  --btn-border: rgba(140, 59, 59, 0.35);
}
.btn-danger:hover {
  --btn-bg: rgba(140, 59, 59, 0.07);
  --btn-border: var(--wine);
}

.btn-small {
  min-height: 2.4rem;
  padding: 0.45rem 1rem;
  font-size: 0.875rem;
}

/* ---- polja: crta ispod se iscrtava zlatnim koncem kod upisa ---- */

.field {
  display: grid;
  gap: 0.35rem;
  align-content: start; /* polje se ne rasteže do visine susjednog polja s napomenom */
  position: relative;
}
.field > label,
.field-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--charcoal-2);
}
.field-hint {
  font-size: 0.8125rem;
  color: var(--charcoal-2);
}
.field-error {
  font-size: 0.8125rem;
  color: var(--wine);
}

.input-wrap {
  position: relative;
}
.input-wrap::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 900ms var(--ease-thread);
}
.input-wrap:focus-within::after {
  transform: scaleX(1);
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 0.6rem 0 0.55rem;
  border: 0;
  border-bottom: 1px solid var(--hair-2);
  border-radius: 0;
  background: transparent;
  font-size: 1.0625rem;
  transition: border-color var(--slow) var(--ease);
}
.textarea {
  min-height: 7.5rem;
  resize: vertical;
  line-height: 1.6;
}
.select {
  appearance: none;
  padding-right: 1.5rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--charcoal-2) 50%), linear-gradient(135deg, var(--charcoal-2) 50%, transparent 50%);
  background-position: calc(100% - 9px) 55%, calc(100% - 4px) 55%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
}
.input:focus-visible,
.textarea:focus-visible,
.select:focus-visible {
  outline: none;
}
.input[aria-invalid='true'],
.textarea[aria-invalid='true'] {
  border-bottom-color: var(--wine);
}
.input::placeholder,
.textarea::placeholder {
  color: #9b9389;
}

.check {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  font-size: 0.9375rem;
  line-height: 1.5;
  cursor: pointer;
}
.check input {
  appearance: none;
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0.17rem 0 0;
  border: 1px solid var(--charcoal-2);
  border-radius: 1px;
  background: transparent;
  display: grid;
  place-content: center;
  cursor: pointer;
  transition: background-color var(--slow) var(--ease), border-color var(--slow) var(--ease);
}
.check input::after {
  content: '';
  width: 0.55rem;
  height: 0.3rem;
  border-left: 1.5px solid var(--ivory);
  border-bottom: 1.5px solid var(--ivory);
  transform: translateY(-1px) rotate(-45deg) scale(0);
  transition: transform 400ms var(--ease);
}
.check input:checked {
  background: var(--charcoal);
  border-color: var(--charcoal);
}
.check input:checked::after {
  transform: translateY(-1px) rotate(-45deg) scale(1);
}

/* ---- crteži: konac se iscrtava ---- */

.art {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.art .ln {
  fill: none;
  stroke: var(--charcoal);
  stroke-width: 1.15;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
}
.art .ln-soft {
  stroke: var(--charcoal-2);
  stroke-width: 0.8;
  opacity: 0.75;
}
.art .ln-needle {
  stroke-width: 1.6;
}
.art .ln-mask {
  stroke: #fff;
  stroke-width: 9;
}
.art .st {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-dasharray: 4 3.2;
}
.art .st-ticks {
  stroke-width: 3;
  stroke-dasharray: 0.9 3.2;
  stroke-linecap: butt;
}
.art .st-thread {
  stroke-dasharray: none;
  stroke-width: 1;
}
.art .pin {
  fill: var(--gold);
  opacity: 0;
}

.is-drawn .art .ln {
  animation: thread-draw 2.1s var(--ease-thread) forwards;
  animation-delay: calc(var(--d, 0s) * var(--pace, 1));
}
.is-drawn .art .ln-mask {
  animation-duration: 1.5s;
}
.is-drawn .art .pin {
  animation: pin-in 700ms var(--ease) forwards;
  animation-delay: calc(var(--d, 0s) * var(--pace, 1));
}

@keyframes thread-draw {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes pin-in {
  to {
    opacity: 1;
  }
}

/* ---- pojavljivanje: lagano, s kašnjenjem jedan za drugim ---- */

.rise {
  opacity: 0;
  transform: translateY(16px);
  animation: rise 1s var(--ease) forwards;
  animation-delay: calc(var(--base, 0ms) + var(--i, 0) * 120ms);
}
@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---- prošiveni rub: obrub se iscrtava kao bod igle (gore → desno → dolje → lijevo) ---- */

@property --seam {
  syntax: '<number>';
  inherits: false;
  initial-value: 0;
}

.seam {
  position: relative;
}
.seam::after {
  content: '';
  position: absolute;
  inset: var(--seam-inset, 0);
  pointer-events: none;
  --c: var(--seam-color, var(--gold));
  --t: clamp(0, var(--seam) * 4, 1);
  --r: clamp(0, var(--seam) * 4 - 1, 1);
  --b: clamp(0, var(--seam) * 4 - 2, 1);
  --l: clamp(0, var(--seam) * 4 - 3, 1);
  background:
    repeating-linear-gradient(90deg, var(--c) 0 7px, transparent 7px 11px) left top / calc(var(--t) * 100%) 1px no-repeat,
    repeating-linear-gradient(180deg, var(--c) 0 7px, transparent 7px 11px) right top / 1px calc(var(--r) * 100%) no-repeat,
    repeating-linear-gradient(270deg, var(--c) 0 7px, transparent 7px 11px) right bottom / calc(var(--b) * 100%) 1px no-repeat,
    repeating-linear-gradient(0deg, var(--c) 0 7px, transparent 7px 11px) left bottom / 1px calc(var(--l) * 100%) no-repeat;
}
.seam.is-sewn::after {
  animation: seam-sew var(--seam-time, 1.8s) var(--ease-thread) forwards;
}
.seam.is-sewn-static::after {
  --seam: 1;
}
@keyframes seam-sew {
  from {
    --seam: 0;
  }
  to {
    --seam: 1;
  }
}

/* ---- izbor jedne od opcija (npr. Tjedan / Mjesec) ---- */

.seg {
  display: inline-flex;
  border: 1px solid var(--hair-2);
  border-radius: 999px;
  padding: 3px;
}
.seg button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 0.35rem 0.95rem;
  font-size: 0.875rem;
  cursor: pointer;
  color: var(--charcoal-2);
  transition: background-color 800ms var(--ease), color 800ms var(--ease);
}
.seg button[aria-pressed='true'] {
  background: var(--charcoal);
  color: var(--ivory);
}

/* ---- obavijesti ---- */

.notice {
  padding: 0.9rem 1.1rem;
  border-left: 2px solid var(--gold);
  background: var(--champagne-2);
  font-size: 0.9375rem;
}
.notice-error {
  border-left-color: var(--wine);
  background: rgba(140, 59, 59, 0.06);
  color: #6e2a2a;
}
.notice-ok {
  border-left-color: var(--sage);
  background: rgba(85, 112, 79, 0.08);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
  .btn:hover {
    transform: none;
  }
}
