/* MGV VPN — auth (login / register flow) */

.auth-page { display: flex; flex-direction: column; min-height: calc(100vh - 70px); }
.auth-section {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
  max-width: none;
}
.auth-card {
  width: 100%; max-width: 460px;
  padding: 36px 32px 28px;
  border-radius: 18px;
  background: linear-gradient(180deg, #2C3A4F, #263040);
  border: 1px solid rgba(255,255,255,0.07);
  box-shadow: 0 30px 80px rgba(0,0,0,0.55);
}
.auth-head { text-align: center; margin-bottom: 22px; }

.brand-mark-xl {
  width: 64px; height: 64px; border-radius: 16px;
  margin: 0 auto 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.45), inset 0 1px 1px rgba(255,255,255,0.7);
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #e8eef3, #aeb8c4 45%, #6f7a89 55%, #c8d2dd);
}
.brand-mark-xl span {
  font-weight: 900; font-size: 30px; letter-spacing: -1.2px; color: #1C2333;
  line-height: 1;
}

.auth-warn-icon {
  width: 64px; height: 64px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255,170,80,0.12);
  border: 1px solid rgba(255,170,80,0.35);
  color: #ffaa50;
}

.auth-title {
  margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.5px;
  background: linear-gradient(180deg, #ffffff, #c8d2dd 60%, #97a3b1);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.auth-sub {
  margin: 10px auto 0; max-width: 360px;
  font-size: 14px; line-height: 1.55; color: #8B9BB4;
}

/* primary CTA */
.auth-cta {
  width: 100%; padding: 14px 22px;
  font-size: 15px; font-weight: 700;
  border-radius: 12px; gap: 10px;
  margin-top: 10px;
}
.auth-cta:disabled { opacity: 0.55; cursor: not-allowed; }
.auth-back { color: #8B9BB4; }

/* form input */
.auth-key-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; }
.auth-label {
  font-size: 13px; font-weight: 600; color: #8B9BB4;
}
.auth-input-wrap { position: relative; }
.auth-key-form input[type="password"],
.auth-key-form input[type="text"] {
  width: 100%; padding: 14px 44px 14px 14px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 13px; color: #FFFFFF;
  background: rgba(15,21,32,0.55);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  transition: border-color .15s ease, box-shadow .15s ease;
  letter-spacing: 0.5px;
}
.auth-key-form input:focus {
  outline: none;
  border-color: #6DB3F2;
  box-shadow: 0 0 0 3px rgba(109,179,242,0.18);
}
.auth-eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 8px;
  border: none; background: transparent; color: #8B9BB4;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.auth-eye:hover { color: #fff; background: rgba(255,255,255,0.05); }
.auth-eye.is-open { color: #6DB3F2; }

/* divider */
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 24px 0 14px;
  font-size: 11px; color: #6f7a89; text-transform: uppercase; letter-spacing: 1.2px;
}
.auth-divider::before,
.auth-divider::after {
  content: ""; flex: 1; height: 1px; background: rgba(255,255,255,0.08);
}

/* error */
.auth-error {
  margin: 12px 0 0; padding: 11px 14px;
  background: rgba(200,80,80,0.12); border: 1px solid rgba(255,120,120,0.3);
  color: #ff9d9d; font-size: 13px; border-radius: 10px;
  text-align: center;
}

.auth-hint-small {
  margin: 8px 4px 0; text-align: center;
  font-size: 12px; line-height: 1.5; color: #8B9BB4;
}

/* Спойлер «уже пользуюсь ботом в Telegram?» — не отвлекает основной поток */
.auth-tg-details {
  margin-top: 22px;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 16px;
}
.auth-tg-details summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px;
  font-size: 13px; font-weight: 600; color: #8B9BB4;
  border-radius: 8px;
  transition: color .15s ease, background .15s ease;
}
.auth-tg-details summary::-webkit-details-marker { display: none; }
.auth-tg-details summary:hover { color: #fff; background: rgba(255,255,255,0.04); }
.auth-tg-details summary svg { flex-shrink: 0; color: #6DB3F2; }
.auth-tg-body {
  margin-top: 12px;
  padding: 14px 16px;
  background: rgba(15,21,32,0.4);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.05);
}
.auth-tg-body p {
  margin: 0 0 12px; font-size: 13px; line-height: 1.55; color: #c7d0dc;
}
.auth-tg-body p b { color: #fff; }
.auth-tg-body p code {
  background: rgba(255,255,255,0.08); padding: 1px 6px; border-radius: 5px;
  font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: #6DB3F2;
}
.auth-tg-body .btn { width: 100%; padding: 11px; font-size: 13px; margin-top: 0; }

/* footer link */
.auth-foot { margin: 18px 0 0; text-align: center; font-size: 14px; color: #8B9BB4; }
.auth-foot a { color: #6DB3F2; font-weight: 600; }
.auth-foot a:hover { color: #8fc7f7; }

/* ─── generated key state ─────────────────────────────────── */
.auth-keybox {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px;
  background: rgba(15,21,32,0.6);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  margin-bottom: 12px;
}
.auth-keybox code {
  flex: 1; min-width: 0;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 14px; color: #c7d0dc;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: transparent; padding: 0;
}
.auth-copy {
  width: 36px; height: 36px; border-radius: 9px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  display: inline-flex; align-items: center; justify-content: center;
  color: #c7d0dc; cursor: pointer;
}
.auth-copy:hover { color: #fff; border-color: rgba(109,179,242,0.4); }

.auth-key-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-bottom: 6px;
}
.auth-key-actions .btn {
  padding: 12px 16px; font-size: 14px; border-radius: 10px; gap: 8px;
}
.auth-copy-toast {
  font-size: 12px; color: #5fd0a6; height: 18px; opacity: 0; transition: opacity .25s ease;
  text-align: center;
}
.auth-copy-toast.is-shown { opacity: 1; }

.auth-checks {
  display: flex; flex-direction: column; gap: 12px;
  margin: 18px 0 12px;
}
.auth-check {
  display: flex; align-items: flex-start; gap: 11px;
  font-size: 13px; line-height: 1.5; color: #c7d0dc;
  cursor: pointer; user-select: none;
}
.auth-check input[type="checkbox"] {
  -webkit-appearance: none; appearance: none;
  flex-shrink: 0; width: 18px; height: 18px;
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: 5px;
  background: rgba(15,21,32,0.5);
  cursor: pointer;
  position: relative;
  margin-top: 1px;
  transition: border-color .15s ease, background .15s ease;
}
.auth-check input[type="checkbox"]:checked {
  background: #6DB3F2;
  border-color: #6DB3F2;
}
.auth-check input[type="checkbox"]:checked::after {
  content: ""; position: absolute; left: 5px; top: 1px;
  width: 5px; height: 10px;
  border: solid #0F1520; border-width: 0 2.2px 2.2px 0;
  transform: rotate(45deg);
}

@media (max-width: 520px) {
  .auth-card { padding: 28px 22px; }
  .auth-title { font-size: 22px; }
}
