/* Full-screen language picker (login / register) */
body.lang-picker-open {
  overflow: hidden;
}

.lang-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483648;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0;
  background:
    linear-gradient(180deg, rgba(197, 235, 230, 0.92) 0%, rgba(244, 251, 250, 0.95) 45%, rgba(255, 255, 255, 0.98) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='300' viewBox='0 0 400 300'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0%25' stop-color='%2388b8c4' stop-opacity='0.35'/%3E%3Cstop offset='100%25' stop-color='%23fff' stop-opacity='0'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect fill='url(%23g)' width='400' height='300'/%3E%3Cpath fill='%2390b0bc' opacity='0.25' d='M160 280V120l40-70 40 70v160z'/%3E%3C/svg%3E")
    center top / cover no-repeat;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.lang-overlay[hidden] {
  display: none !important;
}

.lang-screen {
  width: min(var(--phone-max, 390px), 100%);
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 8px 16px 24px;
  box-sizing: border-box;
}

.lang-topbar {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  margin-bottom: 16px;
  flex: 0 0 auto;
}

.lang-back {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  color: var(--text, #0a1628);
}

.lang-back svg {
  width: 22px;
  height: 22px;
}

.lang-topbar-title {
  margin: 0;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  color: var(--text, #0a1628);
}

.lang-topbar-spacer {
  width: 40px;
  height: 40px;
}

.lang-card {
  flex: 0 0 auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(10, 22, 40, 0.08);
  overflow: visible;
}

.lang-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lang-item {
  display: grid;
  grid-template-columns: 36px 1fr 28px;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 0;
  width: 100%;
  background: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--text, #0a1628);
  text-align: left;
  cursor: pointer;
  border-bottom: 1px solid rgba(210, 218, 226, 0.85);
}

.lang-item:last-child {
  border-bottom: 0;
}

.lang-item:hover,
.lang-item:focus-visible {
  background: rgba(19, 181, 162, 0.06);
  outline: none;
}

.lang-flag {
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text, #0a1628);
  display: block;
}

.lang-name {
  min-width: 0;
}

.lang-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  justify-self: end;
  background: #c5cdd6;
  flex-shrink: 0;
}

.lang-check svg {
  width: 12px;
  height: 12px;
  stroke: #fff;
  stroke-width: 3;
}

.lang-item.is-selected .lang-check {
  background: var(--accent, #13b5a2);
}

.lang-list > li {
  list-style: none;
  margin: 0;
  padding: 0;
}

html[dir="rtl"] .lang-topbar,
html[dir="rtl"] .login-topbar,
html[dir="rtl"] .auth-topbar {
  direction: rtl;
}

html[dir="rtl"] .field input,
html[dir="rtl"] .login-form,
html[dir="rtl"] .auth-card form,
html[dir="rtl"] .row {
  text-align: right;
}

html[dir="rtl"] .forgot {
  text-align: left;
}
