:root {
  --bg: #f4f6f4;
  --surface: #ffffff;
  --border: #dfe4e1;
  --text: #12181a;
  --text-muted: #5c6b66;
  --accent: #0f6b57;
  --accent-dark: #0b4a3e;
  --accent-tint: #dcece5;
  --danger: #b5342b;
  --danger-bg: #fbecea;
  --success: #0f6b57;
  --success-bg: #eaf4ef;
  --radius: 8px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10201c;
    --surface: #16302a;
    --border: #274740;
    --text: #eef4f1;
    --text-muted: #93a8a1;
    --accent: #4fbf9c;
    --accent-dark: #6fd4b1;
    --accent-tint: #1e3d35;
    --danger-bg: #3a1f1c;
    --success-bg: #1a3a2e;
  }
}
:root[data-theme="dark"] {
  --bg: #10201c;
  --surface: #16302a;
  --border: #274740;
  --text: #eef4f1;
  --text-muted: #93a8a1;
  --accent: #4fbf9c;
  --accent-dark: #6fd4b1;
  --accent-tint: #1e3d35;
  --danger-bg: #3a1f1c;
  --success-bg: #1a3a2e;
}
:root[data-theme="light"] {
  --bg: #f4f6f4;
  --surface: #ffffff;
  --border: #dfe4e1;
  --text: #12181a;
  --text-muted: #5c6b66;
  --accent: #0f6b57;
  --accent-dark: #0b4a3e;
  --accent-tint: #dcece5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Left sidebar navigation, shown on every logged-in page */
.app-shell {
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
}
.sidebar {
  width: 240px;
  flex-shrink: 0;
  min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 26px 18px;
}
.sidebar .brand {
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  margin-bottom: 32px;
  padding: 0 10px;
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sidebar nav a {
  color: var(--text-muted);
  font-weight: 500;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
}
.sidebar nav a:hover {
  background: var(--bg);
  color: var(--accent);
  text-decoration: none;
}
.sidebar nav a.active {
  background: var(--accent-tint);
  color: var(--accent);
}
@media (max-width: 720px) {
  .app-shell {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    min-height: 0;
    display: flex;
    align-items: center;
    gap: 16px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .sidebar .brand {
    margin-bottom: 0;
  }
  .sidebar nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

.page {
  flex: 1;
  max-width: 920px;
  margin: 40px auto;
  padding: 0 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 26px;
  margin-bottom: 24px;
  box-shadow: 0 2px 6px rgba(18, 24, 26, 0.07), 0 1px 2px rgba(18, 24, 26, 0.05);
}

h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  margin: 0 0 16px;
}
h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  margin: 0 0 14px;
}
p.hint {
  color: var(--text-muted);
  font-size: 13.5px;
  margin: 0 0 14px;
}

/* Forms */
label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--text-muted);
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 16px;
  background: var(--surface);
  color: var(--text);
}
textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  resize: vertical;
}
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 107, 87, 0.15);
}
input[type="file"] {
  margin-bottom: 16px;
  display: block;
}

button,
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
button:hover,
.btn:hover {
  background: var(--accent-dark);
}
.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--bg);
}

/* Alerts */
.alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  margin-bottom: 16px;
}
.alert-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #fecaca;
}
.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #bbf7d0;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
}
td {
  padding: 14px;
  border-bottom: 1px solid var(--border);
}
tr:last-child td {
  border-bottom: none;
}
tr:hover td {
  background: var(--bg);
}

/* Status badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-active,
.badge-sent {
  background: var(--success-bg);
  color: var(--success);
}
.badge-sending,
.badge-draft,
.badge-pending {
  background: var(--accent-tint);
  color: var(--accent);
}
.badge-bounced,
.badge-complained,
.badge-failed {
  background: var(--danger-bg);
  color: var(--danger);
}
.badge-unsubscribed {
  background: #f1f2f6;
  color: var(--text-muted);
}

/* Centered card for login / unsubscribe (no top nav) */
.center-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.center-page .card {
  width: 100%;
  max-width: 380px;
}
.center-page .card.wide {
  max-width: 480px;
}
.center-page h1 {
  text-align: center;
}
.logo {
  text-align: center;
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 22px;
  color: var(--text);
}

/* Homepage — static image, scaled to fit one screen, no scrolling */
.landing {
  position: relative;
  background: #fff;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.homepage-image {
  position: relative;
  z-index: 1;
  display: inline-block;
  line-height: 0;
}
.homepage-image img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100vw;
  max-height: 100vh;
}
.send-email-hotspot {
  position: absolute;
  left: 5.8%;
  top: 70%;
  width: 17.5%;
  height: 7.5%;
}

/* Login-only screen — logo in the corner, nothing else */
.login-only {
  position: relative;
  min-height: 100vh;
  background: #fff;
  color: var(--text);
}
.login-only-brand {
  position: absolute;
  top: 24px;
  left: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
}
.login-only-brand .logo-mark {
  width: 26px;
  height: 26px;
  color: var(--accent);
  flex-shrink: 0;
}

.login-section {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 340px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px 28px;
  box-shadow: 0 24px 60px -20px rgba(6, 30, 45, 0.2);
}
.login-card h2 {
  color: var(--text);
  font-size: 20px;
  margin-bottom: 4px;
}
.login-card p.hint {
  margin-bottom: 22px;
}
.login-card button:hover {
  filter: brightness(1.08);
}

/* Domain setup checklist */
.setup-step {
  display: flex;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 16px;
  box-shadow: 0 2px 6px rgba(18, 24, 26, 0.07), 0 1px 2px rgba(18, 24, 26, 0.05);
}
.setup-step-num {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-tint);
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.setup-step-body h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15.5px;
  margin: 0 0 8px;
}
.setup-step-body p {
  font-size: 13.5px;
  color: var(--text);
  margin: 0 0 10px;
  line-height: 1.6;
}
.setup-step-body p.hint {
  color: var(--text-muted);
}
.setup-step-body code {
  background: var(--bg);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
}
.code-block {
  background: #12181a;
  color: #d7e2df;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  padding: 12px 14px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 0 0 10px;
  white-space: pre-wrap;
  word-break: break-all;
}
.domain-fill {
  color: var(--accent);
  font-weight: 600;
}
