/* =============================================================
   Seguar Registration — Full-screen overlay styles.
   WoodMart styles the login page; we only style the overlay.
   ============================================================= */

/* ── Variables ───────────────────────────────────────────── */
:root {
  --sgr-blue:   #2593e8;
  --sgr-blue-d: #1a7bc0;
  --sgr-blue-l: #e8f4fd;
  --sgr-green:    #1a9e3f;
  --sgr-red:      #c0392b;
  --sgr-orange:   #e07b00;
  --sgr-gray:     #f5f5f5;
  --sgr-border:   #ddd;
  --sgr-text:     #222;
  --sgr-muted:    #777;
  --sgr-radius:   5px;
  --sgr-input-h:  46px;
}

/* ── Overlay shell (inline — not full-screen) ────────────── */
.sgr-overlay {
  display: none;
  position: static !important;
  z-index: auto !important;
}

.sgr-overlay.sgr-open {
  display: block;
}

/* ── Top bar (back navigation) ───────────────────────────── */
.sgr-ov-topbar {
  padding: 0 0 16px;
  margin-bottom: 8px;
  border-bottom: 2px solid #eee;
}

.sgr-ov-topbar-inner {
  display: flex;
  align-items: center;
}

/* Back / close button */
.sgr-ov-close {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--sgr-muted);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: 1px solid var(--sgr-border);
  border-radius: var(--sgr-radius);
  padding: 7px 14px;
  transition: color .15s, border-color .15s, background .15s;
  white-space: nowrap;
}

.sgr-ov-close:hover {
  color: var(--sgr-blue);
  border-color: var(--sgr-blue);
  background: var(--sgr-blue-l);
}

/* ── Overlay body ────────────────────────────────────────── */
.sgr-ov-body {
  padding: 32px 0 60px;
}

/* Two-column: form + sidebar */
.sgr-ov-content {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  gap: 48px;
  align-items: flex-start;
}

.sgr-ov-form-col {
  flex: 0 0 540px;
  min-width: 0;
  max-width: 540px;
}

/* Center form when no sidebar is present */
.sgr-ov-content--solo {
  justify-content: center;
}

/* ── Info sidebar ────────────────────────────────────────── */
.sgr-ov-sidebar {
  flex: 1;
  min-width: 260px;
}

.sgr-ov-sidebar-inner {
  background: var(--sgr-gray);
  border: 1px solid var(--sgr-border);
  border-radius: 8px;
  padding: 24px;
  font-size: .88rem;
  line-height: 1.65;
  color: #444;
  position: sticky;
  top: 24px;
}

.sgr-ov-sidebar-inner h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--sgr-blue);
}

.sgr-ov-sidebar-inner ul {
  padding-left: 1.2em;
  margin: 0 0 12px;
}

.sgr-ov-sidebar-inner li { margin-bottom: 6px; }

.sgr-ov-sidebar-inner p { margin: 0 0 10px; }
.sgr-ov-sidebar-inner p:last-child { margin-bottom: 0; }

/* ── Overlay title ───────────────────────────────────────── */
.sgr-ov-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 24px;
  color: var(--sgr-text);
}

/* ── Progress bar ────────────────────────────────────────── */
.sgr-progress {
  display: flex;
  align-items: flex-start;
  margin: 0 0 28px;
}

