/* ASIA PLUS — shared entry gateway styling
   Visual-only layer. Auth handlers, IDs, Firebase calls and permissions are untouched. */
:root {
  --ap-gold: #e4b83f;
  --ap-gold-bright: #ffe28a;
  --ap-gold-deep: #9b6810;
  --ap-ink: #0b0c0b;
  --ap-panel: rgba(22, 21, 18, .94);
  --ap-line: rgba(228, 184, 63, .32);
  --ap-muted: #aaa28f;
}

@keyframes apEntryGlow {
  0%, 100% { opacity: .54; transform: scale(1) translate3d(0, 0, 0); }
  50% { opacity: .92; transform: scale(1.08) translate3d(12px, -10px, 0); }
}

@keyframes apEntryFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes apEntryShimmer {
  0% { transform: translateX(-135%); }
  100% { transform: translateX(135%); }
}

/* Member sign-in/register modal */
#authModal {
  isolation: isolate;
  background:
    radial-gradient(circle at 18% 20%, rgba(228,184,63,.18), transparent 28%),
    radial-gradient(circle at 84% 80%, rgba(20,110,95,.16), transparent 30%),
    rgba(3, 5, 4, .86) !important;
  backdrop-filter: blur(12px) saturate(1.15);
}

#authModal::before,
#authModal::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  filter: blur(8px);
  pointer-events: none;
  animation: apEntryGlow 8s ease-in-out infinite;
}

#authModal::before {
  top: 8%;
  left: 8%;
  background: radial-gradient(circle, rgba(228,184,63,.20), transparent 68%);
}

#authModal::after {
  right: 7%;
  bottom: 7%;
  animation-delay: -3s;
  background: radial-gradient(circle, rgba(0,185,150,.15), transparent 68%);
}

#authModal > .ww-auth-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 220, 112, .34) !important;
  border-radius: 26px !important;
  background:
    linear-gradient(145deg, rgba(36,33,24,.98), rgba(13,14,13,.98) 58%, rgba(20,27,24,.98)) !important;
  box-shadow:
    0 32px 90px rgba(0,0,0,.64),
    0 0 0 1px rgba(255,255,255,.035) inset,
    0 0 54px rgba(228,184,63,.12) !important;
  transform-origin: center;
  animation: apEntryFloat 6s ease-in-out infinite;
}

#authModal > .ww-auth-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--ap-gold-bright), var(--ap-gold), transparent);
  box-shadow: 0 0 24px rgba(255, 215, 100, .42);
}

#authModal > .ww-auth-panel::after {
  content: "";
  position: absolute;
  top: 3px;
  left: -30%;
  width: 28%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.8), transparent);
  opacity: .52;
  animation: apEntryShimmer 7s ease-in-out infinite;
  pointer-events: none;
}

#authModal .ww-auth-brand-logo {
  border: 1px solid rgba(255, 218, 106, .4) !important;
  box-shadow: 0 0 0 6px rgba(228,184,63,.06), 0 0 28px rgba(228,184,63,.22) !important;
}

#authModal .ww-auth-close {
  border: 1px solid rgba(255,255,255,.08) !important;
  background: rgba(255,255,255,.05) !important;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}

#authModal .ww-auth-close:hover {
  transform: rotate(90deg);
  background: rgba(228,184,63,.16) !important;
  color: var(--ap-gold-bright) !important;
}

#authModal #tabLogin,
#authModal #tabRegister {
  transition: color .2s ease, background .2s ease, border-color .2s ease;
}

#authModal #tabLogin:hover,
#authModal #tabRegister:hover {
  color: var(--ap-gold-bright) !important;
  background: rgba(228,184,63,.06);
}

#authModal input {
  border-color: rgba(228,184,63,.24) !important;
  background: rgba(5,7,6,.6) !important;
  box-shadow: 0 0 0 1px rgba(255,255,255,.018) inset;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

#authModal input:focus {
  border-color: var(--ap-gold) !important;
  box-shadow: 0 0 0 3px rgba(228,184,63,.12), 0 0 22px rgba(228,184,63,.08) !important;
  transform: translateY(-1px);
}

#authModal #btnLogin,
#authModal #btnRegister {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,226,138,.55) !important;
  background: linear-gradient(135deg, #f8d96e 0%, #d3a62c 48%, #95630f 100%) !important;
  box-shadow: 0 12px 26px rgba(145,95,12,.25), 0 0 0 1px rgba(255,255,255,.08) inset !important;
  transition: transform .2s ease, filter .2s ease, box-shadow .2s ease;
}

#authModal #btnLogin::before,
#authModal #btnRegister::before,
#loginScreen button::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 -45%;
  width: 32%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.38), transparent);
  transform: skewX(-18deg);
  animation: apEntryShimmer 5.5s ease-in-out infinite;
  pointer-events: none;
}

