/* Conflux Ukraine — Auth modal styles
   Uses CSS variables from the main design system. */

.cu-auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 40, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: cuFade 0.18s ease-out;
}
.cu-auth-overlay[hidden] { display: none; }
@keyframes cuFade { from { opacity: 0; } to { opacity: 1; } }

.cu-auth-card {
  background: var(--bg-elev, #fff);
  color: var(--text, #0A1628);
  border-radius: var(--radius, 16px);
  box-shadow: 0 24px 64px -16px rgba(0, 87, 183, 0.32), 0 8px 32px rgba(10, 22, 40, 0.16);
  max-width: 480px;
  width: 100%;
  padding: 36px 32px 28px;
  position: relative;
  border: 1px solid var(--border, rgba(10,22,40,0.08));
  animation: cuPop 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes cuPop {
  from { transform: scale(0.94); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.cu-auth-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 36px; height: 36px;
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--text-mute, #5F6B7C);
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.18s, color 0.18s;
}
.cu-auth-close:hover { background: var(--bg-soft, #F4F6FA); color: var(--text, #0A1628); }
.cu-auth-close:focus-visible { outline: 3px solid var(--accent, #0057B7); outline-offset: 2px; }

.cu-auth-head h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: var(--text);
}
.cu-auth-head p {
  font-size: 14px;
  color: var(--text-dim, #4A5567);
  line-height: 1.55;
  margin: 0 0 24px;
}

.cu-auth-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cu-wallet-btn {
  all: unset;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg-elev, #fff);
  border: 1px solid var(--border, rgba(10,22,40,0.08));
  border-radius: var(--radius-sm, 10px);
  cursor: pointer;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s, background 0.18s;
  text-align: left;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(10,22,40,0.04));
  font-family: var(--font, 'Inter', sans-serif);
}
.cu-wallet-btn:hover {
  border-color: var(--accent, #0057B7);
  box-shadow: 0 8px 24px -8px rgba(0, 87, 183, 0.18), 0 2px 6px rgba(10,22,40,0.04);
  transform: translateY(-1px);
}
.cu-wallet-btn:focus-visible {
  outline: 3px solid var(--accent, #0057B7);
  outline-offset: 2px;
}
.cu-wallet-btn[data-status="loading"] {
  background: var(--accent-soft, #E8F0FC);
  border-color: var(--accent, #0057B7);
  cursor: progress;
}
.cu-wallet-btn[data-status="disabled"],
.cu-wallet-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.cu-wallet-ico {
  flex-shrink: 0;
  width: 44px; height: 44px;
  background: var(--accent-soft, #E8F0FC);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent, #0057B7);
}
.cu-wallet-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.cu-wallet-text strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.cu-wallet-text small {
  font-size: 12px;
  color: var(--text-mute, #5F6B7C);
}
.cu-wallet-arrow {
  flex-shrink: 0;
  color: var(--accent, #0057B7);
  font-weight: 600;
  font-size: 18px;
}

.cu-auth-status {
  margin-top: 16px;
  padding: 0 14px;
  font-size: 13px;
  line-height: 1.5;
}
.cu-auth-status:empty { display: none; }
.cu-auth-status-error {
  padding: 12px 14px;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.22);
  color: #DC2626;
  border-radius: var(--radius-sm, 10px);
}
.cu-auth-status-error a { color: #DC2626; text-decoration: underline; }
.cu-auth-status-success {
  padding: 12px 14px;
  background: var(--accent-soft, #E8F0FC);
  border: 1px solid rgba(0, 87, 183, 0.22);
  color: var(--accent, #0057B7);
  border-radius: var(--radius-sm, 10px);
  font-weight: 600;
}

.cu-auth-foot {
  margin: 18px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-mute, #5F6B7C);
  text-align: center;
}

/* ============ User chip in nav (replaces "Приєднатися" when logged in) ============ */
.cu-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  background: var(--bg-elev, #fff);
  border: 1px solid var(--border, rgba(10,22,40,0.08));
  border-radius: 100px;
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  transition: border-color 0.18s, box-shadow 0.18s;
  cursor: pointer;
  position: relative;
}
.cu-user-chip:hover {
  border-color: var(--accent, #0057B7);
  box-shadow: 0 4px 12px -2px rgba(0, 87, 183, 0.18);
}
.cu-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent, #0057B7) 0%, var(--accent-3, #FFD500) 100%);
  flex-shrink: 0;
}
.cu-user-addr {
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  color: var(--text-mute, #5F6B7C);
}

.cu-user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-elev, #fff);
  border: 1px solid var(--border, rgba(10,22,40,0.08));
  border-radius: var(--radius, 16px);
  box-shadow: 0 16px 40px -8px rgba(0, 87, 183, 0.18), 0 4px 12px rgba(10,22,40,0.08);
  min-width: 240px;
  padding: 8px;
  z-index: 200;
  display: none;
}
.cu-user-menu[data-open="true"] { display: block; }
.cu-user-menu a, .cu-user-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  text-align: left;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.cu-user-menu a:hover, .cu-user-menu button:hover { background: var(--bg-soft, #F4F6FA); }
.cu-user-menu .cu-user-menu-divider {
  height: 1px;
  background: var(--border, rgba(10,22,40,0.08));
  margin: 4px 8px;
}
.cu-user-menu button.cu-logout-btn { color: #DC2626; }
.cu-user-menu button.cu-logout-btn:hover { background: rgba(220, 38, 38, 0.06); }

/* ============ Mobile ============ */
@media (max-width: 640px) {
  .cu-auth-overlay { padding: 0; }
  .cu-auth-card {
    border-radius: 0;
    max-width: 100%;
    min-height: 100vh;
    padding: 56px 22px 24px;
    box-shadow: none;
    animation: cuSlide 0.22s ease-out;
  }
  @keyframes cuSlide { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
  .cu-auth-close { top: 12px; right: 12px; }
  .cu-auth-head h2 { font-size: 22px; }
  .cu-user-chip .cu-user-addr { display: none; }
}
