/* ============================================================
 * Auth + Account — dva v3
 *
 * Namespaces:
 *   .auth-*  login, registration, forgot/reset password
 *   .acc-*   /moj-nalog hub + sub-pages
 *
 * Reuses .form-field, .flash-banner, .summary-row from cart.css.
 * Buttons reuse .hp-btn{-primary|-secondary|-ghost}.
 * ============================================================ */


/* ── Auth (login / registration / password reset) ────────── */
/*
 * Centered narrow card on a tinted page background — matches the
 * focused single-task vocabulary used by the rest of the site for
 * dedicated flows. Reuses the .form-field stack from cart.css.
 */

.auth {
  background: #ffffff;
  padding: clamp(40px, 8vw, 96px) 16px;
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Standalone variant: full-bleed dark navy page (matches footer),
   white card centered on it. Used by /prijava, /registracija,
   /zaboravljena-lozinka, /resetovanje-lozinke — no chrome around
   them. */
body.auth-standalone { margin: 0; background: #0b1320; }
.auth.auth-dark {
  background: #0b1320;
  min-height: 100vh;
  padding: clamp(40px, 8vw, 96px) 16px;
}
.auth.auth-dark .auth-back { color: rgba(255, 255, 255, 0.65); }
.auth.auth-dark .auth-back:hover { color: #ffffff; }

/* "Back" link above the card — site-wide affordance to escape a
   focused flow without hunting in the nav. */
.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  font-family: var(--hp-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--hp-fg-muted);
  text-decoration: none;
  transition: color 160ms ease;
}
.auth-back:hover { color: var(--hp-accent); }
.auth-back i { font-size: 10px; }

.auth-inner {
  width: 100%;
  max-width: 460px;
  padding: 32px clamp(20px, 5vw, 36px) 28px;
  background: #fff;
  border-radius: 16px;
}

.auth-header { margin-bottom: 28px; text-align: center; }
.auth-eyebrow {
  margin: 0 0 8px;
  font-family: var(--hp-mono);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--hp-accent);
}
.auth-title {
  margin: 0 0 10px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--hp-fg);
}
.auth-lede {
  margin: 0;
  color: var(--hp-fg-muted);
  font-size: 14px;
  line-height: 1.55;
}

.auth-form { display: flex; flex-direction: column; gap: 0; }
.auth-turnstile { margin: 8px 0 16px; display: flex; justify-content: center; }
.auth-submit { width: 100%; justify-content: center; margin-top: 12px; padding: 14px 20px; font-size: 15px; }

/* Auth pages use squarer rectangles instead of the site-wide pill,
   to read as "focused / utility" rather than "marketing CTA". */
.auth .hp-btn { border-radius: 8px; }

.auth-links {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
  margin-bottom: 4px;
}
.auth-link {
  color: var(--hp-accent);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
}
.auth-link:hover { text-decoration: underline; }

.auth-switch {
  text-align: center;
  margin: 28px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--hp-hairline);
  font-size: 14px;
  color: var(--hp-fg-muted);
}
.auth-switch .auth-link { margin-left: 4px; }

