/* ═══════════════════════════════════════════════
   RF Online — общие стили
   Подключается на всех страницах проекта
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Share+Tech+Mono&family=Inter:wght@300;400;500&display=swap');

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

/* ── CSS-переменные ── */
:root {
  --rf-bg:        #07090f;
  --rf-surface:   #0d1120;
  --rf-panel:     #111826;
  --rf-border:    rgba(80, 160, 255, 0.15);
  --rf-border-hi: rgba(80, 160, 255, 0.45);
  --rf-blue:      #3a8fff;
  --rf-blue-dim:  #1d5abf;
  --rf-cyan:      #47e5d4;
  --rf-gold:      #e8b84b;
  --rf-red:       #e84b4b;
  --rf-text:      #c8d8f0;
  --rf-muted:     #5a7090;
  --rf-accent:    rgba(58, 143, 255, 0.08);
}

html, body {
  height: 100%;
  background: var(--rf-bg);
  color: var(--rf-text);
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  overflow: hidden;
}

/* ── Grid background ── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(58, 143, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(58, 143, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* ── Ambient orbs ── */
body::after {
  content: '';
  position: fixed;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(58, 100, 220, 0.07) 0%, transparent 70%);
  top: -100px; left: -100px;
  pointer-events: none;
  z-index: 0;
}

.orb-right {
  position: fixed;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(71, 229, 212, 0.05) 0%, transparent 70%);
  bottom: -120px; right: -80px;
  pointer-events: none;
  z-index: 0;
}

/* ══════════════════════════════════════════════
   Страница авторизации (login)
   ══════════════════════════════════════════════ */

/* ── Layout ── */
.page {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

/* ── Left panel — branding ── */
.brand-panel {
  flex: 1;
  max-width: 460px;
  padding: 60px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 32px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-hex {
  width: 52px; height: 52px;
  position: relative;
  flex-shrink: 0;
}

.logo-hex svg { width: 100%; height: 100%; }

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-main {
  font-family: 'Rajdhani', sans-serif;
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 3px;
  line-height: 1;
}

.logo-sub {
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: var(--rf-cyan);
  letter-spacing: 5px;
  text-transform: uppercase;
  margin-top: 3px;
}

.brand-divider {
  width: 48px; height: 1px;
  background: linear-gradient(90deg, var(--rf-blue), transparent);
}

.brand-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 42px;
  font-weight: 700;
  line-height: 1.1;
  color: #fff;
}

.brand-title span { color: var(--rf-blue); }

.brand-desc {
  font-size: 14px;
  line-height: 1.7;
  color: var(--rf-muted);
  max-width: 320px;
}

/* ── Faction badges ── */
.faction-row { display: flex; gap: 12px; }

.faction {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--rf-border);
  border-radius: 4px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--rf-muted);
  cursor: default;
  transition: border-color 0.2s, color 0.2s;
}

.faction:hover { border-color: var(--rf-border-hi); color: var(--rf-text); }

.faction-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-acc { background: #4488ff; }
.dot-bel { background: #e84b4b; }
.dot-cru { background: #47e5d4; }

/* ── Divider ── */
.panel-divider {
  width: 1px;
  height: 420px;
  background: linear-gradient(to bottom, transparent, var(--rf-border) 30%, var(--rf-border) 70%, transparent);
  flex-shrink: 0;
  align-self: center;
}

/* ── Login panel ── */
.login-panel {
  width: 400px;
  padding: 48px;
  flex-shrink: 0;
}

.login-header { margin-bottom: 32px; }

.login-eyebrow {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: var(--rf-cyan);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.login-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 1px;
}

/* ── Form ── */
.form-field { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--rf-muted);
  margin-bottom: 8px;
}

.input-wrap { position: relative; }

.input-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--rf-muted);
  display: flex;
  align-items: center;
  pointer-events: none;
  transition: color 0.2s;
}

.form-input {
  width: 100%;
  height: 46px;
  background: rgba(58, 143, 255, 0.04);
  border: 1px solid var(--rf-border);
  border-radius: 4px;
  padding: 0 14px 0 42px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: var(--rf-text);
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  -webkit-autofill-override: none;
}

.form-input::placeholder { color: var(--rf-muted); }

.form-input:focus {
  border-color: var(--rf-blue-dim);
  background: rgba(58, 143, 255, 0.07);
  box-shadow: 0 0 0 3px rgba(58, 143, 255, 0.08);
}

.form-input:focus + .input-focus-bar { opacity: 1; }
.form-input:focus ~ .input-icon { color: var(--rf-blue); }

.input-focus-bar {
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--rf-blue), var(--rf-cyan));
  border-radius: 0 0 2px 2px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

/* password toggle */
.pwd-toggle {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  cursor: pointer;
  color: var(--rf-muted);
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}
.pwd-toggle:hover { color: var(--rf-text); }

/* ── Sirin protection block ── */
.sirin-block {
  margin: 20px 0;
  border: 1px solid var(--rf-border);
  border-radius: 4px;
  overflow: hidden;
}

.sirin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--rf-border);
}

.sirin-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: var(--rf-muted);
  letter-spacing: 1px;
}

.sirin-shield {
  width: 16px; height: 16px;
  color: var(--rf-cyan);
  flex-shrink: 0;
}

