/**
 * Makler.ge — premium auth (login / registration / reset)
 * Brand orange: #E6771E
 */

:root {
  --auth-orange: #E6771E;
  --auth-orange-hover: #cf6a18;
  --auth-ink: #1a2332;
  --auth-muted: #6b7280;
  --auth-border: #e5e7eb;
  --auth-surface: #ffffff;
  --auth-panel-bg: #f4f5f7;
  --auth-radius: 22px;
  --auth-card-max: 640px;
  --auth-shadow: 0 18px 48px rgba(26, 35, 50, 0.12);
  --auth-input-h: 56px;
  --auth-ctrl-h: 56px;
  --auth-cta-h: 56px;
  --auth-tab-h: 52px;
  --auth-gap-section: 22px;
  --auth-gap-input: 15px;
}

/* —— Layout chrome on dedicated auth routes —— */
body.auth-page {
  background: var(--auth-panel-bg);
}
body.auth-page > .wrapper > header.header-nav,
body.auth-page > .wrapper > #page,
body.auth-page > .wrapper > .footer_one,
body.auth-page > .wrapper > a.scrollToHome,
body.auth-page .staging-search-hero,
body.auth-page .mobile-menu {
  display: none !important;
}
body.auth-page > .wrapper {
  min-height: 100vh;
  height: 100vh;
  padding: 0;
  margin: 0;
  max-width: none;
  overflow: hidden;
}
@media (min-width: 768px) {
  html:has(body.auth-page),
  body.auth-page {
    height: 100%;
    max-height: 100vh;
    overflow: hidden;
  }
}

/* —— Page shell —— */
.auth-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(480px, 46%) minmax(560px, 54%);
  min-height: 100vh;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  background: transparent;
}
.auth-shell--simple {
  grid-template-columns: 1fr;
}

/* Full-viewport hero behind both columns */
.auth-shell__hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
.auth-shell__hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 252, 248, 0.94) 0%, rgba(255, 250, 244, 0.82) 36%, rgba(255, 248, 240, 0.42) 50%, rgba(255, 246, 236, 0.18) 62%, rgba(255, 246, 236, 0.08) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, transparent 30%, rgba(26, 35, 50, 0.04) 100%);
}

/* Left visual / branding */
.auth-shell__brand {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100vh;
  padding: 40px 44px 36px;
  color: var(--auth-ink);
  overflow: hidden;
  background: transparent;
}
.auth-shell__brand-inner {
  position: relative;
  z-index: 1;
  max-width: 520px;
  width: 100%;
}
.auth-shell__logo {
  display: inline-block;
  margin-bottom: 28px;
}
.auth-shell__logo img {
  display: block;
  width: 220px;
  height: auto;
  max-width: 100%;
}
.auth-shell__headline {
  font-size: clamp(2rem, 2.8vw, 3.25rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
  color: var(--auth-ink);
}
.auth-shell__headline .auth-hl {
  color: var(--auth-orange);
}
.auth-shell__support {
  font-size: clamp(1rem, 1.05vw, 1.125rem);
  line-height: 1.55;
  color: #4b5563;
  margin: 0 0 28px;
  max-width: 34em;
}
.auth-shell__benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.auth-shell__benefits li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--auth-ink);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--auth-border);
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(26, 35, 50, 0.04);
}
.auth-shell__benefit-icon {
  display: inline-flex;
  color: var(--auth-orange);
}
.auth-shell__benefit-icon svg {
  width: 16px;
  height: 16px;
}
.auth-shell__note {
  display: none;
}

.auth-mobile-intro {
  display: none;
}

/* Right auth panel */
.auth-shell__panel,
.auth-side {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100vh;
  padding: 48px 56px;
  overflow: hidden;
  background: transparent;
}
.auth-shell--register .auth-shell__panel,
.auth-shell--register .auth-side {
  justify-content: flex-start;
  padding-top: 28px;
  padding-bottom: 20px;
  overflow-y: auto;
}
.auth-shell--login .auth-shell__panel,
.auth-shell--login .auth-side {
  justify-content: center;
}
.auth-shell__lang {
  position: absolute;
  top: 20px;
  right: 24px;
  z-index: 6;
}

.auth-card {
  width: 100%;
  max-width: var(--auth-card-max);
  background: var(--auth-surface);
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius);
  box-shadow: var(--auth-shadow);
  padding: 36px 40px 32px;
  position: relative;
}
.auth-shell--register .auth-card {
  max-width: 660px;
  padding: 24px 32px 20px;
}
.auth-card--modal {
  max-width: 100%;
  box-shadow: none;
  border: none;
  padding: 8px 8px 16px;
  border-radius: 0;
}

