:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background:
    radial-gradient(ellipse 120% 80% at 50% -10%, rgba(22, 40, 62, 0.6), transparent 60%),
    #0B1624;
  color: #F4EFE4;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6vh 1.5rem;
}

.portal-card {
  width: 100%;
  max-width: 420px;
  background: rgba(244, 239, 228, 0.04);
  border: 1px solid rgba(244, 239, 228, 0.1);
  border-radius: 16px;
  padding: 2.25rem;
}

.portal-card.wide {
  max-width: 720px;
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 2rem;
}

.portal-brand img {
  height: 28px;
  width: auto;
}

.portal-brand span {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(244, 239, 228, 0.55);
}

h1.portal-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: #F4EFE4;
}

p.portal-sub {
  font-size: 0.9rem;
  line-height: 1.55;
  color: rgba(244, 239, 228, 0.65);
  margin: 0 0 1.75rem;
}

label {
  display: block;
  font-size: 0.8rem;
  color: rgba(244, 239, 228, 0.7);
  margin: 0 0 0.4rem;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 0.7rem 0.85rem;
  margin-bottom: 1.1rem;
  background: rgba(11, 22, 36, 0.6);
  border: 1px solid rgba(244, 239, 228, 0.18);
  border-radius: 8px;
  color: #F4EFE4;
  font-size: 0.95rem;
}

input:focus {
  outline: none;
  border-color: #E9B44C;
}

button.portal-submit {
  width: 100%;
  padding: 0.8rem;
  background: #E9B44C;
  color: #0B1624;
  border: none;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

button.portal-submit:hover {
  background: #f2c569;
}

button.portal-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.portal-msg {
  margin-top: 1rem;
  font-size: 0.85rem;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  display: none;
}

.portal-msg.error {
  display: block;
  background: rgba(217, 88, 76, 0.12);
  border: 1px solid rgba(217, 88, 76, 0.4);
  color: #f2a99e;
}

.portal-msg.ok {
  display: block;
  background: rgba(76, 175, 130, 0.12);
  border: 1px solid rgba(76, 175, 130, 0.4);
  color: #9bd9b8;
}

.portal-footer-link {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: rgba(244, 239, 228, 0.55);
  text-align: center;
}

.portal-footer-link a {
  color: #E9B44C;
  text-decoration: none;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1.75rem 0;
}

.dashboard-tile {
  background: rgba(11, 22, 36, 0.6);
  border: 1px solid rgba(244, 239, 228, 0.1);
  border-radius: 10px;
  padding: 1.1rem;
}

.dashboard-tile .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(244, 239, 228, 0.5);
  margin-bottom: 0.4rem;
}

.dashboard-tile .value {
  font-size: 1.4rem;
  font-weight: 600;
}

.logout-link {
  background: none;
  border: none;
  color: rgba(244, 239, 228, 0.55);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.portal-section-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 2rem 0 1rem;
  color: #F4EFE4;
}

.campaign-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.campaign-card {
  background: rgba(11, 22, 36, 0.6);
  border: 1px solid rgba(244, 239, 228, 0.1);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
}

.campaign-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.campaign-name {
  font-weight: 600;
  font-size: 1rem;
}

.status-badge {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid currentColor;
}

.status-draft { color: rgba(244, 239, 228, 0.6); }
.status-active { color: #9bd9b8; }
.status-paused { color: #E9B44C; }
.status-exhausted { color: #f2a99e; }

.campaign-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.6rem;
  margin: 0.9rem 0;
  font-size: 0.82rem;
  color: rgba(244, 239, 228, 0.65);
}

.campaign-meta strong {
  display: block;
  font-size: 0.95rem;
  color: #F4EFE4;
  font-weight: 600;
}

.campaign-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

button.portal-btn-secondary {
  padding: 0.45rem 1rem;
  background: transparent;
  color: #F4EFE4;
  border: 1px solid rgba(244, 239, 228, 0.25);
  border-radius: 999px;
  font-size: 0.82rem;
  cursor: pointer;
}

button.portal-btn-secondary:hover {
  border-color: rgba(244, 239, 228, 0.5);
}

button.portal-btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.campaign-edit-form {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(244, 239, 228, 0.1);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0 1rem;
}

.portal-empty {
  font-size: 0.85rem;
  color: rgba(244, 239, 228, 0.5);
}

details.portal-new-campaign summary {
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  color: #E9B44C;
  padding: 0.6rem 0;
}

details.portal-new-campaign[open] summary {
  margin-bottom: 0.75rem;
}