.auth-strength { margin-top: 8px; }
.auth-strength[aria-hidden="true"] { display: none; }
.auth-strength-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--hp-hairline);
  transition: width 200ms ease, background 200ms ease;
}
.auth-strength-bar.is-0 { width: 20%; background: #d93025; }
.auth-strength-bar.is-1 { width: 40%; background: #f5a623; }
.auth-strength-bar.is-2 { width: 60%; background: #fbc02d; }
.auth-strength-bar.is-3 { width: 80%; background: #7cb342; }
.auth-strength-bar.is-4 { width: 100%; background: #43a047; }
.auth-strength-label {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--hp-fg-muted);
  font-variant-numeric: tabular-nums;
}


/* ── Account (/moj-nalog hub + sub-pages) ───────────────── */
/*
 * Adopts the site's hp-*/pd-* visual vocabulary:
 *   - flat hairline-separated sections (no rounded-rect cards)
 *   - mono uppercase eyebrow labels matching .pd-eyebrow / .hp-eyebrow
 *   - 30px display title with -0.02em tracking (pd-title scale)
 *   - generous vertical rhythm
 *   - white page bg (no tinted canvas)
 *   - sidebar uses hairline column with accent left-stripe on active
 *
 * Sidebar nav (left, 240px) + content (right) layout. Mobile (<=820px)
 * collapses the sidebar to a horizontal scroll strip above the content.
 */

.acc { background: #ffffff; min-height: 70vh; }
.acc-inner { max-width: 880px; margin: 0 auto; padding: clamp(28px, 6vw, 56px) clamp(16px, 4vw, 24px); }

.acc-shell {}
.acc-shell-inner {
  max-width: 1440px;
  margin: 56px auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 80px;
}
@media (max-width: 820px) {
  .acc-shell-inner { grid-template-columns: 1fr; gap: 40px; }
}

.acc-sidebar {
  position: sticky;
  top: calc(var(--nav-height-utility, 36px) + var(--nav-height-brand, 72px) + 16px);
  align-self: start;
  display: flex;
  flex-direction: column;
  /* Single hairline column on the right edge separates nav from
     content without introducing card chrome. */
  border-right: 1px solid var(--hp-hairline);
  padding-right: 24px;
}
@media (max-width: 820px) {
  .acc-sidebar {
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--hp-hairline);
    padding-right: 0;
    padding-bottom: 24px;
  }
}

.acc-sidebar-greet {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 28px;
}
.acc-sidebar-greet-eyebrow {
  font-family: var(--hp-mono);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--hp-fg-faint);
  margin-bottom: 6px;
}
.acc-sidebar-greet-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--hp-fg);
  letter-spacing: -0.01em;
}
.acc-sidebar-greet-email {
  font-size: 12.5px;
  color: var(--hp-fg-muted);
  margin-top: 2px;
  word-break: break-all;
}

.acc-sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
@media (max-width: 820px) {
  .acc-sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 4px;
    scrollbar-width: thin;
    margin: 0;
    padding-bottom: 4px;
    /* Right-edge fade hints at horizontal scroll. */
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 24px), transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 24px), transparent 100%);
  }
}
.acc-sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 14px;
  text-decoration: none;
  color: var(--hp-fg-muted);
  font-size: 14px;
  font-weight: 500;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
  white-space: nowrap;
  border-left: 2px solid transparent;
  margin-left: -2px; /* aligns the active stripe with the column edge */
}
.acc-sidebar-nav-link i { width: 16px; text-align: center; color: var(--hp-fg-faint); font-size: 13px; }
.acc-sidebar-nav-link:hover { color: var(--hp-fg); }
.acc-sidebar-nav-link:hover i { color: var(--hp-fg); }
.acc-sidebar-nav-link.is-active {
  color: var(--hp-fg);
  font-weight: 600;
  border-left-color: var(--hp-accent);
}
.acc-sidebar-nav-link.is-active i { color: var(--hp-accent); }
@media (max-width: 820px) {
  .acc-sidebar-nav-link { border-left: 0; border-bottom: 2px solid transparent; margin-left: 0; padding: 10px 4px; }
  .acc-sidebar-nav-link.is-active { border-bottom-color: var(--hp-accent); }
}

.acc-sidebar-logout {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--hp-hairline);
}
.acc-sidebar-logout-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px 0 14px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--hp-fg-muted);
  cursor: pointer;
  text-align: left;
  transition: color 140ms ease;
}
.acc-sidebar-logout-btn i { width: 16px; text-align: center; color: var(--hp-fg-faint); font-size: 12px; }
.acc-sidebar-logout-btn:hover { color: var(--hp-fg); }
.acc-sidebar-logout-btn:hover i { color: var(--hp-fg); }

.acc-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(40px, 8vw, 72px); /* matches .hp-section spacing rhythm */
}

.acc-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--hp-fg-faint);
  margin-bottom: 20px;
}
.acc-breadcrumb a { color: var(--hp-fg-muted); text-decoration: none; }
.acc-breadcrumb a:hover { color: var(--hp-accent); }
.acc-breadcrumb i { font-size: 9px; opacity: 0.4; }
.acc-breadcrumb-current { color: var(--hp-fg); font-weight: 600; }

/* Header: matches .pd-eyebrow + .pd-title vocabulary. */
.acc-header { margin: 0 0 24px; }
.acc-eyebrow {
  margin: 0 0 10px;
  font-family: var(--hp-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--hp-fg-muted);
}
.acc-title {
  margin: 0 0 12px;
  font-size: clamp(22px, 5vw, 30px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--hp-fg);
}
.acc-lede { margin: 0; color: var(--hp-fg-muted); font-size: 15px; line-height: 1.55; max-width: 60ch; }

/* Anonymous-visitor block on /moj-nalog* pages. Flat, no card. */
.acc-anon { padding: 40px 0; text-align: left; }
.acc-anon-lede { margin: 0 0 20px; color: var(--hp-fg); font-size: 16px; }
.acc-anon-or {
  margin: 16px 0;
  font-family: var(--hp-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--hp-fg-faint);
  text-transform: uppercase;
  letter-spacing: 0.10em;
}

/*
 * Sections. No card chrome — sections sit flat on the page with a
 * hairline rule above them and a generous mono-eyebrow title. Compose
 * via .acc-content's 56px gap.
 */