/* Tabs */
.auth-tabs {
  display: flex;
  gap: 0;
  margin: 0 0 var(--auth-gap-section);
  border-bottom: 1px solid var(--auth-border);
  list-style: none;
  padding: 0;
  min-height: var(--auth-tab-h);
}
.auth-tabs li {
  flex: 1;
  margin: 0;
}
.auth-tabs a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: var(--auth-tab-h);
  padding: 12px 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--auth-muted);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.auth-tabs a:hover {
  color: var(--auth-ink);
  text-decoration: none;
}
.auth-tabs a.is-active,
.auth-tabs a.active {
  color: var(--auth-orange);
  border-bottom-color: var(--auth-orange);
}

.auth-card__title {
  font-size: clamp(1.5rem, 1.7vw, 1.875rem);
  font-weight: 800;
  color: var(--auth-ink);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.auth-card__subtitle {
  font-size: 0.9375rem;
  color: var(--auth-muted);
  margin: 0 0 var(--auth-gap-section);
  line-height: 1.45;
}
.auth-shell--register .auth-card__title {
  font-size: 1.375rem;
  margin-bottom: 4px;
}
.auth-shell--register .auth-card__subtitle {
  font-size: 0.875rem;
  margin-bottom: 14px;
}

/* Social */
.auth-social {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.auth-social__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: var(--auth-ctrl-h);
  height: var(--auth-ctrl-h);
  padding: 10px 14px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--auth-ink);
  background: #fff;
  border: 1px solid var(--auth-border);
  border-radius: 14px;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.auth-social__btn:hover {
  border-color: #cfd3d8;
  background: #fafafa;
  color: var(--auth-ink);
  text-decoration: none;
  box-shadow: 0 1px 4px rgba(26, 35, 50, 0.06);
}
.auth-social__btn:focus {
  outline: 2px solid rgba(230, 119, 30, 0.45);
  outline-offset: 2px;
}
.auth-social__btn.is-loading {
  pointer-events: none;
  opacity: 0.7;
}
.auth-social__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 20px;
  color: var(--auth-muted);
  font-size: 0.8125rem;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--auth-border);
}
.auth-shell--register .auth-social {
  margin-bottom: 12px;
}
.auth-shell--register .auth-divider {
  margin-bottom: 12px;
}

/* Two-column registration fields */
.auth-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--auth-gap-input) 14px;
  margin-bottom: 2px;
}
.auth-form-grid > .auth-field {
  margin-bottom: 0;
}
.auth-form-grid__full,
.auth-form-grid .auth-agency-field {
  grid-column: 1 / -1;
}
.auth-agency-field {
  display: none;
}
.auth-agency-field.is-visible {
  display: block;
}

/* Fields */
.auth-field {
  margin-bottom: var(--auth-gap-input);
  position: relative;
}
.auth-field label.auth-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--auth-ink);
  margin-bottom: 8px;
}
.auth-field__control {
  position: relative;
}
.auth-field__icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--auth-muted);
  pointer-events: none;
  opacity: 0.8;
}
.auth-field input.form-control,
.auth-field .form-control {
  min-height: var(--auth-input-h);
  height: var(--auth-input-h);
  padding: 12px 16px 12px 48px;
  border: 1px solid var(--auth-border);
  border-radius: 14px;
  font-size: 1rem;
  color: var(--auth-ink);
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.auth-field__control--password .form-control {
  padding-right: 48px;
}
.auth-field__toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--auth-muted);
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.auth-field__toggle:hover,
.auth-field__toggle.is-visible {
  color: var(--auth-ink);
  background: #f3f4f6;
}
.auth-field__eye {
  width: 18px;
  height: 18px;
}
.auth-field input.form-control:focus {
  border-color: var(--auth-orange);
  box-shadow: 0 0 0 3px rgba(230, 119, 30, 0.16);
  outline: none;
  background: #fff;
}
.auth-field .form-control.is-invalid {
  border-color: #dc3545;
}
.auth-field em.invalid-feedback {
  display: block;
  font-size: 0.8125rem;
  margin-top: 4px;
}

.auth-row-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 18px;
  flex-wrap: nowrap;
}
.auth-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.auth-link--forgot {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
}
.auth-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}
.auth-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--auth-muted);
  cursor: pointer;
  min-width: 0;
}
.auth-check input {
  margin-top: 2px;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--auth-orange);
}
.auth-check a {
  color: var(--auth-orange);
  text-decoration: underline;
}

