/* ── Xhubim Auth Pages — shared styles ── */
:root {
  --orange: #e8650a;
  --orange-light: #f07c2a;
  --orange-glow: rgba(232, 101, 10, 0.35);
  --dark: #111114;
  --dark2: #18181d;
  --dark3: #1f1f26;
  --text: #e8e8f0;
  --text-muted: rgba(232, 232, 240, 0.55);
  --error: #f44336;
  --success: #4caf50;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--dark);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Background canvas & glow ── */
#bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.glow {
  position: fixed;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, var(--orange-glow) 0%, transparent 65%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
  animation: pulse-glow 4s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: .5; transform: translate(-50%, -50%) scale(1); }
  50%       { opacity: .9; transform: translate(-50%, -50%) scale(1.06); }
}

/* ── Navbar ── */
.navbar {
  display: flex;
  align-items: center;
  padding: 22px 48px;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 100;
  background: rgba(17, 17, 20, .75);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06);
}

.logo img {
  height: 44px;
  filter: brightness(0) invert(1);
}

/* ── Page layout ── */
.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 20px 60px;
}

/* ── Card ── */
.card {
  background: var(--dark2);
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 16px;
  padding: 48px 44px;
  width: 100%;
  max-width: 460px;
  animation: fade-up .7s ease both;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
}

.card-logo img {
  height: 48px;
  filter: brightness(0) invert(1);
}

.card h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: -.5px;
}

.card-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: .88rem;
  margin-bottom: 36px;
  line-height: 1.65;
}

/* ── Form groups ── */
.form-group { margin-bottom: 20px; }

.form-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .7px;
  margin-bottom: 8px;
}

.label-opt {
  font-size: .75rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: rgba(232, 232, 240, .3);
}

/* ── Field shell ── */
.field {
  display: flex;
  align-items: center;
  background: var(--dark3);
  border: 1.5px solid rgba(255, 255, 255, .07);
  border-radius: 10px;
  transition: border-color .2s, box-shadow .2s, background .2s;
  overflow: hidden;
}

.field:focus-within {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(232, 101, 10, .13);
  background: rgba(31, 31, 38, .9);
}

.field.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(244, 67, 54, .1);
}

/* Field icon */
.field-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  flex-shrink: 0;
  color: rgba(232, 232, 240, .3);
  font-size: 1.1rem;
  pointer-events: none;
  user-select: none;
  transition: color .2s;
}

.field:focus-within .field-icon { color: var(--orange-light); }

/* Input inside field */
.field input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  padding: 13px 14px 13px 14px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: .95rem;
  line-height: 1.4;
}

/* When field has an icon, reduce left padding on input */
.field-icon + input {
  padding-left: 0;
}

.field input::placeholder { color: rgba(232, 232, 240, .25); }

/* ── Field suffix (e.g. @xhubim.ru) ── */
.field-suffix {
  padding: 0 14px;
  color: rgba(232, 232, 240, .3);
  font-size: .88rem;
  font-weight: 500;
  white-space: nowrap;
  border-left: 1px solid rgba(255, 255, 255, .05);
  background: rgba(255, 255, 255, .015);
  align-self: stretch;
  display: flex;
  align-items: center;
  transition: color .2s;
  user-select: none;
}

.field:focus-within .field-suffix { color: rgba(232, 232, 240, .5); }

/* ── Validation messages ── */
.field-msg {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .76rem;
  margin-top: 6px;
  min-height: 18px;
  color: rgba(232, 232, 240, .35);
  transition: color .2s;
}