.acc-stack { display: flex; flex-direction: column; gap: 56px; }
.acc-section { padding: 0; background: transparent; border: 0; border-radius: 0; }
.acc-section-title {
  margin: 0 0 24px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--hp-hairline);
  font-family: var(--hp-mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--hp-fg-muted);
}
.acc-section-lede {
  margin: -16px 0 24px;
  font-size: 14px;
  color: var(--hp-fg-muted);
  line-height: 1.55;
}
.acc-section-current {
  margin: 0 0 18px;
  color: var(--hp-fg-muted);
  font-size: 13.5px;
}
.acc-section-current strong { color: var(--hp-fg); font-weight: 600; }

/* Danger-zone section — different chrome to flag destructive intent. */
.acc-section-danger {
  padding: 24px 24px 28px;
  border: 1px solid #f6c2bd;
  border-left-width: 3px;
  background: #fffafa;
  border-radius: 8px;
}
.acc-section-danger .acc-section-title {
  border-bottom-color: #f6c2bd;
  color: #8a1f17;
}
.acc-section-warn { margin: 0 0 18px; font-size: 13.5px; color: #8a1f17; line-height: 1.55; }

/* Quicklinks — flat row with hairline border, no shadow lift.
   Auto-fit grid: even spacing at every width, wraps cleanly without
   the 3+1 lopsided rows that space-between produced. */
.acc-quicklinks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  padding: 18px 0;
  border-top: 1px solid var(--hp-hairline);
}
.acc-quicklink {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  width: fit-content;
  text-decoration: none;
  color: var(--hp-fg);
  font-size: 14.5px;
  font-weight: 500;
  transition: color 140ms ease;
}
.acc-quicklink i {
  color: var(--hp-fg-muted);
  width: 18px;
  text-align: center;
  transition: color 140ms ease;
}
.acc-quicklink:hover {
  color: var(--hp-accent);
}
.acc-quicklink:hover i { color: var(--hp-accent); }

.acc-customer-type { display: flex; flex-direction: column; gap: 8px; }
.acc-radio, .acc-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--hp-fg);
  cursor: pointer;
}
.acc-checkbox { display: flex; width: fit-content; margin-bottom: 16px; }
.acc-company-block {
  margin-bottom: 16px;
  padding: 16px;
  background: #fafbfd;
  border-radius: 8px;
}

.hp-btn-danger {
  background: #d93025;
  color: #fff;
  border-color: #d93025;
}
.hp-btn-danger:hover, .hp-btn-danger:focus-visible {
  filter: brightness(0.95);
  transform: translateY(-1px);
  outline: none;
}
.hp-btn-sm { padding: 8px 14px; font-size: 13px; }

/* Empty state — flat, generous, no border. Matches .crt-empty rhythm. */
.acc-empty {
  padding: 64px 0;
  text-align: center;
  color: var(--hp-fg-muted);
  font-size: 14.5px;
  line-height: 1.55;
  border: 1px dashed var(--hp-hairline-strong);
  border-radius: 12px;
  background: transparent;
}