.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: var(--auth-cta-h);
  height: var(--auth-cta-h);
  padding: 12px 22px;
  font-size: 1.0625rem;
  font-weight: 700;
  color: #fff !important;
  background: var(--auth-orange);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}
.auth-btn__arrow {
  width: 18px;
  height: 18px;
  margin-left: auto;
  flex-shrink: 0;
}
.auth-btn:hover {
  background: var(--auth-orange-hover);
  color: #fff !important;
}
.auth-btn:active {
  transform: scale(0.99);
}
.auth-btn:disabled,
.auth-btn.is-loading {
  opacity: 0.75;
  pointer-events: none;
}

.auth-switch {
  text-align: center;
  margin-top: 18px;
  margin-bottom: 0;
  font-size: 0.875rem;
  color: var(--auth-muted);
}
.auth-switch a {
  font-weight: 700;
  color: #2563eb;
  text-decoration: none;
}
.auth-switch a:hover {
  text-decoration: underline;
}
.auth-shell--register .auth-switch {
  margin-top: 12px;
}

/* Role segmented */
.auth-roles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.auth-roles__btn {
  min-height: 46px;
  height: 46px;
  padding: 6px 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--auth-muted);
  background: #f8f9fa;
  border: 1px solid var(--auth-border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  line-height: 1.2;
}
.auth-roles__btn.is-active {
  color: var(--auth-ink);
  background: #fff;
  border-color: var(--auth-orange);
  box-shadow: 0 0 0 1px var(--auth-orange);
}
.auth-checks {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 10px 0 14px;
}

/* Trust row */
.auth-trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: var(--auth-card-max);
  width: 100%;
}
.auth-shell--register .auth-trust {
  max-width: 660px;
  gap: 12px 20px;
}
.auth-trust li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--auth-muted);
}
.auth-trust__icon {
  display: inline-flex;
  color: var(--auth-orange);
}
.auth-trust__icon svg {
  width: 16px;
  height: 16px;
}

/* Lang compact */
.auth-lang {
  position: relative;
}
.auth-lang__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 8px 12px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--auth-ink);
  background: #fff;
  border: 1px solid var(--auth-border);
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(26, 35, 50, 0.04);
}
.auth-lang__chevron {
  width: 14px;
  height: 14px;
  color: var(--auth-muted);
}
.auth-lang__menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 160px;
  background: #fff;
  border: 1px solid var(--auth-border);
  border-radius: 12px;
  box-shadow: var(--auth-shadow);
  list-style: none;
  margin: 0;
  padding: 6px 0;
  z-index: 20;
}
.auth-lang.is-open .auth-lang__menu {
  display: block;
}
.auth-lang__menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 0.8125rem;
  color: var(--auth-ink);
  text-decoration: none;
}
.auth-lang__menu a:hover,
.auth-lang__menu a.is-active {
  background: #f7f4f0;
}

/* Modal overlay redesign */
#sign_up_modal.auth-modal.modal {
  padding: 16px !important;
}
#sign_up_modal.auth-modal .modal-dialog {
  max-width: 520px;
  margin: 1.5rem auto;
}
#sign_up_modal.auth-modal .modal-content {
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius);
  box-shadow: 0 16px 48px rgba(26, 35, 50, 0.18);
  overflow: hidden;
}
#sign_up_modal.auth-modal .modal-header {
  border: none;
  padding: 12px 16px 0;
  position: relative;
  min-height: 0;
}
#sign_up_modal.auth-modal .modal-header .close,
#sign_up_modal.auth-modal .auth-modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--auth-muted);
  font-size: 1.25rem;
  line-height: 1;
  opacity: 1;
  z-index: 2;
  cursor: pointer;
}
#sign_up_modal.auth-modal .modal-body {
  padding: 8px 20px 24px;
}
#sign_up_modal.auth-modal .auth-form-grid {
  grid-template-columns: 1fr;
}
body.auth-modal-open {
  overflow: hidden;
}

/* Reset / verification reuse card */
.auth-page .auth-shell--simple .auth-shell__brand,
.auth-page .auth-shell--simple .auth-mobile-intro {
  display: none;
}
.auth-page .auth-shell--simple .auth-shell__panel {
  grid-column: 1 / -1;
}

/* Registration denser tokens */
.auth-shell--register {
  --auth-input-h: 48px;
  --auth-ctrl-h: 46px;
  --auth-cta-h: 50px;
  --auth-tab-h: 46px;
  --auth-gap-section: 12px;
  --auth-gap-input: 10px;
}

