/*
 * migrations/phase19/register.css
 * Source for: catalog/view/javascript/esklad/register.css
 *
 * Phase 19 — Register page redesign (UI only).
 * Aesthetic: same "Quiet competence — Swiss editorial restraint" as the
 * checkout wizard (Phase 17). Hairline rules, generous whitespace, type-
 * driven hierarchy, ink + teal accent palette. No textures, no watermarks.
 *
 * UI-only refactor: every input keeps its `name`, classes, and JS hooks
 * intact so OC's submit + custom_field reorder JS + datetimepicker all work.
 *
 * Scoping: every selector is rooted under .esklad-register-stage (added by
 * the OCMod immediately after {{ header }}). Isolates from the rest of site.
 */

.esklad-register-stage {
  /* Tonal palette — same tokens as checkout_wizard.css */
  --ink:        #02174c;
  --ink-muted:  #5a6772;
  --ink-faint:  #9aa3ad;
  --teal:       #0af886;
  --teal-soft:  rgba(0, 169, 157, 0.08);
  --teal-line:  rgba(0, 169, 157, 0.22);
  --line:       #e6e8eb;
  --line-soft:  #f0f1f3;
  --paper:      #ffffff;
  --canvas:     #fafaf8;
  --error:      #c73b3b;

  color: var(--ink);
  font-feature-settings: "kern", "liga", "calt";
}

.esklad-register-stage *,
.esklad-register-stage *::before,
.esklad-register-stage *::after { box-sizing: border-box; }

/* ─── Suppress native chrome ─── */
.esklad-register-stage .breadcrumb,
.esklad-register-stage h1.title.page-title,
.esklad-register-stage h1.page-title,
.esklad-register-stage .esklad-register-hide,
.esklad-register-stage #column-left,
.esklad-register-stage #column-right,
.esklad-register-stage aside.column-left,
.esklad-register-stage aside.column-right { display: none !important; }

/* ─── Page canvas ─── */
.esklad-register-stage #account-register.container {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background: var(--canvas);
}
/* Journal 3 sets `.row { display: flex; flex-grow: 1 }` and
   `.row > div { flex-grow: 1 }`. With column_left/column_right hidden,
   we force the row + #content to span the full container width so our
   shell can center via its own margin: 0 auto. */
.esklad-register-stage #account-register > .row {
  display: flex !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: 1 1 100% !important;
}
.esklad-register-stage #account-register #content,
.esklad-register-stage #account-register [id="content"] {
  width: 100% !important;
  max-width: 100% !important;
  flex: 1 1 100% !important;
  margin: 0 !important;
  padding: 40px 24px 56px !important;
  float: none !important;
}

/* ─── Card shell — single white paper card with hairline border ─── */
.esklad-register__shell {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}

/* ─── Card header ─── */
.esklad-register__header {
  padding: 32px 36px 26px;
  border-bottom: 1px solid var(--line);
}
.esklad-register__pill-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.esklad-register__pill-row .num {
  color: var(--ink);
  font-weight: 600;
}
.esklad-register__pill-row .sep {
  width: 14px;
  height: 1px;
  background: var(--line);
  display: inline-block;
}
.esklad-register__title {
  font-family: inherit;
  font-weight: 600;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 10px;
}
.esklad-register__sub {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-muted);
  margin: 0 0 18px;
  max-width: 56ch;
}
.esklad-register__already {
  font-size: 13px;
  color: var(--ink-muted);
  margin: 0;
}
.esklad-register__already a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--teal-line);
  padding-bottom: 1px;
  transition: border-color 0.15s ease;
}
.esklad-register__already a:hover,
.esklad-register__already a:focus {
  border-bottom-color: var(--teal);
  color: var(--ink);
}

/* ─── Form body ─── */
.esklad-register-stage .register-form {
  padding: 28px 36px 32px;
  margin: 0;
  counter-reset: esklad-reg-section;
}

/* fieldsets / sections */
.esklad-register-stage .register-form fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 28px;
  counter-increment: esklad-reg-section;
}
.esklad-register-stage .register-form #account {
  margin-bottom: 28px;
  counter-increment: esklad-reg-section;
  position: relative;
}

/* legend → section header (numbered eyebrow + hairline) */
.esklad-register-stage .register-form legend {
  display: flex;
  align-items: baseline;
  gap: 14px;
  width: 100%;
  border: 0;
  margin: 0 0 20px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.esklad-register-stage .register-form legend::before {
  content: counter(esklad-reg-section, decimal-leading-zero);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-feature-settings: "tnum";
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink);
  flex-shrink: 0;
}

