:root {
  --blue-bg: #7ec8f5;
  --blue-400: #42a5f5;
  --blue-500: #1e88e5;
  --blue-600: #1565c0;
  --blue-deep: #0d4a9e;
  --blue-gradient: linear-gradient(135deg, #42a5f5 0%, #1e88e5 45%, #0d4a9e 100%);
  --auth-bg: #050505;
  --auth-field-bg: #1a1a1a;
  --auth-field-border: #2e2e2e;
  --auth-text: #ffffff;
  --auth-muted: rgba(255, 255, 255, 0.45);
  --auth-placeholder: rgba(255, 255, 255, 0.35);
  --auth-field-height: 38px;
  --auth-input-font: 12px;
  --auth-label-font: 12px;
  --auth-btn-font: 13px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: 'Inter', sans-serif;
  background: #061428;
  display: flex;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
}

.auth-page {
  width: 100%;
  max-width: 420px;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: var(--auth-bg);
  color: var(--auth-text);
}

.auth-page::after {
  content: '';
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(420px, 100%);
  height: 42vh;
  background: var(--bg-image, none) center bottom / cover no-repeat;
  filter: blur(2px) grayscale(0.15) brightness(0.55);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}

.auth-topbar,
.auth-page-head,
.auth-form {
  position: relative;
  z-index: 2;
}

.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 4px;
}

.auth-topbtn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
}

.auth-topbtn svg {
  width: 18px;
  height: 18px;
}

.auth-topbtn img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

.auth-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 16px 12px;
}

.auth-page-head h1 {
  flex: 1;
  min-width: 0;
  font-family: 'Poppins', sans-serif;
  font-size: clamp(15px, 3.8vw, 17px);
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
}

.auth-page-head-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.auth-head-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--blue-gradient);
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(30, 136, 229, 0.3);
}

.auth-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 10px 16px 20px;
}

.auth-page--login .auth-form {
  padding-top: 16px;
}

.auth-page--register .auth-form {
  padding-top: 2px;
}

.phone-picker {
  margin-bottom: 0;
}

.phone-field .auth-field-icon {
  margin-right: 8px;
}

.phone-field .auth-field-icon svg {
  width: 14px;
  height: 14px;
  color: rgba(255, 255, 255, 0.75);
}

.auth-label {
  display: block;
  margin: 10px 0 4px;
  font-family: 'Poppins', sans-serif;
  font-size: var(--auth-label-font);
  font-weight: 700;
  color: var(--blue-400);
}

.auth-form form > .auth-label:first-of-type {
  margin-top: 0;
}

.auth-field,
.field.phone-field {
  display: flex;
  align-items: center;
  min-height: var(--auth-field-height);
  height: var(--auth-field-height);
  margin-bottom: 0;
  padding: 0 10px;
  background: var(--auth-field-bg);
  border: 1px solid var(--auth-field-border);
  border-radius: 5px;
  transition: border-color 0.15s ease;
}

.auth-field:focus-within,
.field.phone-field:focus-within {
  border-color: rgba(66, 165, 245, 0.55);
}

.auth-field-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.75);
  flex-shrink: 0;
  margin-right: 8px;
}

.auth-field-icon svg {
  width: 14px;
  height: 14px;
}

.auth-field input,
.field.phone-field input[data-phone-input] {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: var(--auth-input-font);
  color: #fff;
  padding: 7px 0;
  font-family: 'Inter', sans-serif;
  line-height: 1.3;
}

.auth-field input::placeholder,
.field.phone-field input[data-phone-input]::placeholder {
  color: var(--auth-placeholder);
}

.eye {
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 2px;
  padding: 0;
}

.eye svg {
  width: 14px;
  height: 14px;
}

.auth-forgot {
  display: flex;
  justify-content: flex-end;
  margin: 6px 0 12px;
}

.auth-forgot a {
  font-size: 11px;
  font-weight: 600;
  color: var(--blue-400);
  text-decoration: none;
}

.auth-forgot a:hover {
  text-decoration: underline;
}

.auth-terms {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 10px 0 12px;
}

.auth-terms input {
  width: 14px;
  height: 14px;
  margin-top: 1px;
  accent-color: var(--blue-500);
  flex-shrink: 0;
}

.auth-terms label {
  font-size: 10px;
  line-height: 1.4;
  color: var(--auth-muted);
}

.auth-terms a {
  color: var(--blue-400);
  text-decoration: none;
}

.auth-terms a:hover {
  text-decoration: underline;
}

.btn-primary {
  width: 100%;
  border: none;
  border-radius: 5px;
  padding: 10px 0;
  font-family: 'Poppins', sans-serif;
  font-size: var(--auth-btn-font);
  font-weight: 700;
  color: #fff;
  background: var(--blue-gradient);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(30, 136, 229, 0.24);
  margin-top: 0;
}

.btn-secondary {
  width: 100%;
  border: none;
  border-radius: 5px;
  padding: 10px 0;
  margin-top: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: var(--auth-btn-font);
  font-weight: 700;
  color: #fff;
  background: #242424;
  text-decoration: none;
  text-align: center;
  display: block;
}

.auth-alert {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 12px;
  line-height: 1.4;
}

.auth-alert.error {
  background: rgba(180, 24, 40, 0.85);
  color: #fff;
  border: 1px solid rgba(255, 120, 120, 0.35);
}

.phone-field {
  padding-left: 0;
  overflow: hidden;
}

.code-picker {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: var(--auth-input-font);
  font-weight: 600;
  padding: 0 8px;
  min-height: var(--auth-field-height);
  height: var(--auth-field-height);
  border-right: 1px solid var(--auth-field-border);
  cursor: pointer;
  flex-shrink: 0;
}

.code-picker svg {
  width: 12px;
  height: 12px;
  opacity: 0.7;
}

.phone-field input[data-phone-input] {
  padding-left: 8px;
  font-size: var(--auth-input-font);
}

.country-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.country-modal.is-open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.country-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.country-modal-sheet {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 72vh;
  background: var(--blue-bg);
  border-radius: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(100%);
  transition: transform 0.25s ease;
  color: var(--blue-deep);
}

.country-modal.is-open .country-modal-sheet {
  transform: translateY(0);
}

.country-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.28);
}

.country-search-wrap svg {
  width: 18px;
  height: 18px;
  color: var(--blue-deep);
  flex-shrink: 0;
  opacity: 0.65;
}

.country-search-wrap input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--blue-deep);
  background: transparent;
}

.country-search-wrap input::placeholder {
  color: rgba(13, 74, 158, 0.45);
}

.country-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  background: var(--blue-bg);
}

.country-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
  cursor: pointer;
  font-size: 14px;
  color: var(--blue-deep);
}

.country-item.is-selected {
  color: var(--blue-600);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.22);
}

.country-item-check {
  color: var(--blue-600);
  opacity: 0;
}

.country-item.is-selected .country-item-check {
  opacity: 1;
}

@media (max-width: 360px) {
  .auth-form,
  .auth-page-head {
    padding-left: 14px;
    padding-right: 14px;
  }
}
