@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Source+Sans+3:wght@300;400;600&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --purple:        #450084;
  --purple-dark:   #2d0059;
  --purple-mid:    #5c1a9e;
  --gold:          #c9a227;
  --gold-light:    #e8c96a;
  --gold-pale:     #f9f2de;
  --white:         #ffffff;
  --off-white:     #f7f5fb;
  --text:          #1a1a2e;
  --text-muted:    #6b6b8a;
  --border:        #ddd5f0;
  --shadow-sm:     0 2px 8px rgba(69,0,132,.10);
  --shadow-md:     0 6px 24px rgba(69,0,132,.15);
  --shadow-lg:     0 12px 48px rgba(69,0,132,.20);
  --radius:        12px;
  --radius-lg:     20px;
  --transition:    0.25s cubic-bezier(.4,0,.2,1);
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 400;
  color: var(--text);
  background: var(--off-white);
  min-height: 100vh;
  line-height: 1.6;
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(69,0,132,.07) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(201,162,39,.08) 0%, transparent 60%);
}

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  color: var(--purple);
  line-height: 1.2;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.3rem; }

p { color: var(--text-muted); line-height: 1.75; }

a {
  color: var(--purple);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition);
}
a:hover { color: var(--gold); }

/* ── Layout ###################################################### */
.container {
  width: 90%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Navigation ###################################################### */
nav, .navbar {
  background: var(--purple);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(69,0,132,.3);
}

.navbar-brand, nav .brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--gold) !important;
  letter-spacing: .5px;
}

.navbar-nav, nav ul {
  list-style: none;
  display: flex;
  gap: 0;
  align-items: center;
  justify-content: space-evenly;
  flex: 1;
  margin-left: 2rem;
}

.nav-link, nav ul a {
  color: rgba(255,255,255,.85) !important;
  font-size: .95rem;
  font-weight: 600;
  padding: .45rem 1rem;
  border-radius: 8px;
  transition: background var(--transition), color var(--transition);
}

.nav-link:hover, nav ul a:hover {
  background: rgba(201,162,39,.2);
  color: var(--gold-light) !important;
}

/* ── Auth Card (login / signup) ######################################################*/
.auth-wrapper {
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 3rem 2.75rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  border-top: 5px solid var(--gold);
  animation: fadeUp .45s ease both;
}

.auth-card h2 {
  margin-bottom: .4rem;
  text-align: center;
}

.auth-card .subtitle {
  text-align: center;
  margin-bottom: 2rem;
  font-size: .95rem;
}

/* ── Forms ###################################################### */
form p {           
  margin-bottom: 1.2rem;
  color: var(--text);
}

label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--purple);
  margin-bottom: .4rem;
  letter-spacing: .02em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: .72rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1rem;
  color: var(--text);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(69,0,132,.12);
}

input::placeholder { color: #b0aac4; }

/* help text Django adds */
.helptext, span.helptext {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: .25rem;
  display: block;
}

/* validation errors */
ul.errorlist {
  list-style: none;
  margin: .35rem 0 0;
}
ul.errorlist li {
  font-size: .83rem;
  color: #c0392b;
  font-weight: 600;
}

/* Remember me row */
.remember-row {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-bottom: 1.5rem;
}
.remember-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--purple);
}
.remember-row label {
  margin: 0;
  font-size: .9rem;
  font-weight: 400;
  color: var(--text-muted);
  cursor: pointer;
}

/* ── Buttons ###################################################### */
button,
input[type="submit"],
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  padding: .8rem 1.5rem;
  background: var(--purple);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .03em;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-sm);
  margin-top: .5rem;
}

button:hover, input[type="submit"]:hover, .btn:hover {
  background: var(--purple-mid);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

button:active, input[type="submit"]:active, .btn:active {
  transform: translateY(0);
}

.btn-gold {
  background: var(--gold);
  color: var(--purple-dark);
}
.btn-gold:hover { background: var(--gold-light); }

.btn-outline {
  background: transparent;
  color: var(--purple);
  border: 2px solid var(--purple);
}
.btn-outline:hover {
  background: var(--purple);
  color: var(--white);
}

/* ── Home / Welcome page ######################################################*/
.welcome-hero {
  text-align: center;
  padding: 5rem 1rem 3rem;
}

.welcome-hero h1 {
  margin-bottom: .75rem;
}

.welcome-hero p {
  font-size: 1.1rem;
  max-width: 560px;
  margin: 0 auto 2rem;
}

/* ── Cards (general content) ─────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 2rem 0;
}

/* ── Gold divider ────────────────────────────────────────────── */
.divider {
  border: none;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light), transparent);
  border-radius: 2px;
  margin: 2rem 0;
}

/* ── Alert / flash messages ──────────────────────────────────── */
.messages { list-style: none; padding: 0; margin: 1rem 0; }

.messages li {
  padding: .8rem 1.2rem;
  border-radius: var(--radius);
  font-size: .92rem;
  font-weight: 600;
  margin-bottom: .5rem;
}

.messages .success { background: #e9f7ef; color: #1e8449; border-left: 4px solid #27ae60; }
.messages .error   { background: #fdecea; color: #c0392b; border-left: 4px solid #e74c3c; }
.messages .info    { background: #eef2ff; color: var(--purple); border-left: 4px solid var(--purple); }

/* ── Footer ──────────────────────────────────────────────────── */
footer {
  background: var(--purple-dark);
  color: rgba(255,255,255,.65);
  text-align: center;
  padding: 1.75rem 1rem;
  font-size: .875rem;
  margin-top: 4rem;
}

footer span { color: var(--gold); font-weight: 700; }

/* ── Animations ──────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 600px) {
  .auth-card { padding: 2rem 1.5rem; }
  nav, .navbar { padding: 0 1rem; }
}


.nav-sep {
  color: var(--gold);
  font-weight: 300;
  font-size: 1.1rem;
  user-select: none;
}

.main-base {
  padding: 0;
  margin: 0;
  min-height: calc(100vh - 60px); 
  display: flex;
  flex-direction: column;
}

.ws-status {
  display: inline-block;
  font-size: 0.78rem;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  border: 1px solid transparent;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.ws-connecting {
  color: #fff4d6;
  background: rgba(201, 162, 39, 0.22);
  border-color: rgba(232, 201, 106, 0.35);
}

.ws-connected {
  color: #d8ffe8;
  background: rgba(39, 174, 96, 0.24);
  border-color: rgba(130, 255, 188, 0.35);
}

.ws-disconnected {
  color: #ffe0e0;
  background: rgba(231, 76, 60, 0.24);
  border-color: rgba(255, 176, 176, 0.4);
}

.ws-live-toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 150;
  max-width: 360px;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  border-left: 4px solid var(--gold);
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
}

.ws-live-toast.visible {
  opacity: 1;
  transform: translateY(0);
}