.sirin-badge {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  padding: 2px 8px;
  background: rgba(71, 229, 212, 0.08);
  border: 1px solid rgba(71, 229, 212, 0.2);
  border-radius: 2px;
  color: var(--rf-cyan);
  letter-spacing: 1px;
}

.sirin-captcha-area {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Checkbox */
.sirin-check-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  flex: 1;
}

.sirin-checkbox {
  width: 24px; height: 24px;
  border: 2px solid var(--rf-border-hi);
  border-radius: 3px;
  background: rgba(58, 143, 255, 0.04);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.25s, background 0.25s;
  cursor: pointer;
  position: relative;
}

.sirin-checkbox.checked {
  border-color: var(--rf-cyan);
  background: rgba(71, 229, 212, 0.1);
}

.sirin-checkbox.checked::after {
  content: '';
  display: block;
  width: 10px; height: 6px;
  border-left: 2px solid var(--rf-cyan);
  border-bottom: 2px solid var(--rf-cyan);
  transform: rotate(-45deg) translate(1px, -1px);
}

.sirin-check-text {
  font-size: 13px;
  color: var(--rf-text);
  line-height: 1.4;
}

.sirin-spinner {
  display: none;
  width: 20px; height: 20px;
  border: 2px solid rgba(71, 229, 212, 0.15);
  border-top-color: var(--rf-cyan);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

.sirin-spinner.active { display: block; }

@keyframes spin { to { transform: rotate(360deg); } }

.sirin-logo-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.sirin-logo-text {
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--rf-muted);
  letter-spacing: 2px;
}

.sirin-logo-sub {
  font-size: 9px;
  color: #3a5070;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Scan line animation when verifying */
.sirin-scan {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--rf-cyan), transparent);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.3s;
}

.sirin-scan.active { opacity: 1; }

.sirin-scan-bar {
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, var(--rf-cyan) 50%, transparent);
  animation: scan 1.2s ease-in-out infinite;
}

@keyframes scan {
  0%   { left: -100%; }
  100% { left: 100%; }
}

.sirin-status {
  padding: 6px 14px 10px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: var(--rf-muted);
  letter-spacing: 0.5px;
  min-height: 30px;
  transition: color 0.2s;
}

.sirin-status.ok  { color: var(--rf-cyan); }
.sirin-status.err { color: var(--rf-red);  }

/* ── Extras row ── */
.form-extras {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.remember-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.remember-check {
  width: 16px; height: 16px;
  border: 1px solid var(--rf-border-hi);
  border-radius: 3px;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.remember-check.checked {
  background: var(--rf-blue-dim);
  border-color: var(--rf-blue);
}

.remember-check.checked::after {
  content: '';
  display: block;
  width: 7px; height: 4px;
  border-left: 1.5px solid #fff;
  border-bottom: 1.5px solid #fff;
  transform: rotate(-45deg) translate(0.5px, -0.5px);
}

.remember-label {
  font-size: 13px;
  color: var(--rf-muted);
}

.forgot-link {
  font-size: 13px;
  color: var(--rf-blue);
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.forgot-link:hover { opacity: 1; }

/* ── Submit button ── */
.btn-login {
  width: 100%;
  height: 48px;
  background: linear-gradient(90deg, #1a4db3, #2364d4);
  border: 1px solid rgba(58, 143, 255, 0.4);
  border-radius: 4px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-login::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  transition: left 0.5s;
}

.btn-login:hover          { background: linear-gradient(90deg, #2060d0, #3278e8); box-shadow: 0 0 24px rgba(58, 143, 255, 0.2); }
.btn-login:hover::before  { left: 100%; }
.btn-login:active         { transform: scale(0.985); }
.btn-login:disabled       { opacity: 0.4; cursor: not-allowed; }

/* ── Register link ── */
.register-row {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--rf-muted);
}

.register-row a {
  color: var(--rf-blue);
  text-decoration: none;
  transition: color 0.2s;
}
.register-row a:hover { color: var(--rf-cyan); }

/* ── Server status bar ── */
.server-status {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: 10px 32px;
  background: rgba(7, 9, 15, 0.95);
  border-top: 1px solid var(--rf-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
}

.server-info {
  display: flex;
  align-items: center;
  gap: 24px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: var(--rf-muted);
}

.server-dot { display: flex; align-items: center; gap: 6px; }

.dot-online {
  width: 6px; height: 6px; border-radius: 50%;
  background: #4cd97a;
  box-shadow: 0 0 6px rgba(76, 217, 122, 0.6);
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

.server-version {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: #2a3a50;
  letter-spacing: 1px;
}

/* ── Error message ── */
.form-error {
  display: none;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: rgba(232, 75, 75, 0.07);
  border: 1px solid rgba(232, 75, 75, 0.25);
  border-radius: 4px;
  font-size: 13px;
  color: var(--rf-red);
}

.form-error.visible { display: flex; align-items: center; gap: 8px; }

/* ── Responsiveness ── */
@media (max-width: 780px) {
  .brand-panel, .panel-divider { display: none; }
  .login-panel { width: 100%; max-width: 400px; padding: 32px 24px; }
  .page { padding: 24px 16px 64px; overflow-y: auto; }
  html, body { overflow: auto; }
}
