* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #334155;
  --border: #475569;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #10b981;
  --error: #ef4444;
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

header {
  text-align: center;
  padding: 2rem 1rem 1rem;
}

.topbar {
  max-width: 900px;
  margin: 0 auto 0.75rem;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
}
.user-label {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Tela de login */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.login-wrapper {
  width: 100%;
  max-width: 380px;
  padding: 0;
}
.login-card {
  text-align: center;
}
.login-card h1 {
  font-size: 1.8rem;
  margin-bottom: 0.25rem;
}
.login-card .subtitle {
  margin-bottom: 1.5rem;
}
.login-card form {
  text-align: left;
}
.login-btn {
  width: 100%;
  margin-top: 0.5rem;
}

header h1 { font-size: 2rem; margin-bottom: 0.25rem; }
.subtitle { color: var(--muted); font-size: 0.95rem; }

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
}

.card h2 { font-size: 1.2rem; margin-bottom: 1rem; }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.section-header h2 { margin-bottom: 0; }

/* Form */
.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.field input[type="text"],
.field textarea,
.field input[type="file"] {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
}
.field input[type="file"] { padding: 0.5rem; cursor: pointer; }
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.7rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}
button:hover:not(:disabled) { background: var(--accent-hover); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.ghost {
  background: transparent;
  border: 1px solid var(--border);
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}
button.ghost:hover:not(:disabled) { background: var(--surface-2); }

.preview {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}
.preview img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.status {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  min-height: 1.2rem;
}
.status.success { color: var(--success); }
.status.error { color: var(--error); }

/* Carrossel */
.carousel-wrapper { position: relative; }
.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 8px;
}
.hidden { display: none !important; }

.carousel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.slide {
  flex: 1;
  background: var(--surface-2);
  border-radius: 8px;
  overflow: hidden;
  min-height: 300px;
  display: flex;
  flex-direction: column;
}
.slide img {
  width: 100%;
  max-height: 500px;
  object-fit: contain;
  background: #000;
}
.slide-info { padding: 1rem; }
.slide-title { font-weight: 600; font-size: 1.05rem; }
.slide-description { color: var(--muted); font-size: 0.9rem; margin-top: 0.25rem; }
.slide-meta { color: var(--muted); font-size: 0.8rem; margin-top: 0.5rem; }

.nav {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 1.8rem;
  width: 44px;
  height: 44px;
  padding: 0;
  line-height: 1;
  border-radius: 50%;
  flex-shrink: 0;
}
.nav:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); }

.counter {
  text-align: center;
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.dots {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.dot.active { background: var(--accent); transform: scale(1.3); }

/* Thumbs */
.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.6rem;
}
.thumb {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}
.thumb:hover { border-color: var(--accent); }
.thumb.current { border-color: var(--accent); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: 0.85rem;
  background: rgba(239, 68, 68, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.thumb:hover .del { opacity: 1; }

footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: 0.85rem;
}
footer code {
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 4px;
}
footer a { color: var(--accent); }

@media (max-width: 600px) {
  .nav { width: 36px; height: 36px; font-size: 1.4rem; }
  header h1 { font-size: 1.5rem; }
}
