:root {
  --krugi_club-bg: var(--tg-theme-secondary-bg-color, #f3f5f8);
  --krugi_club-card: var(--tg-theme-bg-color, #ffffff);
  --krugi_club-text: var(--tg-theme-text-color, #18222d);
  --krugi_club-hint: var(--tg-theme-hint-color, #697586);
  --krugi_club-link: var(--tg-theme-link-color, #2481cc);
  --krugi_club-button: var(--tg-theme-button-color, #2481cc);
  --krugi_club-button-text: var(--tg-theme-button-text-color, #ffffff);
  --krugi_club-border: rgba(105, 117, 134, 0.18);
}

body.krugi_club-guard-screen {
  min-height: 100vh;
  margin: 0;
  color: var(--krugi_club-text);
  background:
    radial-gradient(circle at 20% 0%, rgba(36, 129, 204, 0.16), transparent 28rem),
    radial-gradient(circle at 90% 18%, rgba(51, 144, 236, 0.10), transparent 22rem),
    var(--krugi_club-bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    max(24px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
  box-sizing: border-box;
}

.krugi_club-card {
  width: min(100%, 460px);
  background: color-mix(in srgb, var(--krugi_club-card) 94%, transparent);
  border: 1px solid var(--krugi_club-border);
  border-radius: 28px;
  box-shadow: 0 18px 50px rgba(24, 34, 45, 0.12);
  padding: 28px;
  box-sizing: border-box;
  text-align: left;
}

.krugi_club-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  background: rgba(36, 129, 204, 0.10);
  color: var(--krugi_club-link);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 8px 12px;
  margin-bottom: 18px;
}

.krugi_club-card h1 {
  margin: 0 0 12px;
  color: var(--krugi_club-text);
  font-size: clamp(26px, 8vw, 38px);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.krugi_club-message,
.krugi_club-custom-html {
  margin: 0;
  color: var(--krugi_club-hint);
  font-size: 16px;
  line-height: 1.55;
}

.krugi_club-message p,
.krugi_club-custom-html p {
  margin: 0 0 12px;
}

.krugi_club-message p:last-child,
.krugi_club-custom-html p:last-child {
  margin-bottom: 0;
}

.krugi_club-custom-html {
  margin-top: 16px;
}

.krugi_club-custom-html a {
  color: var(--krugi_club-link);
}

.krugi_club-custom-html .button,
.krugi_club-custom-html .wp-block-button__link,
.krugi_club-custom-html a.button {
  border-radius: 16px;
  background: var(--krugi_club-button);
  color: var(--krugi_club-button-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  text-decoration: none;
  font-weight: 750;
}

.krugi_club-loader {
  width: 42px;
  height: 42px;
  margin-top: 26px;
  border-radius: 999px;
  border: 4px solid rgba(36, 129, 204, 0.16);
  border-top-color: var(--krugi_club-button);
  animation: krugi_club-spin 0.9s linear infinite;
}

.krugi_club-buttons-intro {
  color: var(--krugi_club-hint);
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 12px;
}

.krugi_club-buttons-intro p {
  margin: 0 0 10px;
}

.krugi_club-wp-login {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--krugi_club-border);
}

.krugi_club-wp-login-toggle {
  appearance: none;
  border: 0;
  width: 100%;
  cursor: pointer;
  font: inherit;
}

.krugi_club-wp-login-form {
  margin-top: 14px;
}

.krugi_club-wp-login-form label {
  color: var(--krugi_club-text);
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
}

.krugi_club-wp-login-form input {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid var(--krugi_club-border);
  border-radius: 12px;
  margin-top: 6px;
  min-height: 46px;
  padding: 8px 12px;
}

.krugi_club-wp-login-note {
  color: var(--krugi_club-hint);
  font-size: 13px;
  line-height: 1.45;
  margin: 10px 0 0;
}

.krugi_club-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}

.krugi_club-button {
  appearance: none;
  border: 0;
  border-radius: 16px;
  background: var(--krugi_club-button);
  color: var(--krugi_club-button-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 18px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 750;
  text-align: center;
}

.krugi_club-button:hover,
.krugi_club-button:focus {
  opacity: 0.92;
  color: var(--krugi_club-button-text);
}

.krugi_club-button-secondary {
  background: rgba(36, 129, 204, 0.10);
  color: var(--krugi_club-link);
}

.krugi_club-button-secondary:hover,
.krugi_club-button-secondary:focus {
  color: var(--krugi_club-link);
}

.krugi_club-debug {
  margin-top: 18px;
  max-height: 220px;
  overflow: auto;
  background: rgba(24, 34, 45, 0.06);
  border-radius: 14px;
  padding: 12px;
  color: var(--krugi_club-hint);
  font-size: 12px;
  white-space: pre-wrap;
}

body.krugi_club-enabled {
  -webkit-tap-highlight-color: transparent;
}

body.krugi_club-enabled:not(.krugi_club-guard-screen) {
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.krugi_club-profile-completion-notice {
  position: relative;
  z-index: 20;
  background: #fff;
  color: #111;
  border-bottom: 1px solid #111;
  font: inherit;
  font-size: 0.5em;
}

.krugi_club-profile-completion-inner {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 14px;
  box-sizing: border-box;
  text-align: center;
}

.krugi_club-profile-completion-text,
.krugi_club-profile-completion-text p {
  margin: 0;
}

.krugi_club-profile-completion-link {
  color: #111;
  text-decoration: underline;
  font-weight: 700;
  white-space: nowrap;
}

body.krugi_club-enabled img,
body.krugi_club-enabled video,
body.krugi_club-enabled iframe {
  max-width: 100%;
}

.krugi_club-profile {
  margin-block-start: 0;
  width: min(100%, 720px);
}

body.krugi_club-profile-page .wp-site-blocks > main,
body.krugi_club-profile-page main.wp-block-group {
  margin-block-start: 0 !important;
  padding-block-start: 0 !important;
}

body.krugi_club-profile-page main > :first-child,
body.krugi_club-profile-page main .wp-block-post-content > :first-child {
  margin-block-start: 0 !important;
}

body.krugi_club-profile-page h1.wp-block-post-title {
  display: none;
}

.krugi_club-profile-avatar-block {
  margin: 0 0 28px;
}

.krugi_club-profile-avatar {
  border-radius: 999px;
  display: block;
  width: 96px;
  height: 96px;
  object-fit: cover;
  margin: 0 0 10px;
}

.krugi_club-profile-avatar-form {
  margin: 0;
}

.krugi_club-profile-telegram-link-form {
  margin: 12px 0 0;
}

.krugi_club-profile-avatar-form button,
.krugi_club-profile-telegram-link-form .krugi_club-telegram-link-button,
.krugi_club-profile-form button,
.krugi_club-profile-logout-form button,
.krugi_club-profile-delete-form button {
  appearance: none;
  border: 1px solid #111;
  border-radius: 4px;
  background: #fff;
  color: #111;
  cursor: pointer;
  font: inherit;
  min-height: 34px;
  padding: 5px 12px;
}

.krugi_club-profile-telegram-link-form .krugi_club-telegram-link-button {
  align-items: center;
  background: #229ed9;
  border-color: #229ed9;
  color: #fff;
  display: inline-flex;
  font-size: 0.5em;
  gap: 8px;
  justify-content: center;
}

.krugi_club-telegram-link-icon,
.krugi_club-telegram-link-icon svg {
  display: block;
  height: 18px;
  width: 18px;
}

.krugi_club-telegram-link-icon svg {
  fill: currentColor;
}

.krugi_club-profile-telegram-link-form .krugi_club-telegram-link-button:hover,
.krugi_club-profile-telegram-link-form .krugi_club-telegram-link-button:focus {
  background: #1c8fc4;
  border-color: #1c8fc4;
  color: #fff;
}

.krugi_club-profile-telegram-link-form .krugi_club-telegram-link-button.is-connected {
  background: #229ed9;
  border-color: #229ed9;
  color: #fff;
}

.krugi_club-profile-telegram-status {
  margin-top: 6px;
}

.krugi_club-profile-telegram-status-linked {
  color: #18794e;
}

.krugi_club-profile-telegram-status-pending {
  color: #8a5a00;
}

.krugi_club-profile-telegram-status-error {
  color: #b42318;
  font-weight: 600;
}

.krugi_club-profile-telegram-status-disconnected {
  color: #666;
}

.krugi_club-profile-form p:last-child {
  margin-bottom: 0;
}

.krugi_club-profile-logout-form,
.krugi_club-profile-delete-form {
  margin: 12px 0 0;
}

.krugi_club-profile-delete-form button {
  border-color: #b42318;
  color: #b42318;
}

.krugi_club-profile-delete-form button:hover,
.krugi_club-profile-delete-form button:focus {
  background: #b42318;
  color: #fff;
}

.krugi_club-profile-help,
.krugi_club-profile-form small {
  color: inherit;
  display: block;
  font-size: 0.5em;
  line-height: 1.35;
  margin-top: 8px;
  opacity: 0.72;
}

.krugi_club-profile-form {
  max-width: 520px;
}

.krugi_club-profile-form p {
  margin: 0 0 18px;
}

.krugi_club-profile-form p:nth-last-child(2) {
  margin-bottom: 27px;
}

.krugi_club-profile-form input[type="text"],
.krugi_club-profile-form input[type="email"],
.krugi_club-profile-form input[type="password"] {
  box-sizing: border-box;
  display: block;
  width: 100%;
  border: 1px solid var(--krugi_club-border);
  border-radius: 4px;
  min-height: 46px;
  margin-top: 6px;
  padding: 8px 12px;
  font: inherit;
}

.krugi_club-profile-form label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

.krugi_club-profile-notice {
  border-radius: 14px;
  margin-bottom: 18px;
  padding: 12px 14px;
}

.krugi_club-profile-notice p {
  margin: 0 0 8px;
}

.krugi_club-profile-notice p:last-child {
  margin-bottom: 0;
}

.krugi_club-profile-notice-success {
  background: rgba(38, 166, 91, 0.12);
  color: #1f7a45;
}

.krugi_club-profile-notice-error {
  background: rgba(221, 65, 65, 0.12);
  color: #a72828;
}

.krugi_club-profile-comments {
  margin-top: 34px;
}

.krugi_club-profile-comments h2 {
  font: inherit;
  font-weight: 700;
  margin: 0 0 14px;
}

.krugi_club-profile-comments ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.krugi_club-profile-comments li {
  border-top: 1px solid var(--krugi_club-border);
  padding: 14px 0;
}

.krugi_club-profile-comments a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
}

.krugi_club-profile-comments time {
  display: block;
  font-size: 0.5em;
  line-height: 1.35;
  margin-top: 5px;
  opacity: 0.72;
}

.krugi_club-profile-comments p {
  margin: 8px 0 0;
}

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

@media (max-width: 480px) {
  .krugi_club-card {
    padding: 24px;
    border-radius: 24px;
  }
}