/* ─── Form rows: label-on-top, override Bootstrap form-horizontal ─── */
.esklad-register-stage .register-form .form-group {
  display: block;
  margin: 0 0 18px;
  padding: 0;
}
.esklad-register-stage .register-form .form-group [class*="col-sm-"] {
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  float: none !important;
}
.esklad-register-stage .register-form .control-label {
  display: block;
  width: 100% !important;
  text-align: left !important;
  margin-bottom: 6px;
  padding: 0 !important;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* Required indicator: small teal dot before label, replaces OC's red star */
.esklad-register-stage .register-form .form-group.required > label.control-label::before,
.esklad-register-stage .register-form .form-group.required > [class*="col-sm-2"] > .control-label::before,
.esklad-register-stage .register-form .form-group.required > .control-label::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  background: var(--teal);
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
  margin-top: -2px;
}
.esklad-register-stage .register-form .form-group.required > .control-label::after,
.esklad-register-stage .register-form .form-group.required label::after { content: none !important; }

/* ─── Inputs: underline-only style, same as checkout.
   Use !important on the structural properties because Journal 3 / Bootstrap
   ship competing .form-control rules (some with !important) that otherwise
   win even though our selector has higher specificity. */
.esklad-register-stage .register-form .form-control,
.esklad-register-stage .register-form input[type="text"],
.esklad-register-stage .register-form input[type="email"],
.esklad-register-stage .register-form input[type="tel"],
.esklad-register-stage .register-form input[type="password"],
.esklad-register-stage .register-form select {
  width: 100% !important;
  display: block !important;
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 0 !important;
  background: transparent !important;
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
  color: var(--ink);
  padding: 10px 2px 11px !important;
  height: auto !important;
  box-shadow: none !important;
  transition: border-color 0.15s ease;
}
.esklad-register-stage .register-form .form-control:focus,
.esklad-register-stage .register-form input:focus,
.esklad-register-stage .register-form select:focus {
  outline: none !important;
  border-bottom-color: var(--ink) !important;
  box-shadow: none !important;
  background: transparent !important;
}
.esklad-register-stage .register-form .form-control::placeholder { color: var(--ink-faint); }
.esklad-register-stage .register-form ::placeholder { color: var(--ink-faint); }

/* select: tone-down arrow */
.esklad-register-stage .register-form select.form-control,
.esklad-register-stage .register-form select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%235a6772' stroke-width='1.5' d='M1 1.5l5 5 5-5'/></svg>") !important;
  background-repeat: no-repeat !important;
  background-position: right 4px center !important;
  padding-right: 24px !important;
}

/* textarea — boxed with canvas bg, same as checkout's textarea */
.esklad-register-stage .register-form textarea.form-control,
.esklad-register-stage .register-form textarea {
  width: 100% !important;
  display: block !important;
  border: 1px solid var(--line) !important;
  padding: 12px 14px !important;
  border-radius: 4px !important;
  background: var(--canvas) !important;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  resize: vertical;
  min-height: 96px;
  box-shadow: none !important;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.esklad-register-stage .register-form textarea.form-control:focus,
.esklad-register-stage .register-form textarea:focus {
  outline: none !important;
  border-color: var(--ink) !important;
  background: var(--paper) !important;
  box-shadow: none !important;
}

/* radios + checkboxes (newsletter row, agree, customer_group) */
.esklad-register-stage .register-form .radio,
.esklad-register-stage .register-form .checkbox {
  display: block;
  margin: 8px 0;
  padding-left: 0 !important;
  position: static;
  font-size: 14px;
  color: var(--ink);
  font-weight: 400;
}
.esklad-register-stage .register-form .radio-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 4px 22px 4px 0 !important;
  padding-left: 0 !important;
  position: static !important;
  font-size: 14px;
  color: var(--ink);
  font-weight: 400;
  cursor: pointer;
}
.esklad-register-stage .register-form .radio label,
.esklad-register-stage .register-form .checkbox label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding-left: 0;
  font-weight: 400;
  cursor: pointer;
  position: static;
}
.esklad-register-stage .register-form .radio input[type="radio"],
.esklad-register-stage .register-form .radio-inline input[type="radio"],
.esklad-register-stage .register-form .checkbox input[type="checkbox"] {
  position: static !important;
  margin: 0 !important;
  margin-left: 0 !important;
  width: 16px;
  height: 16px;
  accent-color: var(--ink);
  flex-shrink: 0;
}

