:root {
  --bg: #0a0a0a;
  --card: #171717;
  --card-border: #262626;
  --card-border-hover: #404040;
  --text: #ffffff;
  --text-dim: #a3a3a3;
  --text-dimmer: #737373;
  --accent: #2563eb;
  --accent-light: #60a5fa;
  --accent-hover: #3b82f6;
  --danger: #f87171;
  --success: #4ade80;
}

* {
  box-sizing: border-box;
}

html, body {
  background: var(--bg);
  color: var(--text);
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

body {
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  min-height: 100dvh;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ---------- Página pública ---------- */

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

.logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 16px 16px;
  text-align: center;
}

.logo-img {
  max-width: 280px;
  margin-bottom: 16px;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.4));
}

.site-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.action-btn,
.notif-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--card-border);
  padding: 14px 16px;
  color: var(--text);
  text-decoration: none;
  font: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.action-btn .icon {
  color: var(--accent-light);
  transition: transform 0.2s ease;
}

.action-btn:hover,
.notif-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.08);
}

.action-btn:hover .icon {
  transform: scale(1.12);
}

.action-btn:active,
.notif-btn:active {
  transform: scale(0.97);
}

.notif-btn.is-subscribed {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.4);
  color: #93c5fd;
}

.notif-btn .icon {
  color: currentColor;
}

.btn-label {
  font-weight: 500;
  font-size: 14px;
}

.action-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.social-circle {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border: 1px solid var(--card-border);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.social-circle:hover {
  transform: translateY(-4px);
  border-color: var(--card-border-hover);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.35);
}

.social-circle:active {
  transform: scale(0.9);
}

.news-heading {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin: 0 0 12px 4px;
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.news-card {
  display: flex;
  gap: 12px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--card-border);
  padding: 10px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.news-card:hover {
  transform: translateY(-2px);
  border-color: var(--card-border-hover);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.35);
}

.news-card:active {
  transform: scale(0.98);
}

.news-thumb {
  width: 96px;
  height: 80px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--card-border);
}

.news-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.news-card:hover .news-thumb img {
  transform: scale(1.05);
}

.news-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 2px 0;
}

.news-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.news-category {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 6px;
  border-radius: 4px;
}

.news-date {
  font-size: 11px;
  color: var(--text-dim);
}

.news-title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.footer-note {
  text-align: center;
  color: var(--text-dimmer);
  font-size: 12px;
  margin-top: 40px;
}

/* ---------- Área de administração ---------- */

.admin-body {
  padding-bottom: 96px;
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--card-border);
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(6px);
  padding: 12px 16px;
}

.admin-header h1 {
  font-size: 16px;
  margin: 0;
  font-weight: 600;
}

.admin-header p {
  font-size: 12px;
  color: var(--text-dimmer);
  margin: 0;
}

.admin-header-actions {
  display: flex;
  gap: 8px;
}

.btn-ghost {
  font-size: 13px;
  border-radius: 10px;
  border: 1px solid #404040;
  color: #d4d4d4;
  background: transparent;
  padding: 7px 12px;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}

.btn-ghost:hover {
  background: var(--card);
}

.admin-main {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel {
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--card-border);
  padding: 20px;
}

.panel h2 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 16px;
}

.field {
  margin-bottom: 14px;
}

.field:last-child {
  margin-bottom: 0;
}

.field label {
  display: block;
  font-size: 13px;
  color: #d4d4d4;
  margin-bottom: 6px;
}

.field input[type="text"],
.field input[type="url"],
.field input[type="password"],
.field select {
  width: 100%;
  border-radius: 10px;
  background: #262626;
  border: 1px solid #404040;
  color: var(--text);
  padding: 9px 10px;
  font-size: 14px;
  font-family: inherit;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
}

.field input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #d4d4d4;
}

.hint {
  font-size: 12px;
  color: var(--text-dimmer);
  margin-top: 6px;
}

.logo-preview-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.logo-preview {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  background: #262626;
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.btn-primary {
  background: var(--accent);
  border: none;
  color: white;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

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

.btn-small {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #404040;
  background: #262626;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}

.btn-small:hover {
  background: #333;
}

.btn-small:disabled {
  opacity: 0.3;
  cursor: default;
}

.link-danger {
  color: var(--danger);
  font-size: 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}

.item-card {
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.25);
  padding: 12px;
  margin-bottom: 12px;
}

.item-card:last-child {
  margin-bottom: 0;
}

.item-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  align-items: center;
}

.item-row:last-child {
  margin-bottom: 0;
}

.item-row input {
  flex: 1;
}

.item-icon-preview {
  color: var(--text-dim);
  flex-shrink: 0;
}

.item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.item-controls {
  display: flex;
  gap: 4px;
}

.social-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--card-border);
}

.social-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.social-item .icon {
  color: #d4d4d4;
}

.social-item .social-name {
  width: 100px;
  flex-shrink: 0;
  font-size: 13px;
  color: #d4d4d4;
}

.social-item input {
  flex: 1;
}

.admin-footer-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  border-top: 1px solid var(--card-border);
  background: rgba(10, 10, 10, 0.97);
  backdrop-filter: blur(6px);
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

.admin-footer-bar-inner {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.flash {
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}

.flash-success {
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: var(--success);
}

.flash-error {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: var(--danger);
}

/* ---------- Login / setup ---------- */

.auth-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.auth-card {
  width: 100%;
  max-width: 360px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--card-border);
  padding: 24px;
}

.auth-card h1 {
  font-size: 18px;
  margin: 0 0 4px;
}

.auth-card > p {
  font-size: 13px;
  color: var(--text-dimmer);
  margin: 0 0 20px;
}

.auth-card .btn-primary {
  width: 100%;
  padding: 11px;
  margin-top: 6px;
}
