/* ================================
   GoldLotto — Auth modal styles
   ================================ */

.gl-auth-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: gl-fade .2s ease-out;
}
@keyframes gl-fade { from { opacity: 0 } to { opacity: 1 } }

.gl-auth-card {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 32px;
  max-width: 440px; width: 100%;
  max-height: 92vh; overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(245, 200, 66, 0.15);
}

.gl-auth-close {
  position: absolute; top: 14px; left: 14px;
  width: 34px; height: 34px; border-radius: 10px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-dim); cursor: pointer;
  font-size: 1.4rem; line-height: 1;
}
.gl-auth-close:hover { background: var(--bg-3); color: var(--text); }

.gl-auth-logo {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px;
}

.gl-auth-tabs {
  display: flex; gap: 4px; background: var(--bg-1);
  padding: 4px; border-radius: 10px; margin-bottom: 18px;
}
.gl-auth-tab {
  flex: 1; padding: 9px; border: none; background: transparent;
  color: var(--text-dim); border-radius: 8px; cursor: pointer;
  font-family: var(--font); font-weight: 600;
}
.gl-auth-tab.active {
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #1a1206;
}

.gl-auth-form .form-group { margin-bottom: 12px; }
.gl-auth-form button[type="submit"] { margin-top: 6px; }

.gl-auth-msg {
  padding: 10px 14px; border-radius: 10px;
  font-size: 0.9rem; margin-bottom: 14px;
  border: 1px solid var(--border);
}
.gl-msg-info { background: rgba(79, 140, 255, 0.10); color: #7eaaff; border-color: rgba(79, 140, 255, 0.3); }
.gl-msg-ok   { background: rgba(34, 197, 94, 0.10); color: #4ade80; border-color: rgba(34, 197, 94, 0.3); }
.gl-msg-error{ background: rgba(230, 57, 70, 0.10); color: #ff7a86; border-color: rgba(230, 57, 70, 0.3); }

.gl-auth-divider {
  text-align: center; margin: 18px 0 14px;
  position: relative; color: var(--text-mute); font-size: 0.85rem;
}
.gl-auth-divider::before, .gl-auth-divider::after {
  content: ""; position: absolute; top: 50%; width: 40%; height: 1px;
  background: var(--border);
}
.gl-auth-divider::before { right: 0; }
.gl-auth-divider::after { left: 0; }
.gl-auth-divider span { background: var(--bg-2); padding: 0 12px; position: relative; z-index: 1; }

.gl-auth-providers { display: flex; flex-direction: column; gap: 8px; }
.gl-auth-providers .btn {
  display: flex; gap: 10px; align-items: center; justify-content: center;
}

/* ---------- Nav user chip (now a direct link to account) ---------- */
.gl-user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--border);
  text-decoration: none;
  transition: background .2s, border-color .2s;
}
.gl-user-chip:hover { background: var(--bg-3); border-color: var(--border-strong); }
.gl-user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #1a1206; font-weight: 900; font-size: 0.85rem;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.gl-user-name {
  font-weight: 600; font-size: 0.9rem; color: var(--text);
  max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gl-role-badge {
  font-size: 0.68rem; font-weight: 700;
  padding: 2px 7px; border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #1a1206; text-transform: uppercase; letter-spacing: 0.04em;
}

/* ---------- Logout button (always visible when logged in) ---------- */
.gl-signout-btn {
  display: inline-flex; align-items: center; gap: 6px;
  color: #ff7a86 !important;
  border-color: rgba(230, 57, 70, 0.3) !important;
}
.gl-signout-btn:hover {
  background: rgba(230, 57, 70, 0.1) !important;
  border-color: rgba(230, 57, 70, 0.5) !important;
  color: #ff7a86 !important;
}
.gl-signout-icon {
  font-size: 1.05rem; font-weight: 900;
  transform: rotate(180deg); /* ⎋ pointing the right way */
  display: inline-block;
}

/* ---------- Owner tools floater ---------- */
.gl-owner-tools {
  position: fixed; bottom: 20px; left: 20px; z-index: 800;
}
.gl-owner-fab {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  border: none; cursor: pointer;
  font-size: 1.6rem; color: #1a1206;
  box-shadow: 0 8px 24px rgba(245, 200, 66, 0.4), 0 4px 12px rgba(0,0,0,0.3);
  transition: transform .2s;
}
.gl-owner-fab:hover { transform: scale(1.08); }
.gl-owner-panel {
  position: absolute; bottom: 64px; left: 0;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 8px;
  min-width: 260px;
  display: none; flex-direction: column; gap: 2px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}
.gl-owner-panel.open { display: flex; }
.gl-owner-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  color: var(--gold-3);
  font-size: 0.95rem;
}
.gl-owner-close {
  width: 26px; height: 26px; border-radius: 6px;
  background: transparent; border: none; color: var(--text-dim);
  cursor: pointer; font-size: 1.2rem; line-height: 1;
}
.gl-owner-close:hover { background: var(--bg-3); color: var(--text); }
.gl-owner-action {
  display: block;
  padding: 10px 12px; border-radius: 8px;
  background: transparent; border: none;
  color: var(--text); text-align: right; cursor: pointer;
  font-family: var(--font); font-size: 0.92rem;
  text-decoration: none;
  transition: background .15s;
}
.gl-owner-action:hover { background: var(--bg-3); }
.gl-owner-info {
  margin-top: 6px; padding: 10px 12px;
  font-size: 0.78rem; color: var(--text-mute);
  border-top: 1px solid var(--border);
  line-height: 1.6;
}
@media (max-width: 640px) {
  .gl-owner-tools { bottom: 16px; left: 16px; }
  .gl-owner-fab { width: 46px; height: 46px; font-size: 1.3rem; }
  .gl-owner-panel { min-width: 240px; }
}

/* ---------- Mobile auth modal & nav ---------- */
@media (max-width: 640px) {
  .gl-auth-overlay { padding: 0; align-items: stretch; }
  .gl-auth-card {
    border-radius: 0;
    max-width: 100%;
    max-height: 100vh;
    height: 100vh;
    padding: 26px 22px;
    padding-top: max(26px, env(safe-area-inset-top));
    padding-bottom: max(26px, env(safe-area-inset-bottom));
  }
  .gl-auth-close { top: 18px; left: 18px; }
  .gl-auth-form .input { font-size: 16px; min-height: 44px; }
  .gl-auth-form button[type="submit"] { min-height: 48px; }
  .gl-auth-providers .btn { min-height: 48px; }

  /* Nav user chip — hide name, show only avatar on phones */
  .gl-user-name { display: none; }
  .gl-role-badge { display: none; }
  .gl-user-chip { padding: 4px; }
  /* Logout button — hide label, show only icon on phones */
  .gl-signout-label { display: none; }
  .gl-signout-btn { padding: 8px 10px; }
  .gl-signout-icon { font-size: 1.2rem; }
}
