:root {
  --navy:      #0A1628;
  --blue:      #2563EB;
  --amber:     #F59E0B;
  --blue-light: #EEF4FF;
  --amber-light: #FEF9EC;
  --grey-bg:   #F5F7FA;
  --grey-line: #E2E6EC;
  --grey-mid:  #5B6472;
  --text:      #0F1115;
  --white:     #FFFFFF;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--grey-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── LOGO ── */
.logo {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: 0.02em;
  color: var(--navy);
  text-decoration: none;
}
.logo .e { color: var(--blue); }
.logo .c { color: var(--amber); }

/* ── NAV ── */
.site-nav {
  background: var(--white);
  border-bottom: 1px solid var(--grey-line);
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 4px rgba(10, 22, 40, 0.05);
}

/* ── BUTTONS ── */
.btn-primary {
  display: inline-block;
  padding: 11px 24px;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 14px rgba(10, 22, 40, 0.18);
}
.btn-primary:hover {
  background: var(--blue);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
}

/* ── AUTH PAGE BACKGROUND ── */
.auth-bg {
  min-height: calc(100vh - 65px);
  background: linear-gradient(135deg, #F0F5FF 0%, #F5F7FA 45%, #FFFBF2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
}

/* ── CARD ── */
.card {
  background: var(--white);
  border: 1px solid var(--grey-line);
  border-radius: 24px;
  padding: 40px;
  box-shadow:
    0 2px 8px rgba(10, 22, 40, 0.06),
    0 16px 48px rgba(10, 22, 40, 0.10);
  position: relative;
  overflow: hidden;
}

/* gradient accent bar across the top of the card */
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--blue) 0%, var(--blue) 50%, var(--amber) 50%, var(--amber) 100%);
  border-radius: 24px 24px 0 0;
}

/* ── STYLED FORM (form.as_p) ── */
.styled-form p {
  margin-bottom: 18px;
}

.styled-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.styled-form input[type="text"],
.styled-form input[type="email"],
.styled-form input[type="password"],
.styled-form input[type="tel"],
.styled-form input[type="number"],
.styled-form input[type="date"],
.styled-form input[type="datetime-local"],
.styled-form select,
.styled-form textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--grey-line);
  border-radius: 12px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.styled-form select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.styled-form input[type="number"] {
  appearance: textfield;
}

.styled-form input[type="number"]::-webkit-inner-spin-button,
.styled-form input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.styled-form input:focus,
.styled-form select:focus,
.styled-form textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* help text Django renders below password fields */
.styled-form .helptext {
  display: block;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--grey-mid);
  line-height: 1.5;
}

.styled-form .helptext ul {
  list-style: none;
  padding: 0;
}

.styled-form .helptext li {
  padding-left: 14px;
  position: relative;
}

.styled-form .helptext li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--amber);
  font-weight: 700;
}

/* ── ERRORS ── */
.errorlist {
  list-style: none;
  margin-top: 6px;
}
.errorlist li {
  font-size: 0.82rem;
  color: #DC2626;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 4px;
}

/* ── FLASH MESSAGES ── */
.flash-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  align-items: center;
}

.flash-message {
  padding: 13px 18px;
  border-radius: 14px;
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  max-width: 380px;
  pointer-events: all;
  box-shadow: 0 8px 24px rgba(10, 22, 40, 0.12);
  animation: toast-in 0.25s ease;
}

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

.flash-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.flash-error, .flash-warning {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.flash-info {
  background: var(--blue-light);
  color: var(--navy);
  border: 1px solid #bfdbfe;
}

:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