/* error text */
.esklad-register-stage .register-form .text-danger {
  display: block;
  font-size: 12.5px;
  color: var(--error);
  margin-top: 6px;
}
.esklad-register-stage .register-form .form-group:has(.text-danger) .form-control,
.esklad-register-stage .register-form .form-group:has(.text-danger) input,
.esklad-register-stage .register-form .form-group:has(.text-danger) select {
  border-bottom-color: var(--error);
}
.esklad-register-stage .register-form .form-group:has(.text-danger) textarea {
  border-color: var(--error);
}

/* alert at top (error_warning) */
.esklad-register-stage #account-register .alert-danger {
  max-width: 720px;
  margin: 24px auto 0;
  padding: 14px 18px;
  background: rgba(199, 59, 59, .06);
  border: 1px solid rgba(199, 59, 59, .22);
  border-left: 3px solid var(--error);
  color: #8a2929;
  font-size: 14px;
  border-radius: 3px;
}

/* ─── Submit row ─── */
.esklad-register-stage .register-form .buttons {
  margin: 32px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  background: transparent;
  border-bottom: 0;
}
/* DOM order from OC: text "Прочетох и съм съгласен с" → <a> link → checkbox
   → button. Same natural inline-flow as checkout: text + link + checkbox on
   the first line (left-aligned), button forced onto its own row by being
   block-level + 100% wide. No flex magic — matches Phase 17 checkout exactly. */
.esklad-register-stage .register-form .buttons .pull-right {
  float: none !important;
  display: block;
  width: 100%;
  text-align: left;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.7;
}
.esklad-register-stage .register-form .buttons .pull-right > input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin: 0 12px 0 0;
  accent-color: var(--ink);
  cursor: pointer;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.esklad-register-stage .register-form .buttons .pull-right > a,
.esklad-register-stage .register-form .buttons a.agree {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--teal-line);
  padding-bottom: 1px;
  font-weight: 500;
  transition: border-color 0.15s ease;
}
.esklad-register-stage .register-form .buttons .pull-right > a:hover,
.esklad-register-stage .register-form .buttons a.agree:hover {
  border-bottom-color: var(--teal);
}
.esklad-register-stage .register-form .buttons .pull-right > a b {
  font-weight: 500;
}

/* primary submit button — full width on its own row, ink, same as checkout */
.esklad-register-stage .register-form .btn-primary {
  display: block;
  width: 100%;
  background: var(--ink);
  border: 0;
  border-radius: 4px;
  color: var(--paper);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 16px 24px;
  margin: 24px 0 0;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.04s ease;
}
.esklad-register-stage .register-form .btn-primary:hover {
  background: #1a2840;
  color: var(--paper);
}
.esklad-register-stage .register-form .btn-primary:active { transform: translateY(1px); }
.esklad-register-stage .register-form .btn-primary span { display: inline; }

/* hide OC's default text_account_already paragraph (we move it to the header) */
.esklad-register-stage #content > p:has(a[href*="account/login"]),
.esklad-register-stage #content > p.esklad-register-hide { display: none; }

/* captcha row spacing */
.esklad-register-stage .register-form .form-group + .buttons,
.esklad-register-stage .register-form > div + .buttons { margin-top: 32px; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .esklad-register-stage #account-register #content { padding: 24px 14px 44px; }
  .esklad-register__header { padding: 26px 22px 20px; }
  .esklad-register__title { font-size: 24px; }
  .esklad-register__sub { font-size: 13.5px; }
  .esklad-register-stage .register-form { padding: 22px 22px 28px; }
  .esklad-register-stage .register-form legend { font-size: 10.5px; padding-bottom: 10px; margin-bottom: 16px; }
  .esklad-register-stage .register-form fieldset,
  .esklad-register-stage .register-form #account { margin-bottom: 24px; }
}
@media (max-width: 480px) {
  .esklad-register-stage #account-register #content { padding: 18px 10px 36px; }
  .esklad-register__header { padding: 22px 18px 18px; }
  .esklad-register__title { font-size: 21px; line-height: 1.22; }
  .esklad-register__sub { font-size: 13px; margin-bottom: 14px; }
  .esklad-register__pill-row { font-size: 10.5px; gap: 10px; margin-bottom: 14px; }
  .esklad-register-stage .register-form { padding: 20px 16px 24px; }
  .esklad-register-stage .register-form .control-label { font-size: 10.5px; }
  .esklad-register-stage .register-form .form-control,
  .esklad-register-stage .register-form input,
  .esklad-register-stage .register-form select { font-size: 15px; padding: 10px 0 11px; }
  .esklad-register-stage .register-form textarea { font-size: 15px; padding: 11px 12px; }
  .esklad-register-stage .register-form .btn-primary { padding: 15px 20px; font-size: 13px; }
}