#authModal #btnLogin:hover,
#authModal #btnRegister:hover,
#loginScreen button:hover {
  filter: brightness(1.08) saturate(1.08);
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(145,95,12,.36), 0 0 24px rgba(228,184,63,.15) !important;
}

/* Admin login screen — scoped so the dashboard itself is unaffected */
#loginScreen {
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(circle at 14% 18%, rgba(228,184,63,.22), transparent 26%),
    radial-gradient(circle at 88% 82%, rgba(0,164,132,.16), transparent 28%),
    linear-gradient(135deg, #090a09 0%, #171610 52%, #0b0d0c 100%) !important;
}

#loginScreen::before,
#loginScreen::after {
  content: "";
  position: absolute;
  width: 42vw;
  height: 42vw;
  max-width: 560px;
  max-height: 560px;
  border-radius: 50%;
  border: 1px solid rgba(228,184,63,.10);
  box-shadow: 0 0 80px rgba(228,184,63,.08) inset;
  pointer-events: none;
  animation: apEntryGlow 10s ease-in-out infinite;
}

#loginScreen::before { left: -18vw; top: -20vw; }
#loginScreen::after { right: -18vw; bottom: -20vw; animation-delay: -4s; }

#loginScreen > div {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border: 1px solid rgba(255,220,112,.30) !important;
  border-radius: 26px !important;
  padding: 42px !important;
  background: linear-gradient(145deg, rgba(31,30,25,.98), rgba(12,13,12,.98)) !important;
  box-shadow: 0 34px 100px rgba(0,0,0,.68), 0 0 50px rgba(228,184,63,.12) !important;
}

#loginScreen > div::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--ap-gold-bright), var(--ap-gold), transparent);
  box-shadow: 0 0 24px rgba(255,215,100,.42);
}

#loginScreen > div::after {
  content: "SECURE ADMIN ACCESS";
  position: absolute;
  top: 17px;
  right: 24px;
  color: rgba(255,226,138,.62);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .16em;
}

#loginScreen img {
  border-radius: 13px;
  border: 1px solid rgba(255,220,112,.36);
  box-shadow: 0 0 0 5px rgba(228,184,63,.06), 0 0 24px rgba(228,184,63,.24);
  animation: apEntryFloat 5s ease-in-out infinite;
}

#loginScreen input {
  border-color: rgba(228,184,63,.24) !important;
  background: rgba(5,7,6,.66) !important;
  color: #fff7d6 !important;
  box-shadow: 0 0 0 1px rgba(255,255,255,.018) inset;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

#loginScreen input::placeholder { color: #8c8575 !important; opacity: 1; }

#loginScreen input:focus {
  border-color: var(--ap-gold) !important;
  background: rgba(12,14,12,.9) !important;
  box-shadow: 0 0 0 3px rgba(228,184,63,.12), 0 0 22px rgba(228,184,63,.08) !important;
  transform: translateY(-1px);
}

#loginScreen button {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,226,138,.55) !important;
  background: linear-gradient(135deg, #f8d96e 0%, #d3a62c 48%, #95630f 100%) !important;
  color: #151207 !important;
  box-shadow: 0 12px 26px rgba(145,95,12,.25), 0 0 0 1px rgba(255,255,255,.08) inset !important;
  transition: transform .2s ease, filter .2s ease, box-shadow .2s ease;
}

#loginScreen #loginError {
  color: #ffd2d2 !important;
  background: rgba(150,30,36,.16) !important;
  border-color: rgba(248,113,113,.42) !important;
}

/* Owner Portal entry hub */
body:has(> main.shell) {
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 14%, rgba(228,184,63,.13), transparent 24%),
    radial-gradient(circle at 90% 82%, rgba(0,164,132,.10), transparent 28%),
    #0b0b0a !important;
}

body:has(> main.shell)::before,
body:has(> main.shell)::after {
  content: "";
  position: fixed;
  z-index: -1;
  width: 30vw;
  height: 30vw;
  border-radius: 50%;
  border: 1px solid rgba(228,184,63,.09);
  animation: apEntryGlow 12s ease-in-out infinite;
  pointer-events: none;
}

body:has(> main.shell)::before { left: -12vw; top: 10vh; }
body:has(> main.shell)::after { right: -12vw; bottom: 6vh; animation-delay: -5s; }

body:has(> main.shell) .shell { position: relative; }
body:has(> main.shell) .hero,
body:has(> main.shell) .card {
  position: relative;
  overflow: hidden;
  box-shadow: 0 22px 70px rgba(0,0,0,.30), 0 0 30px rgba(228,184,63,.05);
}

body:has(> main.shell) .hero::before,
body:has(> main.shell) .card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -35%;
  width: 25%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,226,138,.82), transparent);
  animation: apEntryShimmer 8s ease-in-out infinite;
  pointer-events: none;
}

