﻿:root {
  --access-overlay-bg: linear-gradient(135deg, rgba(56, 110, 190, 0.18), rgba(56, 110, 190, 0.06));
  --access-card-bg: #ffffff;
  --access-text: #1c2430;
  --access-muted: #5a6675;
  --access-accent: #1463ff;
  --access-danger: #c0342b;
  --access-success: #147a3c;
  --access-border: #e1e6ef;
  --access-shadow: 0 18px 48px rgba(8, 12, 18, 0.35);
  --access-bg-1: #1c2230;
  --access-bg-2: #202a3a;
  --access-bg-3: #0f1622;
}

html.access-locked,
body.access-locked {
  overflow: hidden;
}

#access-gate-overlay {
  position: fixed;
  inset: 0;
  background: var(--access-overlay-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20000;
  padding: 16px;
  backdrop-filter: blur(8px);
}

#access-gate-overlay[hidden] {
  display: none;
}

#access-gate-overlay::before {
  display: none;
}

.access-gate-card {
  width: min(440px, calc(100vw - 32px));
  background: var(--access-card-bg);
  color: var(--access-text);
  border-radius: 14px;
  box-shadow: var(--access-shadow);
  border: 1px solid var(--access-border);
  padding: 24px;
  position: relative;
  z-index: 1;
}

.access-gate-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(15, 23, 42, 0.04);
  color: #334155;
  font-size: 1.05rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.access-gate-close:hover {
  background: rgba(15, 23, 42, 0.08);
}

.access-gate-title {
  font-size: 1.3rem;
  margin: 0 0 6px 0;
}

.access-gate-sub {
  margin: 0 0 18px 0;
  color: var(--access-muted);
  font-size: 0.95rem;
}

.access-gate-lang {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.access-gate-lang label {
  font-weight: 600;
  color: var(--access-text);
}

.access-gate-lang select {
  border: 1px solid var(--access-border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.9rem;
  background: #fff;
  color: var(--access-text);
}

.access-gate-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.access-gate-field label {
  font-weight: 600;
  font-size: 0.9rem;
}

.access-gate-field input {
  border: 1px solid var(--access-border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 1rem;
  outline: none;
}

.access-gate-field input:focus {
  border-color: var(--access-accent);
  box-shadow: 0 0 0 3px rgba(20, 99, 255, 0.15);
}

.access-gate-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.access-gate-actions button {
  background: var(--access-accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
}

.access-gate-actions button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.access-gate-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--access-muted);
}

.access-gate-msg {
  margin-top: 12px;
  font-size: 0.92rem;
  min-height: 20px;
}

.access-gate-msg.error {
  color: var(--access-danger);
}

.access-gate-msg.success {
  color: var(--access-success);
}

.access-gate-telegram {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2aabee 0%, #1b8ad7 60%, #167cc4 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 24px rgba(16, 44, 76, 0.28);
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.access-gate-telegram:hover {
  background: linear-gradient(135deg, #2396da 0%, #167cc4 60%, #0f66a6 100%);
  box-shadow: 0 12px 28px rgba(12, 36, 64, 0.32);
  transform: translateY(-1px);
}

.access-gate-telegram-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 0.6px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.access-gate-telegram-badge i {
  font-size: 1.55rem;
}

.access-gate-telegram-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.access-gate-telegram-title {
  font-weight: 600;
}

.access-gate-telegram-link-text {
  color: #ffffff;
  font-weight: 600;
  font-size: 0.92rem;
  opacity: 0.95;
}

.access-gate-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: linear-gradient(120deg, #f7f9fc 0%, #eef2f7 100%);
}

#access-logout-btn,
#access-login-btn {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 21000;
  border: 1px solid var(--access-border);
  background: #fff;
  color: var(--access-text);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.85rem;
  box-shadow: 0 8px 20px rgba(9, 14, 24, 0.12);
  cursor: pointer;
}

#access-logout-btn {
  border-color: rgba(185, 28, 28, 0.5);
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(185, 28, 28, 0.25);
}

#access-logout-btn:hover,
#access-logout-btn:focus {
  border-color: rgba(185, 28, 28, 0.7);
  background: linear-gradient(135deg, #f05252, #a91515);
  color: #ffffff;
}

#access-logout-btn[hidden],
#access-login-btn[hidden] {
  display: none;
}

#access-logout-btn.access-logout-inline,
#access-login-btn.access-logout-inline {
  position: static;
  top: auto;
  right: auto;
  z-index: auto;
  padding: 6px 12px;
  border-radius: 999px;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.92);
}

#access-logout-btn.access-logout-inline {
  border-color: rgba(185, 28, 28, 0.6);
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #ffffff;
  box-shadow: none;
}

#access-logout-btn.access-logout-inline:hover,
#access-logout-btn.access-logout-inline:focus {
  background: linear-gradient(135deg, #f05252, #a91515);
  color: #ffffff;
}

@media (max-width: 480px) {
  .access-gate-card {
    padding: 18px;
  }

  .access-gate-lang {
    flex-direction: column;
    align-items: stretch;
  }

  .access-gate-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
