@font-face {
  font-family: "DIN Next CYR";
  src: url("../fonts/DINNextCYR-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --blue-1: #1f7ff2;
  --blue-2: #1f9bf0;
  --blue-3: #12c7e6;
  --ink: #1b2733;
  --muted: #9aa7b4;
  --white: #ffffff;
}

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

html, body { height: 100%; }

body {
  font-family: "DIN Next CYR", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--white);
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Keep text editable/selectable inside inputs */
input, textarea { -webkit-user-select: text; user-select: text; }

/* ---------- Layout ---------- */
.stage {
  display: grid;
  grid-template-columns: minmax(300px, 480px) 1fr;
  min-height: 100vh;
}

/* ---------- Left (white) panel ---------- */
.left {
  position: relative;
  overflow: hidden;
  background: var(--white);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 72px 48px;
}

.left h1 {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.5px;
  color: #14181d;
  margin-bottom: 26px;
}

.left p {
  font-size: 15px;
  line-height: 1.75;
  letter-spacing: 0.6px;
  color: #b7bcc4;
  max-width: 340px;
}

/* ---------- Right (blue) panel ---------- */
.right {
  position: relative;
  overflow: hidden;
  border-top-left-radius: 80px;
  background:
    radial-gradient(45% 50% at 82% 48%, #23e2f0 0%, #1ec6ee 30%, rgba(31, 140, 240, 0) 68%),
    radial-gradient(50% 45% at 32% 80%, #1fd4ef 0%, #1bbdee 30%, rgba(31, 140, 240, 0) 70%),
    linear-gradient(155deg, #1b5fe0 0%, #1f7bea 55%, #1f8cf0 100%);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 72px 24px;
}

/* Compass / star watermark circle on top */
.compass {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  height: 400px;
  opacity: 0.5;
  pointer-events: none;
}

.compass img { width: 100%; height: 100%; display: block; object-fit: contain; }

/* Placeholder styling for empty image slots */
.img-placeholder {
  background: rgba(0, 0, 0, 0.04);
  border: 1px dashed rgba(0, 0, 0, 0.25);
  color: rgba(0, 0, 0, 0.4);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* ---------- Login card ---------- */
.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  text-align: center;
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 44px;
}

.brand .brand-mark { width: auto; height: 56px; opacity: 0.95; object-fit: contain; }
.brand b { font-weight: 800; }
.brand span { font-weight: 400; }

/* Left-panel phone mockup image — fills the bottom half, text stays on top */
.phone {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 70%;
  z-index: 0;
}
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }

/* Keep the heading/text above the image */
.left h1, .left p { position: relative; z-index: 1; }

.welcome {
  text-align: left;
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 28px;
}

/* Login error banner (white card, red text) */
.alert {
  text-align: left;
  background: var(--white);
  color: #e2231a;
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 22px;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}
.alert strong {
  display: block;
  font-weight: 700;
  margin-bottom: 4px;
}

.field {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 10px;
  padding: 0 16px;
  height: 56px;
  margin-bottom: 22px;
}

.field svg { width: 20px; height: 20px; flex: none; opacity: 0.9; }

.field input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: #fff;
  font-size: 16px;
  padding: 0 12px;
}

/* Floating label — rests as placeholder, floats up onto the top border (cut into it) */
.field-label {
  position: absolute;
  left: 44px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.6);
  font-size: 16px;
  pointer-events: none;
  padding: 0 6px;
  transition: top 0.15s ease, font-size 0.15s ease, color 0.15s ease;
}

/* strip that erases the border line behind the label text when floated */
.field-label::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 6px;                    /* taller than the 2px border to fully cover it */
  transform: translateY(-50%);
  background: #2f86ee;            /* matched to the gradient behind the fields */
  opacity: 0;
  z-index: -1;
}

.field input:focus ~ .field-label,
.field input:not(:placeholder-shown) ~ .field-label {
  top: -2px;                      /* center lands on the top border line */
  font-size: 13px;
  color: #fff;
}
.field input:focus ~ .field-label::before,
.field input:not(:placeholder-shown) ~ .field-label::before {
  opacity: 1;
}

.field .toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
  display: flex;
  opacity: 0.9;
}

/* Icon swap: open eye when hidden, slashed eye when password is shown */
.field .toggle .eye-closed { display: none; }
.field .toggle.showing .eye-open { display: none; }
.field .toggle.showing .eye-closed { display: block; }

.links {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 600;
  margin: 6px 2px 26px;
}

.links a { color: #fff; text-decoration: none; }
.links a:hover { text-decoration: underline; }

.btn-login {
  width: 100%;
  height: 58px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.32) 100%);
  color: rgba(90, 105, 120, 0.85);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.btn-login:disabled {
  cursor: not-allowed;
}

.btn-login:not(:disabled):hover {
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.45) 100%);
}

/* Valid state — both fields filled: solid white button, dark blue text */
.btn-login.active {
  background: #ffffff;
  color: #143a66;
  font-weight: 700;
}

.btn-login.active:hover {
  background: #f2f6fb;
}

.enroll {
  margin-top: 120px;
  font-size: 15px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.6);
}

.enroll a { color: #fff; font-weight: 700; text-decoration: none; }
.enroll a:hover { text-decoration: underline; }

/* ---------- Footer bits ---------- */
.footer-line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 64px;
  height: 1px;
  background: rgba(255, 255, 255, 0.25);
  z-index: 1;
}

.help {
  position: absolute;
  left: 32px;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 15px;
  z-index: 1;
}
.help svg { width: 20px; height: 20px; }

.lang {
  position: absolute;
  right: 32px;
  bottom: 24px;
  color: #fff;
  font-size: 15px;
  z-index: 1;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  /* Hide the white left panel; blue takes the full screen */
  .stage { grid-template-columns: 1fr; }
  .left { display: none; }
  .right {
    padding: 48px 20px 80px;
    border-top-left-radius: 0;
    align-items: center;
  }
  .enroll { margin-top: 64px; }
}