/* Address list — hairline-separated rows, not floating cards. */
.acc-address-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--hp-hairline);
}
.acc-address {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  padding: 22px 4px;
  border-bottom: 1px solid var(--hp-hairline);
  align-items: start;
}
.acc-address-main { min-width: 0; }
.acc-address-name { margin: 0 0 6px; font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 10px; color: var(--hp-fg); }
.acc-address-default {
  font-family: var(--hp-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--hp-fg-muted);
  background: transparent;
  border: 1px solid var(--hp-hairline-strong);
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.acc-address-line { margin: 2px 0; font-size: 13.5px; color: var(--hp-fg-muted); line-height: 1.55; }
.acc-address-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.acc-address-form { margin: 0; }
.acc-address-delete { color: #8a1f17; }
.acc-address-delete:hover { background: #fdecea; }

/* Order list — hairline-separated rows, mono code. */
.acc-order-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--hp-hairline); }
.acc-order { border-bottom: 1px solid var(--hp-hairline); }
.acc-order-link {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  gap: 24px;
  align-items: center;
  padding: 18px 4px;
  text-decoration: none;
  color: var(--hp-fg);
  transition: padding 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
.acc-order-link:hover { padding-left: 10px; }
.acc-order-link:hover .acc-order-chev { color: var(--hp-accent); transform: translateX(3px); }
.acc-order-code { font-family: var(--hp-mono); font-weight: 700; font-size: 13.5px; letter-spacing: 0.02em; }
.acc-order-date { color: var(--hp-fg-muted); font-size: 13px; font-family: var(--hp-mono); }
.acc-order-meta { color: var(--hp-fg-faint); font-size: 12.5px; }
.acc-order-total { font-weight: 700; font-variant-numeric: tabular-nums; font-family: var(--hp-mono); font-size: 14px; }
.acc-order-chev { color: var(--hp-fg-faint); font-size: 11px; transition: color 140ms ease, transform 180ms cubic-bezier(0.16, 1, 0.3, 1); }

/* Header logout button — styled like a link */
.nav-utility-logout { display: inline; margin: 0; }
.nav-utility-logout-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.nav-utility-logout-btn:hover { color: var(--hp-accent); }

/* ===== Typed inputs (typed-inputs.js) ===== */

/* 6-box OTP */
.ti-otp {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin: 4px 0 12px;
}
.ti-otp[data-len="4"] { grid-template-columns: repeat(4, 1fr); }
.ti-otp[data-len="5"] { grid-template-columns: repeat(5, 1fr); }
.ti-otp-cell {
  width: 100%;
  aspect-ratio: 1 / 1.1;
  text-align: center;
  font-family: var(--hp-mono);
  font-size: 28px;
  font-weight: 600;
  color: var(--hp-fg);
  background: #fff;
  border: 2px solid var(--hp-hairline);
  border-radius: 12px;
  padding: 0;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 60ms ease;
  caret-color: var(--hp-accent);
}
.ti-otp-cell:focus {
  outline: none;
  border-color: var(--hp-accent);
  box-shadow: 0 0 0 4px var(--hp-accent-soft);
}
.ti-otp.ti-shake { animation: ti-shake 420ms ease both; }
@keyframes ti-shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px); }
  40%, 60% { transform: translateX(8px); }
}
@media (max-width: 480px) {
  .ti-otp { gap: 6px; }
  .ti-otp-cell { font-size: 22px; border-radius: 10px; }
}

/* Email typo suggestion */
.ti-typo-hint {
  margin: 6px 0 0;
  padding: 8px 12px;
  background: #fff7e0;
  border: 1px solid #f0d57a;
  border-radius: 8px;
  color: #6b5300;
  font-size: 13px;
}
.ti-typo-fix {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: #6b5300;
  text-decoration: underline;
  cursor: pointer;
}
.ti-typo-fix:hover { color: #3f3000; }

/* Phone country flag */
.ti-phone-wrap {
  position: relative;
  display: block;
}
.ti-phone-flag {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  line-height: 1;
  pointer-events: none;
  opacity: 0.95;
}
.ti-phone-input { padding-left: 38px !important; }

/* ────────────────────────────────────────────────────────────
 * Responsive sweep
 * ──────────────────────────────────────────────────────────── */

/* Tablet (sidebar collapse happens at 820px; address row, order list,
   and empty state ease up here). */
@media (max-width: 820px) {
  /* Trim wasted vertical space on phone — hide eyebrow + email in
     the greet block, keep just the name inline above the scroll nav. */
  .acc-sidebar-greet { margin-bottom: 16px; }
  .acc-sidebar-greet-eyebrow,
  .acc-sidebar-greet-email { display: none; }
  .acc-sidebar-greet-name { font-size: 15px; }
}

/* Below ~640px the 5-column .acc-order-link grid breaks. Collapse to
   a 2-row layout: code+chev on row 1, date/meta/total below. */
@media (max-width: 640px) {
  .acc-order-link {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "code chev"
      "meta meta";
    row-gap: 8px;
    column-gap: 12px;
  }
  .acc-order-code { grid-area: code; }
  .acc-order-chev { grid-area: chev; }
  .acc-order-date,
  .acc-order-meta,
  .acc-order-total {
    grid-area: meta;
    display: inline-block;
  }
  /* Use a flex row inside the "meta" cell for date / total. */
  .acc-order-link {
    /* override the grid above to a flex column on phones for cleaner stacking */
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }
  .acc-order-link .acc-order-code { font-size: 14px; }
  .acc-order-link .acc-order-date,
  .acc-order-link .acc-order-meta { font-size: 12.5px; }
  .acc-order-link .acc-order-total {
    margin-top: 4px;
    align-self: flex-start;
    font-size: 15px;
  }
  .acc-order-link .acc-order-chev { display: none; }
}

/* Address row: stack actions beneath at narrow widths so long Serbian
   action labels don't crush each other in the right column. */
@media (max-width: 520px) {
  .acc-address {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .acc-address-actions {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
  }
}

/* Empty state: padding eases up on small screens. */
@media (max-width: 600px) {
  .acc-empty {
    padding: clamp(32px, 8vw, 64px) 16px;
  }
}

/* Form fields hit the iOS 16px auto-zoom floor on phones. */
@media (max-width: 600px) {
  .form-field-input,
  .form-field-textarea,
  .form-field-select { font-size: 16px; }
}