/* Short desktop heights */
@media (max-height: 900px) and (min-width: 768px) {
  .auth-shell__brand {
    padding: 28px 32px 24px;
  }
  .auth-shell__logo {
    margin-bottom: 16px;
  }
  .auth-shell__logo img {
    width: 180px;
  }
  .auth-shell__headline {
    font-size: clamp(1.65rem, 2.2vw, 2.35rem);
    margin-bottom: 10px;
  }
  .auth-shell__support {
    font-size: 0.9375rem;
    margin-bottom: 16px;
  }
  .auth-shell__benefits li {
    min-height: 36px;
    padding: 6px 10px;
    font-size: 0.75rem;
  }
  .auth-shell__panel,
  .auth-side {
    padding: 28px 36px;
  }
  .auth-card {
    padding: 28px 32px 24px;
  }
}

@media (max-height: 850px) and (min-width: 768px) {
  :root {
    --auth-input-h: 50px;
    --auth-ctrl-h: 50px;
    --auth-cta-h: 50px;
    --auth-tab-h: 46px;
    --auth-gap-section: 16px;
    --auth-gap-input: 12px;
  }
  .auth-shell--register {
    --auth-input-h: 44px;
    --auth-ctrl-h: 42px;
    --auth-cta-h: 46px;
    --auth-tab-h: 42px;
    --auth-gap-section: 10px;
    --auth-gap-input: 8px;
  }
  body.auth-page > .wrapper,
  .auth-shell {
    overflow: hidden;
  }
  .auth-shell__brand {
    overflow: hidden;
  }
  .auth-shell__panel,
  .auth-side {
    padding: 16px 28px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
    padding-top: 56px;
  }
  .auth-shell--register .auth-shell__panel,
  .auth-shell--register .auth-side {
    padding-top: 48px;
  }
  .auth-card,
  .auth-shell--register .auth-card {
    padding: 18px 24px 16px;
  }
  .auth-trust {
    gap: 10px 16px;
  }
  .auth-trust li {
    font-size: 0.75rem;
  }
}

@media (max-width: 1199.98px) and (min-width: 768px) {
  .auth-shell {
    grid-template-columns: minmax(400px, 44%) minmax(480px, 56%);
  }
  .auth-shell__brand {
    padding: 28px 28px 24px;
  }
  .auth-shell__logo img {
    width: 180px;
  }
  .auth-shell__headline {
    font-size: clamp(1.75rem, 2.4vw, 2.5rem);
  }
  .auth-shell__panel,
  .auth-side {
    padding: 32px 28px;
  }
  .auth-card {
    padding: 28px 28px 24px;
  }
  :root {
    --auth-card-max: 560px;
  }
}

@media (max-width: 767.98px) {
  body.auth-page > .wrapper {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }
  .auth-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: auto;
    overflow: visible;
  }
  .auth-shell__brand {
    display: none;
  }
  .auth-mobile-intro {
    display: block;
    padding: 20px 16px 0;
  }
  .auth-mobile-intro__logo img {
    width: 148px;
    height: auto;
  }
  .auth-mobile-intro__note {
    margin: 10px 0 0;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--auth-muted);
  }
  .auth-shell__panel,
  .auth-side,
  .auth-shell--register .auth-shell__panel,
  .auth-shell--register .auth-side,
  .auth-shell--login .auth-shell__panel,
  .auth-shell--login .auth-side {
    flex: 1 1 auto;
    height: auto;
    max-height: none;
    padding: 20px 16px 28px;
    align-items: stretch;
    justify-content: flex-start;
    overflow: visible;
    gap: 14px;
  }
  .auth-shell__lang {
    top: 12px;
    right: 12px;
  }
  .auth-card,
  .auth-shell--register .auth-card {
    max-width: none;
    padding: 24px 16px;
    border-radius: 18px;
  }
  .auth-form-grid {
    grid-template-columns: 1fr;
  }
  .auth-social {
    grid-template-columns: 1fr;
  }
  .auth-roles {
    grid-template-columns: 1fr;
  }
  .auth-roles__btn {
    min-height: 48px;
    height: auto;
    font-size: 0.875rem;
  }
  .auth-field input.form-control,
  .auth-btn,
  .auth-social__btn {
    min-height: 52px;
    height: 52px;
  }
  .auth-row-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .auth-link--forgot {
    white-space: normal;
  }
  .auth-trust {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
}

/* Motion */
@media (prefers-reduced-motion: no-preference) {
  .auth-card {
    animation: auth-card-in 0.45s ease both;
  }
  .auth-shell__brand-inner {
    animation: auth-brand-in 0.55s ease both;
  }
}
@keyframes auth-card-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes auth-brand-in {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: none; }
}