.field-msg .material-icons { font-size: .9rem; }
.field-msg.err { color: #ef9a9a; }
.field-msg.ok  { color: #81c784; }

/* ── Password strength bar ── */
.strength-bar {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.strength-bar span {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .08);
  transition: background .3s;
}

.strength-bar.s1 span:nth-child(1)    { background: var(--error); }
.strength-bar.s2 span:nth-child(-n+2) { background: #ff9800; }
.strength-bar.s3 span:nth-child(-n+3) { background: #ffeb3b; }
.strength-bar.s4 span                 { background: var(--success); }

/* ── Alerts ── */
.alert {
  border-radius: 8px;
  padding: 14px 16px;
  font-size: .88rem;
  margin-bottom: 20px;
  display: none;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.5;
}

.alert.show { display: flex; }

.alert-error {
  background: rgba(244, 67, 54, .1);
  border: 1px solid rgba(244, 67, 54, .3);
  color: #ef9a9a;
}

.alert-success {
  background: rgba(76, 175, 80, .1);
  border: 1px solid rgba(76, 175, 80, .3);
  color: #a5d6a7;
}

.alert .material-icons { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }

/* ── Divider ── */
.divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, .06);
  margin: 24px 0;
}

/* ── hCaptcha ── */
.captcha-wrap {
  margin-bottom: 18px;
  display: flex;
  justify-content: center;
}

/* ── Submit button ── */
.btn-submit {
  width: 100%;
  background: linear-gradient(135deg, var(--orange), var(--orange-light));
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 14px;
  font-family: 'Inter', sans-serif;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, opacity .2s;
  box-shadow: 0 4px 20px var(--orange-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--orange-glow);
}

.btn-submit:disabled { opacity: .5; cursor: not-allowed; }

.btn-submit .spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, .3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}

.btn-submit.loading .spinner  { display: block; }
.btn-submit.loading .btn-text { display: none; }

/* ── Link button ── */
.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--orange), var(--orange-light));
  color: #fff;
  padding: 12px 28px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: .9rem;
  box-shadow: 0 4px 20px var(--orange-glow);
  transition: transform .2s, box-shadow .2s;
}

.btn-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--orange-glow);
}

/* ── Bottom links ── */
.bottom-links {
  text-align: center;
  margin-top: 24px;
  font-size: .85rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bottom-links a {
  color: var(--orange-light);
  text-decoration: none;
  font-weight: 600;
}

.bottom-links a:hover { text-decoration: underline; }

/* ── Username badge (set-password) ── */
.username-badge-wrap { text-align: center; margin-bottom: 24px; }

.username-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(232, 101, 10, .1);
  border: 1px solid rgba(232, 101, 10, .25);
  border-radius: 100px;
  padding: 6px 16px;
  font-size: .88rem;
  color: var(--orange-light);
  font-weight: 600;
}

/* ── Invalid token state ── */
.state-invalid { text-align: center; }

.state-invalid .icon-wrap {
  width: 80px;
  height: 80px;
  background: rgba(244, 67, 54, .1);
  border: 2px solid rgba(244, 67, 54, .3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.state-invalid .icon-wrap .material-icons { font-size: 2.4rem; color: var(--error); }
.state-invalid h2 { font-size: 1.4rem; font-weight: 800; color: #fff; margin-bottom: 10px; }
.state-invalid p  { color: var(--text-muted); font-size: .9rem; margin-bottom: 28px; line-height: 1.7; }

/* ── Animations ── */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop  { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }

/* ── Responsive ── */
@media (max-width: 520px) {
  .card    { padding: 32px 22px; }
  .navbar  { padding: 14px 20px; }
}

/* ── Checkbox label ── */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: .84rem;
  font-family: 'Inter', sans-serif;
  color: var(--text-muted);
  line-height: 1.5;
}
.checkbox-label input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 17px;
  height: 17px;
  min-width: 17px;
  border: 1.5px solid rgba(255,255,255,.2);
  border-radius: 4px;
  background: rgba(255,255,255,.04);
  cursor: pointer;
  margin-top: 1px;
  transition: background .15s, border-color .15s;
  position: relative;
}
.checkbox-label input[type="checkbox"]:checked {
  background: var(--orange);
  border-color: var(--orange);
}
.checkbox-label input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px; top: 1px;
  width: 5px; height: 9px;
  border: 2px solid #fff;
  border-top: none; border-left: none;
  transform: rotate(45deg);
}
.checkbox-label a { color: var(--orange-light); text-decoration: none; }
.checkbox-label a:hover { text-decoration: underline; }
