*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black: #000;
  --yellow: #F5B800;
  --yellow-dim: #c49300;
  --white: #fff;
  --red: #e04444;
  --card-bg: #111;
  --card-border: #2a2000;
  --radius: 6px;
  --font: 'Segoe UI', Arial, sans-serif;
}

html, body {
  height: 100%;
  color: var(--yellow);
  font-family: var(--font);
}

body {
  background: #000;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 50%;
  left: 50%;
  width: 140vmax;
  height: 200vh;
  margin-left: -70vmax;
  margin-top: -100vh;
  border-radius: 50%;
  background: radial-gradient(ellipse at center,
    rgba(245, 184, 0, .16) 0%,
    rgba(200, 100, 0, .08) 38%,
    rgba(100,  40, 0, .03) 60%,
    transparent 72%
  );
  animation: sunCycle 30s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes sunCycle {
  0%   { transform: translateX(-90vw); opacity: 0; }
  10%  { opacity: 1; }
  72%  { opacity: 1; }
  82%  { transform: translateX(90vw);  opacity: 0; }
  100% { transform: translateX(90vw);  opacity: 0; }
}

/* ── LOADER OVERLAY ────────────────────────────── */

.loader-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .5s ease, visibility .5s ease;
}

.loader-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-logo {
  width: 140px;
  height: auto;
  animation: spin 1.2s cubic-bezier(.6,0,.4,1) infinite;
  filter: drop-shadow(0 0 22px rgba(245,184,0,.5));
}

@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #2a1a00;
  border-top-color: var(--yellow);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  box-shadow: 0 0 18px rgba(245,184,0,.3);
}

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

/* ── LOGIN PAGE ────────────────────────────────── */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.login-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  width: 100%;
  max-width: 360px;
}

.login-logo {
  width: 200px;
  height: auto;
  filter: drop-shadow(0 0 18px rgba(245,184,0,.35));
}

.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-form input {
  width: 100%;
  padding: 12px 14px;
  background: #0d0d0d;
  border: 1.5px solid #2e2000;
  border-radius: var(--radius);
  color: var(--yellow);
  font-size: 15px;
  outline: none;
  transition: border-color .25s, box-shadow .25s;
  box-shadow: 0 0 8px rgba(245,184,0,.10);
}

.login-form input::placeholder { color: #5a4500; }

.login-form input:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 18px rgba(245,184,0,.35);
}

.login-form button {
  padding: 13px;
  background: var(--yellow);
  color: var(--black);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .06em;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: 0 0 18px rgba(245,184,0,.35);
  transition: background .2s, box-shadow .2s, transform .1s;
}

.login-form button:hover {
  background: #ffc800;
  box-shadow: 0 0 28px rgba(245,184,0,.6);
}
.login-form button:active { transform: scale(.97); }

.error-msg {
  font-size: 13px;
  color: var(--red);
  text-align: center;
  min-height: 18px;
  transition: opacity .2s;
}

@keyframes shake {
  0%,100%{ transform: translateX(0); }
  20%    { transform: translateX(-8px); }
  40%    { transform: translateX(8px); }
  60%    { transform: translateX(-6px); }
  80%    { transform: translateX(6px); }
}

.shake { animation: shake .35s ease; }

/* ── SITES PAGE ────────────────────────────────── */

.sites-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.sites-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid #1e1500;
}

.sites-header-logo {
  height: 54px;
  width: auto;
  filter: drop-shadow(0 0 10px rgba(245,184,0,.3));
}

.sites-header-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: #7a6000;
}

.logout-btn {
  font-size: 13px;
  color: #7a6000;
  text-decoration: none;
  padding: 7px 14px;
  border: 1px solid #2e2000;
  border-radius: var(--radius);
  transition: color .2s, border-color .2s;
}

.logout-btn:hover { color: var(--yellow); border-color: var(--yellow); }

.sites-main {
  flex: 1;
  padding: 36px 28px;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

.sites-main h1 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #5a4500;
  margin-bottom: 24px;
}

.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

.site-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
}

.site-card:hover {
  border-color: var(--yellow);
  background: #160f00;
  box-shadow: 0 0 14px rgba(245,184,0,.12);
}

.site-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--yellow);
}

.site-card-url {
  font-size: 12px;
  color: #5a4500;
  word-break: break-all;
}

.site-card-desc {
  font-size: 13px;
  color: #a08000;
  margin-top: 4px;
}
