:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --cardSubtle: #f2f3f6; /* subtle contrast surface */
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #111827;
  --primaryHover: #1f2937;
  --primaryText: #ffffff;
  --danger: #b91c1c;
  --success: #047857;
}

/* ============================================================ */
/* Base                                                         */
/* ============================================================ */

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color: var(--text);
  background: var(--bg);
}

/* ============================================================ */
/* Layout                                                       */
/* ============================================================ */

.page {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.card {
  width: 100%;
  max-width: 720px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 10px 25px rgba(17,24,39,0.08);
}

/* ============================================================ */
/* Branding                                                     */
/* ============================================================ */

.brand { text-align: center; }

.brand h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
}

.subtle {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

/* ============================================================ */
/* Buttons                                                      */
/* ============================================================ */

.btn {
  height: 48px;
  padding: 0 20px;
  border-radius: 14px;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.btn.primary {
  background: var(--primary);
  color: var(--primaryText);
}

.btn.primary:hover {
  background: var(--primaryHover);
}

.btn.secondary {
  background: #f3f4f6;
}

.btn.danger {
  background: var(--danger);
  color: #fff;
}

/* ============================================================ */
/* Events                                                       */
/* ============================================================ */

.events-toolbar {
  margin-top: 24px;
  text-align: right;
}

.account-actions {
  margin-top: 28px;
  display: flex;
  justify-content: center;
}

.account-action-btn {
  width: min(100%, 320px);
  height: 60px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  text-decoration: none;
}

.event-list {
  margin-top: 24px;
  display: grid;
  gap: 18px;
}

.event-card {
  background: var(--cardSubtle);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

.event-card.readonly {
  background: #eef0f3;
}

.event-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.event-desc {
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-bottom: 1px solid var(--border);
  width: 100%;
  background: transparent;
}

.event-badge {
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.event-badge.owned {
  background: #dcfce7;
  color: #166534;
}

.event-badge.shared {
  background: #e5e7eb;
}

.event-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.event-fields label span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.event-fields input,
.event-fields select {
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
}

.event-annual-wrap {
  display: flex;
  align-items: flex-end;
  padding-bottom: 6px;
}

.event-annual-wrap label {
  display: flex;
  gap: 8px;
  align-items: center;
}

.event-annual-hint {
  margin-top: 4px;
  font-size: 13px;
  color: var(--success);
}

.event-annual-hint.hidden {
  display: none;
}

.event-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
}

/* ============================================================ */
/* Forms (login / register / provision)                          */
/* ============================================================ */

.form {
  margin-top: 22px;
}

.field {
  display: block;
  margin-bottom: 16px;
}

.field > span {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  height: 46px;
  padding: 10px 12px;
  font-size: 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  outline: none;
  background: #fff;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.field input::placeholder {
  color: #9ca3af;
}

.field input:focus {
  border-color: #9ca3af;
  box-shadow: 0 0 0 3px rgba(17,24,39,0.12);
}

.hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

/* ============================================================ */
/* Messages                                                     */
/* ============================================================ */

.msg {
  min-height: 20px;
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--danger);
}

.msg.success {
  color: var(--success);
}

/* ============================================================ */
/* Links / footer                                               */
/* ============================================================ */

.links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  gap: 12px;
}

.links a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

.links a:hover {
  text-decoration: underline;
}

.linklike {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  color: #9ca3af;
  font-weight: 600;
  font-size: 14px;
  cursor: not-allowed;
}

.fineprint {
  margin: 14px 0 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

/* ============================================================ */
/* Dashboard                                                    */
/* ============================================================ */

.dashboard {
  max-width: 560px;
}

.nav-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 28px;
}

.nav-card {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 18px;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--cardSubtle);
  text-decoration: none;
  color: inherit;
  transition:
    box-shadow 0.15s ease,
    transform 0.08s ease,
    background-color 0.15s ease;
}

.nav-card:hover {
  background: #eceef2;
  box-shadow: 0 8px 20px rgba(17,24,39,0.12);
  transform: translateY(-2px);
}

.nav-icon {
  font-size: 32px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-body h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.nav-body p {
  margin: 6px 0 0 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.4;
}

.dashboard-footer {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
}


/* ============================================================ */
/* Navigation on Events page   2                                */
/* ============================================================ */

.events-nav {
  margin-bottom: 1rem;
}

.events-nav.bottom {
  margin-top: 1.5rem;
  text-align: center;
}

.device-list {
  margin-top: 24px;
  display: grid;
  gap: 26px; /* more separation than events */
}

.device-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  margin-left: 12px;
}

.device-id {
  font-size: 12px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* ------------------------------------------------------------ */
/* Primary CTA – Add New Device                                 */
/* ------------------------------------------------------------ */

.btn.add-device {
  display: flex;          /* ⬅️ critical */
  align-items: center;           /* vertical centering */
  justify-content: center;

  height: 64px;
  padding: 0 36px;

  background: var(--success);
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;

  border-radius: 18px;
  box-shadow: 0 10px 22px rgba(4,120,87,0.40);
}



.btn.add-device:hover {
  background: #059669; /* slightly brighter green */
  box-shadow: 0 10px 24px rgba(4,120,87,0.45);
  transform: translateY(-1px);
}


.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-wrap input {
  width: 20px;
  height: 20px;
}

.device-toggle-wrap {
  align-items: center;
  padding-bottom: 0;
}
.login-cta-top {
  margin-bottom: 18px;
  text-align: center;
}

.login-cta-simple {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, #6ee7b7, #34d399);
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(16, 185, 129, 0.28);
  width: min(100%, 360px);
  margin: 0 auto;
}

.login-cta-simple-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  color: #ffffff;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

.login-cta-simple-title {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
}

.login-cta-simple-subtitle {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  opacity: 0.95;
}