body:has(> main.shell) .brand img {
  box-shadow: 0 0 0 5px rgba(228,184,63,.05), 0 0 26px rgba(228,184,63,.18);
}

body:has(> main.shell) .action {
  box-shadow: 0 10px 24px rgba(0,0,0,.20);
}

/* Owner Portal typography palette */
body:has(> main.shell) .brand h1,
body:has(> main.shell) .hero h2,
body:has(> main.shell) .card h3 {
  background: linear-gradient(120deg, #fff2b7 0%, #f2c957 48%, #c88b1c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 24px rgba(228,184,63,.10);
}

body:has(> main.shell) .brand p,
body:has(> main.shell) .hero p,
body:has(> main.shell) .card p {
  color: #c7c0ad;
}

body:has(> main.shell) .card ul,
body:has(> main.shell) .step {
  color: #e4dece;
}

body:has(> main.shell) .badge,
body:has(> main.shell) .master-label,
body:has(> main.shell) .credential-key {
  color: #ffe28a;
}

body:has(> main.shell) .status,
body:has(> main.shell) .message.success {
  color: #55e0b0;
}

body:has(> main.shell) .lock-panel label,
body:has(> main.shell) .footer {
  color: #b9b09e;
}

body:has(> main.shell) .copy-button {
  color: #ffe28a;
}

body:has(> main.shell) .message.error { color: #ff9898; }
body:has(> main.shell) .message.info { color: #8fc5ff; }

body:has(> main.shell) .tools-section {
  position: relative;
  margin: 18px 0;
  padding: clamp(20px, 4vw, 30px);
  border: 1px solid rgba(228,184,63,.26);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(28,27,22,.96), rgba(14,15,14,.98));
  box-shadow: 0 22px 70px rgba(0,0,0,.25), 0 0 28px rgba(228,184,63,.05);
}

body:has(> main.shell) .section-heading-row,
body:has(> main.shell) .guide-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

body:has(> main.shell) .section-heading-row h2,
body:has(> main.shell) .guide-header h3 {
  margin: 4px 0 0;
  color: #fff1b9;
  font-size: clamp(20px, 3vw, 28px);
}

body:has(> main.shell) .section-kicker {
  color: #55e0b0;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .16em;
}

body:has(> main.shell) .section-hint,
body:has(> main.shell) .guide-count {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid rgba(228,184,63,.28);
  border-radius: 999px;
  color: #ffe28a;
  background: rgba(228,184,63,.08);
  font-size: 12px;
  font-weight: 800;
}

body:has(> main.shell) .tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

body:has(> main.shell) .tool-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border: 1px solid rgba(228,184,63,.22);
  border-radius: 17px;
  background: rgba(5,7,6,.38);
}

body:has(> main.shell) .tool-card::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  top: -92px;
  right: -72px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(228,184,63,.18), transparent 70%);
  pointer-events: none;
}

body:has(> main.shell) .tool-icon {
  display: grid;
  place-items: center;
  float: left;
  width: 42px;
  height: 42px;
  margin: 0 12px 10px 0;
  border: 1px solid rgba(228,184,63,.35);
  border-radius: 13px;
  color: #ffe28a;
  background: rgba(228,184,63,.12);
  font-size: 26px;
  font-weight: 900;
}

