:root {
  /* The house palette, from the main site: legacy indigo and magenta, the
     lavender and paper around them. The dashboard is a page of the brand,
     not a different one. */
  --fg: #2B2440;            /* ink */
  --muted: #6B6480;
  --bg: #FBFAFD;            /* paper */
  --accent: #8A3390;        /* magenta: links, hover */
  --accent-dark: #2A0F69;   /* indigo: heads, buttons */
  --lavender: #C9B8E8;
  --border: #DFDAEA;
  --max: 62rem;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--fg);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* header / nav: the indigo band the main site uses, with its lockup */
.site-header { background: var(--accent-dark); border-bottom: 1px solid var(--lavender); }
.nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: .75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.brand-lockup { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; }
.brand-lockup:hover { text-decoration: none; opacity: .92; }
.brand-word { font-family: 'Jost', 'Century Gothic', 'URW Gothic', sans-serif; font-weight: 600; font-size: .8rem;
              letter-spacing: .16em; line-height: 1.15; color: #fff; }
.brand-word-2 { color: var(--lavender); font-weight: 500; }
.brand { font-weight: 700; font-size: 1.2rem; color: #fff; padding-left: 1rem; border-left: 1px solid rgba(201,184,232,.4); }
.brand:hover { color: var(--lavender); text-decoration: none; }
.spacer { flex: 1; }
.nav a, .nav .linkbtn { color: #F3EDFA; }
.nav a:hover, .nav .linkbtn:hover { color: var(--lavender); text-decoration: none; }
.navlink { font-size: .95rem; }
.nav .btn { background: var(--accent); }
.nav .btn:hover { background: #a3449f; }

/* main / footer */
.content { max-width: var(--max); margin: 0 auto; padding: 2.5rem 1.25rem; width: 100%; flex: 1; }
.site-footer { border-top: 1px solid var(--border); color: var(--muted); }
.site-footer a { color: var(--accent); }
.site-footer small { display: block; max-width: var(--max); margin: 0 auto; padding: 1.25rem; }

/* hero + features */
.hero h1 { font-size: 2.4rem; margin: 0 0 .5rem; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 40rem; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.5rem; margin-top: 3rem; }
.feature { padding: 1.25rem; border: 1px solid var(--border); border-radius: .5rem; }
.feature h3 { margin-top: 0; }

/* buttons */
.btn {
  display: inline-block;
  padding: .6rem 1.15rem;
  background: var(--accent);
  color: #fff;
  border-radius: .4rem;
  font-weight: 600;
}
.btn:hover { background: var(--accent-dark); text-decoration: none; }
.btn-small { padding: .35rem .8rem; font-size: .9rem; }
.btn-ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn-ghost:hover { background: #f0f6fc; }

.linkbtn {
  background: none; border: none; padding: 0; margin: 0;
  color: var(--accent); font: inherit; cursor: pointer;
}
.linkbtn:hover { text-decoration: underline; }
.inline-form { display: inline; }

/* messages */
.messages { list-style: none; max-width: var(--max); margin: 1rem auto 0; padding: 0 1.25rem; }
.msg { padding: .6rem 1rem; border-radius: .4rem; margin-bottom: .5rem; }
.msg.success { background: #e6f6ec; color: #1b5e34; }
.msg.error { background: #fdecea; color: #8a1c14; }
.msg.warning { background: #fff6e5; color: #7a5200; }
.msg.info { background: #e8f0fe; color: #1a3d7c; }

/* forms (allauth pages inherit these) */
form p { margin: .75rem 0; }
label { display: block; font-weight: 600; margin-bottom: .25rem; }
input[type=text], input[type=email], input[type=password] {
  width: 100%; max-width: 24rem; padding: .55rem .65rem;
  border: 1px solid var(--border); border-radius: .4rem; font: inherit;
}
button[type=submit], .button {
  display: inline-block; padding: .6rem 1.15rem; margin-top: .5rem;
  background: var(--accent); color: #fff; border: none; border-radius: .4rem;
  font: inherit; font-weight: 600; cursor: pointer;
}
button[type=submit]:hover { background: var(--accent-dark); }

.muted { color: var(--muted); }
.errorlist { color: #8a1c14; list-style: none; padding: 0; margin: .25rem 0; }

/* dashboard */
.tablewrap { overflow-x: auto; margin: 1rem 0 1.5rem; }
.machines { border-collapse: collapse; width: 100%; min-width: 40rem; font-size: .95rem; }
.machines th, .machines td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.machines th { font-weight: 600; color: var(--muted); font-size: .85rem; }
.tag { font-size: .75rem; color: var(--muted); border: 1px solid var(--border); border-radius: .3rem; padding: 0 .35rem; margin-left: .4rem; }
.state { display: inline-block; padding: .1rem .5rem; border-radius: .3rem; font-size: .85rem; white-space: nowrap; }
.state-active, .state-connected { background: #e6f6ec; color: #1b5e34; }
.state-awaiting-enrollment { background: #fff6e5; color: #7a5200; }
.state-not-enrolled, .state-down { background: #fdecea; color: #8a1c14; }
.state-withheld, .state-unknown { background: #eee; color: #555; }
.state-up { background: #e6f6ec; color: #1b5e34; }
.howto { margin: 1rem 0; }
.howto summary { cursor: pointer; color: var(--accent); }
pre { background: #f6f6f6; border: 1px solid var(--border); border-radius: .4rem; padding: .8rem 1rem; overflow-x: auto; font-size: .9rem; }
.state-login, .state-grant { background: #e6f6ec; color: #1b5e34; }
.state-login-failed, .state-revoke { background: #fdecea; color: #8a1c14; }
.state-expired { background: #eee; color: #555; }
.products { padding-left: 1.2rem; }
.dashboard h1 + h1, .dashboard section + h1 { margin-top: 2.5rem; }