.sgr-ps {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.sgr-pd {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  font-weight: 700;
  color: #aaa;
  transition: background .2s, color .2s;
}

.sgr-ps[data-step="1"] .sgr-pd::before { content: "1"; }
.sgr-ps[data-step="2"] .sgr-pd::before { content: "2"; }

.sgr-ps.sgr-active .sgr-pd { background: var(--sgr-blue); color: #fff; }
.sgr-ps.sgr-done   .sgr-pd { background: var(--sgr-green);  color: #fff; }
.sgr-ps.sgr-done   .sgr-pd::before { content: "✓"; }

.sgr-pl {
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #aaa;
  transition: color .2s;
}

.sgr-ps.sgr-active .sgr-pl { color: var(--sgr-blue); }
.sgr-ps.sgr-done   .sgr-pl { color: var(--sgr-green); }

.sgr-pline {
  flex: 1;
  height: 2px;
  background: #e0e0e0;
  margin: 15px 8px 0;
  transition: background .2s;
}

.sgr-pline.sgr-done { background: var(--sgr-green); }

/* ── Step animation ──────────────────────────────────────── */
.sgr-step { animation: sgrFadeIn .2s ease; }

@keyframes sgrFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Fields ──────────────────────────────────────────────── */
.sgr-field {
  margin-bottom: 18px;
}

.sgr-field label,
.sgr-field > label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--sgr-text);
}

.sgr-req { color: var(--sgr-red); margin-left: 2px; }

/* Our form inputs — fully self-styled inside the overlay */
.sgr-input {
  display: block;
  width: 100%;
  height: var(--sgr-input-h);
  padding: 0 40px 0 14px;
  font-size: .9rem;
  color: var(--sgr-text);
  background: #fff;
  border: 1.5px solid var(--sgr-border);
  border-radius: var(--sgr-radius);
  box-sizing: border-box;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
}

.sgr-input::placeholder { color: #bbb; }

.sgr-input:focus {
  border-color: var(--sgr-blue);
  box-shadow: 0 0 0 3px rgba(37,147,232,.15);
}

.sgr-input[readonly],
.sgr-input[data-autofill] {
  background: var(--sgr-gray);
}

/* no right padding when no right element */
.sgr-field > .sgr-input { padding-right: 14px; }

/* ── Input wrapper (for tick / eye / spinner) ────────────── */
.sgr-iw {
  position: relative;
  display: block;
}

.sgr-iw .sgr-input { padding-right: 40px; }

/* Tick */
.sgr-tick {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--sgr-green);
  font-size: .85rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s;
}

.sgr-tick.on { opacity: 1; }

/* Eye toggle */
.sgr-eye-toggle {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  opacity: .45;
  user-select: none;
  transition: opacity .15s;
  z-index: 2;
  padding: 4px;
}

.sgr-eye-toggle:hover { opacity: .85; }

/* Spinner (inside .sgr-iw, shown via .sgr-searching) */
.sgr-spin {
  position: absolute;
  right: 12px;
  top: 50%;
  margin-top: -8px;
  width: 16px;
  height: 16px;
  border: 2px solid #ddd;
  border-top-color: var(--sgr-blue);
  border-radius: 50%;
  display: none;
}

.sgr-iw.sgr-searching .sgr-spin { display: block; animation: sgrSpin .6s linear infinite; }

@keyframes sgrSpin { to { transform: rotate(360deg); } }

/* ── Error states ────────────────────────────────────────── */
.sgr-err {
  display: block;
  font-size: .76rem;
  color: var(--sgr-red);
  margin-top: 4px;
  min-height: 1em;
}

.sgr-field.sgr-has-error .sgr-input {
  border-color: var(--sgr-red);
  animation: sgrShake .3s ease;
}

.sgr-field.sgr-has-error label { color: var(--sgr-red); }

@keyframes sgrShake {
  0%,100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}

/* ── Password strength ───────────────────────────────────── */
.sgr-strength-bar {
  height: 4px;
  background: #eee;
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}

.sgr-strength-fill {
  height: 100%;
  width: 0;
  border-radius: 2px;
  transition: width .3s ease, background .3s ease;
}

.sgr-strength-bar.sgr-sw .sgr-strength-fill { width: 33%;  background: var(--sgr-red); }
.sgr-strength-bar.sgr-so .sgr-strength-fill { width: 66%;  background: var(--sgr-orange); }
.sgr-strength-bar.sgr-ss .sgr-strength-fill { width: 100%; background: var(--sgr-green); }

.sgr-strength-label {
  font-size: .72rem;
  color: var(--sgr-muted);
  margin-top: 3px;
  display: block;
}

/* ── Phone row ───────────────────────────────────────────── */
.sgr-phone-row {
  display: flex;
  align-items: stretch;
  width: 100%;
}

/* Country picker */
.sgr-country-picker { position: relative; flex-shrink: 0; }

.sgr-country-btn {
  height: var(--sgr-input-h);
  padding: 0 10px;
  background: var(--sgr-gray);
  border: 1.5px solid var(--sgr-border);
  border-right: none;
  border-radius: var(--sgr-radius) 0 0 var(--sgr-radius);
  cursor: pointer;
  font-size: .85rem;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  min-width: 90px;
  color: var(--sgr-text);
  transition: background .15s;
}

.sgr-country-btn:hover { background: var(--sgr-blue-l); }
.sgr-chevron { font-size: .6rem; color: #aaa; }

.sgr-country-list {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  z-index: 300;
  background: #fff;
  border: 1px solid var(--sgr-border);
  border-radius: var(--sgr-radius);
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
  list-style: none;
  margin: 0;
  padding: 4px 0;
  min-width: 210px;
  max-height: 240px;
  overflow-y: auto;
}

.sgr-country-list li {
  padding: 9px 14px;
  font-size: .84rem;
  cursor: pointer;
  transition: background .12s;
}

.sgr-country-list li:hover,
.sgr-country-list li.sgr-hi {
  background: var(--sgr-blue-l);
  color: var(--sgr-blue);
}

/* Phone input — connects to country picker */
.sgr-phone-iw { flex: 1; min-width: 0; }

.sgr-phone-iw .sgr-input {
  border-radius: 0 var(--sgr-radius) var(--sgr-radius) 0;
}

/* ── Half-row (DIČ / IČ DPH, Mesto / PSČ) ───────────────── */
.sgr-half-row {
  display: flex;
  gap: 16px;
}

.sgr-half-row > * { flex: 1; min-width: 0; }

@media (max-width: 480px) {
  .sgr-half-row { flex-direction: column; gap: 0; }
}

/* ── Autocomplete dropdown ───────────────────────────────── */
.sgr-ac-group { position: relative; }

.sgr-ac-drop {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 200;
  background: #fff;
  border: 1.5px solid var(--sgr-blue);
  border-top: none;
  border-radius: 0 0 var(--sgr-radius) var(--sgr-radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  max-height: 240px;
  overflow-y: auto;
}

.sgr-ac-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: .87rem;
  border-bottom: 1px solid #f0f0f0;
  transition: background .1s;
  line-height: 1.4;
}

.sgr-ac-item:last-child { border-bottom: none; }
.sgr-ac-item:hover,
.sgr-ac-item.sgr-hi { background: var(--sgr-blue-l); }
.sgr-ac-item strong { display: block; color: var(--sgr-text); }
.sgr-ac-item small  { color: var(--sgr-muted); font-size: .76rem; }

/* ── IČO status ──────────────────────────────────────────── */
.sgr-ico-status {
  display: block;
  font-size: .78rem;
  margin-top: 4px;
  min-height: 1.1em;
}

.sgr-ico-status.ok   { color: var(--sgr-green); }
.sgr-ico-status.info { color: var(--sgr-muted); }
.sgr-ico-status.err  { color: var(--sgr-red); }

/* ── Info note ───────────────────────────────────────────── */
.sgr-info-note {
  background: var(--sgr-blue-l);
  border-left: 3px solid var(--sgr-blue);
  padding: 10px 14px;
  font-size: .82rem;
  color: #555;
  margin-bottom: 20px;
  line-height: 1.55;
  border-radius: 0 var(--sgr-radius) var(--sgr-radius) 0;
}

/* ── Billing collapsible ─────────────────────────────────── */
.sgr-billing-wrap {
  margin-bottom: 18px;
  border: 1.5px solid var(--sgr-border);
  border-radius: var(--sgr-radius);
  overflow: hidden;
}

.sgr-billing-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  background: var(--sgr-gray);
  border: none;
  cursor: pointer;
  font-size: .86rem;
  font-weight: 600;
  color: #555;
  text-align: left;
  transition: background .15s, color .15s;
}

.sgr-billing-toggle:hover,
.sgr-billing-toggle[aria-expanded="true"] {
  background: var(--sgr-blue-l);
  color: var(--sgr-blue);
}

.sgr-billing-chevron {
  font-size: .65rem;
  transition: transform .2s;
}

.sgr-billing-toggle[aria-expanded="true"] .sgr-billing-chevron {
  transform: rotate(180deg);
}

.sgr-filled-badge {
  margin-left: auto;
  background: var(--sgr-green);
  color: #fff;
  font-size: .67rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.sgr-billing-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .28s ease, padding .28s ease;
  padding: 0 14px;
}

.sgr-billing-body.open {
  max-height: 400px;
  padding: 14px;
}

/* ── Consent ─────────────────────────────────────────────── */
.sgr-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: .85rem;
  line-height: 1.5;
}

