/* ── Login Page — THE SOVEREIGN — Full Viewport Experience ──── */

@property --border-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

:root {
  --bg: #0B0D14;
  --accent: #C9A96E;
  --accent-rgb: 201, 169, 110;
  --text: #EDE8DC;
  --text-muted: #9B9590;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
}

/* ── Background ─────────────────────────────────────────────── */
.login-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: transparent;
}

.login-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 500px at 30% 40%, rgba(201,169,110,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 500px 400px at 70% 60%, rgba(201,169,110,0.04) 0%, transparent 50%);
  background-size: 200% 200%;
  animation: bg-drift 20s ease infinite;
  opacity: 0.5;
}

@keyframes bg-drift {
  0%   { background-position: 0% 0%; }
  50%  { background-position: 100% 100%; }
  100% { background-position: 0% 0%; }
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(201,169,110,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201,169,110,0.015) 1px, transparent 1px);
  background-size: 60px 60px;
}

.particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  bottom: -10px;
  border-radius: 50%;
  background: rgba(201,169,110,0.5);
  opacity: 0;
  animation: floatUp linear infinite;
  box-shadow: 0 0 6px rgba(201,169,110,0.3);
}
.particle:nth-child(3n) { background: rgba(201,169,110,0.3); box-shadow: 0 0 6px rgba(201,169,110,0.2); }
.particle:nth-child(5n) { background: rgba(237,232,220,0.2); box-shadow: 0 0 6px rgba(237,232,220,0.15); }
.particle:nth-child(7n) { background: rgba(201,169,110,0.4); box-shadow: 0 0 6px rgba(201,169,110,0.25); }

@keyframes floatUp {
  0%   { transform: translateY(0) scale(1);    opacity: 0; }
  10%  { opacity: 0.4; }
  90%  { opacity: 0.15; }
  100% { transform: translateY(-100vh) scale(0.4); opacity: 0; }
}

/* ═════════════════════════════════════════════════════════════
   FULL VIEWPORT LAYOUT — no card, content fills the screen
   ═════════════════════════════════════════════════════════════ */

.login-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  padding: 40px;
  gap: 0;
}

/* The "card" is now a full glass panel filling most of the viewport */
.login-card {
  --border-angle: 0deg;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  text-align: center;
  padding: 40px;
  border: none;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  animation: none;
  overflow: visible;
}

@keyframes border-rotate { to { --border-angle: 360deg; } }