body:has(> main.shell) .tool-copy { min-height: 62px; }
body:has(> main.shell) .tool-copy h3 { margin: 0 0 5px; color: #fff1b9; font-size: 18px; }
body:has(> main.shell) .tool-copy p { margin: 0; color: #aaa38f; font-size: 13px; line-height: 1.55; }

body:has(> main.shell) .tool-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 16px;
}

body:has(> main.shell) .tool-form input {
  min-width: 0;
  border: 1px solid rgba(228,184,63,.24);
  border-radius: 10px;
  padding: 11px 12px;
  outline: none;
  color: #fff7d6;
  background: #0e0f0e;
}

body:has(> main.shell) .tool-form input:focus {
  border-color: #e4b83f;
  box-shadow: 0 0 0 3px rgba(228,184,63,.10);
}

body:has(> main.shell) .tool-button {
  min-height: 42px;
  border: 1px solid rgba(255,226,138,.45);
  cursor: pointer;
  white-space: nowrap;
}

body:has(> main.shell) .cache-button { width: 100%; margin-top: 16px; }

body:has(> main.shell) .tool-result {
  min-height: 20px;
  margin-top: 10px;
  color: #aaa38f;
  font-size: 12px;
  font-weight: 800;
}

body:has(> main.shell) .tool-result.success { color: #55e0b0; }
body:has(> main.shell) .tool-result.error { color: #ff9898; }
body:has(> main.shell) .tool-result.info { color: #8fc5ff; }

body:has(> main.shell) .guide-card { padding: clamp(20px, 4vw, 30px); }
body:has(> main.shell) .guide-header p { margin: 8px 0 0; color: #aaa38f; font-size: 13px; }
body:has(> main.shell) .guide-list { display: grid; gap: 9px; }

body:has(> main.shell) .guide-item {
  overflow: hidden;
  border: 1px solid rgba(228,184,63,.20);
  border-radius: 13px;
  background: rgba(5,7,6,.32);
}

body:has(> main.shell) .guide-item[open] {
  border-color: rgba(228,184,63,.46);
  background: linear-gradient(145deg, rgba(52,43,23,.42), rgba(5,7,6,.42));
}

body:has(> main.shell) .guide-item summary {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  color: #fff1b9;
  cursor: pointer;
  list-style: none;
}

body:has(> main.shell) .guide-item summary::-webkit-details-marker { display: none; }
body:has(> main.shell) .guide-item summary:hover { background: rgba(228,184,63,.07); }
body:has(> main.shell) .guide-item summary b { display: block; font-size: 15px; }
body:has(> main.shell) .guide-item summary small { display: block; margin-top: 3px; color: #aaa38f; font-size: 12px; }

body:has(> main.shell) .guide-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(228,184,63,.28);
  border-radius: 10px;
  color: #ffe28a;
  background: rgba(228,184,63,.10);
  font-size: 11px;
  font-weight: 900;
}

body:has(> main.shell) .guide-plus {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(228,184,63,.28);
  border-radius: 50%;
  color: #ffe28a;
  font-size: 21px;
  line-height: 1;
  transition: transform .2s ease, background .2s ease;
}

body:has(> main.shell) .guide-item[open] .guide-plus {
  transform: rotate(45deg);
  background: rgba(228,184,63,.15);
}

body:has(> main.shell) .guide-content {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(280px, 1.1fr);
  gap: 20px;
  align-items: center;
  padding: 0 15px 17px 69px;
  border-top: 1px solid rgba(228,184,63,.14);
}

body:has(> main.shell) .guide-text ol {
  margin: 15px 0 0;
  padding-left: 20px;
  color: #e4dece;
  font-size: 13px;
  line-height: 1.75;
}

body:has(> main.shell) .guide-text b { color: #ffe28a; }

body:has(> main.shell) .guide-figure {
  width: 100%;
  min-height: 150px;
  border: 1px solid rgba(228,184,63,.18);
  border-radius: 12px;
  background: #101313;
  box-shadow: 0 10px 28px rgba(0,0,0,.20);
}

body:has(> main.shell) .credential-grid {
  display: grid;
  gap: 10px;
}

body:has(> main.shell) .credential-row {
  display: grid;
  grid-template-columns: minmax(92px, .32fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(228,184,63,.25);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(228,184,63,.10), rgba(0,0,0,.18));
}

body:has(> main.shell) .credential-key {
  color: var(--gold-2);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
}

body:has(> main.shell) .credential-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #fff1b9;
  font-size: 18px;
  letter-spacing: .06em;
  user-select: all;
}

body:has(> main.shell) .credential-row .copy-button {
  min-width: 74px;
}

@media (max-width: 640px) {
  #loginScreen > div { width: calc(100% - 28px) !important; padding: 34px 22px 24px !important; border-radius: 22px !important; }
  #loginScreen > div::after { top: 14px; right: 17px; font-size: 8px; }
  #authModal > .ww-auth-panel { width: calc(100% - 24px) !important; border-radius: 22px !important; }
  body:has(> main.shell) .credential-row { grid-template-columns: 1fr auto; gap: 7px 10px; }
  body:has(> main.shell) .credential-row strong { grid-column: 1 / 2; font-size: 17px; }
  body:has(> main.shell) .credential-row .copy-button { grid-column: 2 / 3; grid-row: 1 / span 2; }
  body:has(> main.shell) .tools-grid { grid-template-columns: 1fr; }
  body:has(> main.shell) .section-heading-row,
  body:has(> main.shell) .guide-header { flex-direction: column; }
  body:has(> main.shell) .section-hint,
  body:has(> main.shell) .guide-count { align-self: flex-start; }
  body:has(> main.shell) .tool-form { grid-template-columns: 1fr; }
  body:has(> main.shell) .guide-content { grid-template-columns: 1fr; padding-left: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  #authModal > .ww-auth-panel,
  #authModal::before,
  #authModal::after,
  #loginScreen::before,
  #loginScreen::after,
  #loginScreen img,
  body:has(> main.shell)::before,
  body:has(> main.shell)::after,
  body:has(> main.shell) .hero::before,
  body:has(> main.shell) .card::before,
  #authModal > .ww-auth-panel::after,
  #authModal #btnLogin::before,
  #authModal #btnRegister::before,
  #loginScreen button::before { animation: none !important; }
}