.sgr-checkbox-row input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: 3px;
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--sgr-blue);
}

/* ── Privacy note ────────────────────────────────────────── */
.sgr-privacy-note {
  font-size: .76rem;
  color: var(--sgr-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

/* ── Buttons ─────────────────────────────────────────────── */
.sgr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--sgr-input-h);
  padding: 0 24px;
  font-size: .9rem;
  font-weight: 700;
  border-radius: var(--sgr-radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.sgr-btn--primary {
  background: var(--sgr-blue);
  color: #fff;
  border-color: var(--sgr-blue);
}

.sgr-btn--primary:hover {
  background: var(--sgr-blue-d);
  border-color: var(--sgr-blue-d);
}

.sgr-btn--primary:disabled,
.sgr-btn--primary.sgr-btn--disabled {
  background: #b8b8b8 !important;
  border-color: #b8b8b8 !important;
  cursor: not-allowed;
  pointer-events: none;
}

.sgr-btn--back {
  background: transparent;
  color: var(--sgr-muted);
  border-color: var(--sgr-border);
}

.sgr-btn--back:hover {
  border-color: var(--sgr-blue);
  color: var(--sgr-blue);
}

/* Full-width action button (step 1 continue) */
.sgr-field--action .sgr-btn {
  width: 100%;
}

/* Step 2 nav: back + submit side by side */
.sgr-step2-nav {
  display: flex !important;
  gap: 12px;
}

.sgr-step2-nav .sgr-btn--submit { flex: 1; }

/* Submit spinner */
.sgr-btn-spin {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: sgrSpin .7s linear infinite;
}

.sgr-btn--submit.sgr-submitting .sgr-btn-text { display: none; }
.sgr-btn--submit.sgr-submitting .sgr-btn-spin { display: block; }

/* ── Login hint ──────────────────────────────────────────── */
.sgr-login-hint {
  font-size: .82rem;
  color: var(--sgr-muted);
  text-align: center;
  margin-top: 12px;
}

.sgr-login-hint a,
.sgr-close-overlay-link {
  color: var(--sgr-blue);
  text-decoration: none;
  font-weight: 600;
}

.sgr-login-hint a:hover,
.sgr-close-overlay-link:hover { text-decoration: underline; }

/* ── Right column trigger on login page ──────────────────── */
.sgr-login-page #customer_login {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .72fr);
  column-gap: 56px;
  align-items: start;
}

.sgr-login-page #customer_login > .u-column1,
.sgr-login-page #customer_login > .u-column2 {
  float: none;
  width: auto;
  max-width: none;
  margin: 0;
}

.sgr-login-page #customer_login > .u-column2 {
  border-left: 1px solid #e3e3e3;
  padding-left: 56px;
}

.sgr-register-cta { margin-top: 1.5rem; }

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

@media (max-width: 768px) {
  .sgr-login-page #customer_login {
    grid-template-columns: 1fr;
    row-gap: 36px;
  }

  .sgr-login-page #customer_login > .u-column2 {
    border-left: 0;
    border-top: 1px solid #e3e3e3;
    padding-left: 0;
    padding-top: 32px;
  }
}

/* Sidebar stacks below form on medium screens */
@media (max-width: 900px) {
  .sgr-ov-content {
    flex-direction: column;
    gap: 32px;
  }
  .sgr-ov-form-col {
    flex: none;
    max-width: 100%;
    width: 100%;
  }
  .sgr-ov-sidebar {
    width: 100%;
  }
  .sgr-ov-sidebar-inner {
    position: static;
  }
}

@media (max-width: 640px) {
  .sgr-ov-body { padding: 20px 0 40px; }
}