@keyframes card-enter {
  from { opacity: 0; transform: translateY(30px) scale(0.97); filter: blur(8px); }
  60%  { filter: blur(0); }
  to   { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

.login-card::before, .login-card::after { display: none; }

/* ── Emblem ─────────────────────────────────────────────────── */
.login-emblem {
  font-size: 6rem;
  color: var(--accent);
  margin-bottom: 20px;
  text-shadow:
    0 0 30px rgba(201,169,110,0.5),
    0 0 80px rgba(201,169,110,0.2),
    0 0 140px rgba(201,169,110,0.08);
  animation: emblem-pulse 3s ease-in-out infinite, emblem-enter 0.6s cubic-bezier(0.16,1,0.3,1) 0.3s both;
  transition: text-shadow 0.3s ease, transform 0.3s ease;
  cursor: default;
}

.login-emblem:hover {
  text-shadow:
    0 0 50px rgba(201,169,110,0.9),
    0 0 100px rgba(201,169,110,0.5),
    0 0 160px rgba(201,169,110,0.2);
  transform: scale(1.1);
}

@keyframes emblem-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes emblem-enter {
  from { opacity: 0; transform: scale(0.6) translateY(15px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Title — BIG, fills the width ───────────────────────────── */
.login-title {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(2.5rem, 7vw, 6rem);
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text);
  margin: 0;
  line-height: 1.1;
  clip-path: inset(0 100% 0 0);
  animation: text-reveal 1s ease forwards 0.8s;
  white-space: nowrap;
}

@keyframes text-reveal {
  to { clip-path: inset(0 0 0 0); }
}

/* ── Subtitle — NEXUS huge and gold ─────────────────────────── */
.login-subtitle {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(2rem, 6vw, 5rem);
  font-weight: 600;
  letter-spacing: 0.6em;
  color: var(--accent);
  margin-top: 8px;
  text-shadow: 0 0 40px rgba(201,169,110,0.2);
  clip-path: inset(0 100% 0 0);
  animation: text-reveal 1s ease forwards 1.1s;
}

/* ── Divider — gold shimmer ─────────────────────────────────── */
.login-divider {
  width: 300px;
  height: 2px;
  margin: 30px auto;
  background: linear-gradient(90deg, transparent, rgba(201,169,110,0.5), transparent);
  background-size: 200% 100%;
  animation: divider-shimmer 3s ease infinite, divider-scale 0.5s ease forwards 1.4s;
  transform: scaleX(0);
}

@keyframes divider-shimmer {
  0%   { background-position: -100% 0; }
  100% { background-position: 100% 0; }
}
@keyframes divider-scale {
  to { transform: scaleX(1); }
}

/* ── Role prompt ────────────────────────────────────────────── */
.login-role-prompt {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: rgba(237,232,220,0.6);
  margin-bottom: 28px;
  text-transform: uppercase;
  opacity: 0;
  animation: fade-up 0.5s ease forwards 1.7s;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Buttons — LARGE, prominent ─────────────────────────────── */
.login-role-buttons {
  display: flex;
  gap: 32px;
  justify-content: center;
}

.login-btn {
  --spot-x: 50%;
  --spot-y: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 22px 72px;
  background: radial-gradient(circle at var(--spot-x) var(--spot-y), rgba(201,169,110,0.08) 0%, rgba(201,169,110,0.02) 50%, transparent 100%);
  border: 1px solid rgba(201,169,110,0.18);
  border-radius: 14px;
  color: var(--text);
  font-family: 'Oswald', sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.16,1,0.3,1);
  position: relative;
  overflow: hidden;
  opacity: 0;
}

.login-btn-admin { animation: btn-enter 0.5s ease forwards 2s; }
.login-btn-agent { animation: btn-enter 0.5s ease forwards 2.2s; }

@keyframes btn-enter {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-btn:hover {
  background: radial-gradient(circle at var(--spot-x) var(--spot-y), rgba(201,169,110,0.2) 0%, rgba(201,169,110,0.06) 50%, rgba(201,169,110,0.02) 100%);
  border-color: rgba(201,169,110,0.5);
  box-shadow: 0 12px 48px rgba(0,0,0,0.4), 0 0 40px rgba(201,169,110,0.1);
  transform: translateY(-3px);
  color: #fff;
}

.login-btn:active {
  transform: translateY(-1px) scale(0.98);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

/* Button ripple */
.btn-ripple {
  position: absolute;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(201,169,110,0.3);
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0);
  animation: btn-ripple 0.7s ease forwards;
}

@keyframes btn-ripple {
  to { transform: translate(-50%, -50%) scale(5); opacity: 0; }
}

/* ── Hint ───────────────────────────────────────────────────── */
.login-role-hint {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: rgba(237,232,220,0.3);
  margin-top: 28px;
  opacity: 0;
  animation: fade-up 0.5s ease forwards 2.5s;
}

/* ═════════════════════════════════════════════════════════════
   RESPONSIVE
   ═════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .login-card {
    width: 95vw;
    height: 90vh;
    padding: 30px 30px;
  }
  .login-title { font-size: clamp(1.8rem, 5vw, 3rem); }
  .login-subtitle { font-size: clamp(1.5rem, 4vw, 2.5rem); }
  .login-btn { padding: 16px 44px; font-size: 1.2rem; }
}

@media (max-width: 600px) {
  .login-card {
    width: 96vw;
    height: 92vh;
    padding: 24px 20px;
    border-radius: 18px;
  }
  .login-title {
    font-size: 1.6rem;
    letter-spacing: 0.1em;
    white-space: normal;
  }
  .login-subtitle {
    font-size: 1.3rem;
    letter-spacing: 0.4em;
  }
  .login-emblem { font-size: 3.5rem; }
  .login-role-buttons { flex-direction: column; gap: 14px; width: 100%; }
  .login-btn { padding: 16px 32px; font-size: 1.1rem; width: 100%; justify-content: center; }
  .login-card::before, .login-card::after { width: 40px; height: 40px; }
  .login-divider { width: 160px; }
}

@media (max-width: 400px) {
  .login-card { padding: 20px 16px; height: 94vh; }
  .login-title { font-size: 1.3rem; letter-spacing: 0.08em; }
  .login-subtitle { font-size: 1rem; letter-spacing: 0.25em; }
  .login-emblem { font-size: 2.8rem; }
  .login-btn { padding: 14px 24px; font-size: 1rem; }
}

/* ═════════════════════════════════════════════════════════════
   LIGHT MODE
   ═════════════════════════════════════════════════════════════ */

html[data-theme="light"] body { background: #F5F2EB; }
html[data-theme="light"] .login-bg { background: transparent; }
html[data-theme="light"] .login-bg::before { opacity: 0.3; }

html[data-theme="light"] .login-card {
  background: transparent;
  box-shadow: none;
}

html[data-theme="light"] .login-title { color: #2C2A26; }
html[data-theme="light"] .login-subtitle { color: #B08D3E; text-shadow: 0 0 30px rgba(176,141,62,0.10); }
html[data-theme="light"] .login-divider { background: linear-gradient(90deg, transparent, rgba(176,141,62,0.28), transparent); background-size: 200% 100%; }
html[data-theme="light"] .login-role-prompt { color: rgba(44,42,38,0.5); }
html[data-theme="light"] .login-btn { border-color: rgba(176,141,62,0.18); color: #2C2A26; }
html[data-theme="light"] .login-btn:hover { border-color: rgba(176,141,62,0.40); box-shadow: 0 12px 48px rgba(120,100,60,0.08), 0 0 40px rgba(176,141,62,0.06); }
html[data-theme="light"] .login-role-hint { color: rgba(44,42,38,0.3); }
html[data-theme="light"] .login-emblem { color: #B08D3E; text-shadow: 0 0 30px rgba(176,141,62,0.25), 0 0 80px rgba(176,141,62,0.08); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(201,169,110,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(201,169,110,0.3); }
