:root {
  --green: #0f9d58;
  --green-dark: #0b8043;
  --gray-text: #5f6368;
  --border: #e8eaed;
  --bg: #ffffff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: #202124;
  font-family: "Google Sans", Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.page {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

/* ---------- Header ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: transparent;
}

.topbar__logo {
  display: flex;
  align-items: center;
  height: 32px;
}

.topbar__logo img {
  height: 32px;
  max-width: 160px;
  width: auto;
  object-fit: contain;
  display: block;
  background: transparent;
}

.topbar__logo .placeholder-text {
  font-weight: 700;
  font-size: 18px;
  color: #202124;
}

.topbar__icons {
  display: flex;
  align-items: center;
  gap: 14px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: #5f6368;
}

.icon-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #f1f3f4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #5f6368;
}

/* ---------- App list ---------- */
.app-list {
  display: flex;
  flex-direction: column;
}

.app-card {
  padding: 16px;
  border-bottom: 8px solid #fff;
}

.app-card__top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.app-card__logo {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
  flex-shrink: 0;
  background: #f1f3f4;
}

.app-card__logo-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  background: #f1f3f4;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bdc1c6;
}

.app-card__info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 2px;
}

.app-card__title {
  font-size: 22px;
  font-weight: 500;
  color: #202124;
  line-height: 1.25;
  margin: 0;
}

.app-card__subtitle {
  font-size: 15px;
  color: var(--green);
  font-weight: 500;
  margin: 2px 0 0;
}

.app-card__install {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--green);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 0;
  border-radius: 22px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.app-card__install:hover {
  background: var(--green-dark);
}

/* ---------- Screenshots ---------- */
.screenshots-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin-top: 18px;
  padding-bottom: 4px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.screenshots-row::-webkit-scrollbar { height: 0; }

.screenshot {
  height: 220px;
  width: auto;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  scroll-snap-align: start;
  background: #f1f3f4;
  border: 1px solid var(--border);
}

/* ---------- Seções genéricas (Sobre / Segurança) ---------- */
.app-section {
  margin-top: 24px;
}

.app-section__title {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 8px;
  color: #202124;
}

.app-section__text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--gray-text);
  margin: 0;
  white-space: pre-line;
}

.data-safety {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.data-safety__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #202124;
}

.data-safety__header .app-section__title {
  margin: 0;
}

.data-safety__header svg {
  color: #5f6368;
  flex-shrink: 0;
}

/* ---------- Avaliações ---------- */
.reviews-section .app-section__title {
  margin-bottom: 4px;
}

.review {
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

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

.review__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--green);
  color: var(--green);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.review__name {
  font-size: 13px;
  font-weight: 600;
  color: #202124;
  flex: 1;
}

.review__menu {
  color: #5f6368;
  display: flex;
}

.review__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.stars {
  display: inline-flex;
  color: var(--green);
  gap: 1px;
}

.review__date {
  font-size: 12px;
  color: var(--gray-text);
}

.review__text {
  font-size: 14px;
  color: #202124;
  margin: 8px 0 0;
  line-height: 1.45;
}

.review__helpful {
  font-size: 12px;
  color: var(--gray-text);
  margin: 10px 0 0;
}

.review__vote {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--gray-text);
}

.pill-btn {
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 16px;
  padding: 4px 14px;
  font-size: 13px;
  color: #3c4043;
  cursor: pointer;
}

.pill-btn:hover {
  background: #f1f3f4;
}

.app-divider {
  height: 1px;
  background: var(--border);
  margin: 0 16px;
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--gray-text);
}

/* ---------- Admin ---------- */
.admin-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

.admin-wrap h1 {
  font-size: 22px;
  margin-bottom: 4px;
}

.admin-wrap .subtitle {
  color: var(--gray-text);
  margin-top: 0;
  margin-bottom: 24px;
  font-size: 14px;
}

.admin-section {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  background: #fafafa;
}

.admin-section h2 {
  font-size: 16px;
  margin: 0 0 12px;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #3c4043;
  margin-bottom: 4px;
}

.field input[type="text"],
.field input[type="url"],
.field textarea,
.field select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}

.field textarea {
  resize: vertical;
  min-height: 70px;
}

.field input[type="file"] {
  font-size: 13px;
}

.field-row {
  display: flex;
  gap: 10px;
}

.field-row .field {
  flex: 1;
}

.app-subsection {
  border-top: 1px dashed var(--border);
  margin-top: 16px;
  padding-top: 14px;
}

.app-subsection__title {
  font-size: 13px;
  font-weight: 700;
  color: #3c4043;
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.shots-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.shots-thumb {
  position: relative;
  width: 70px;
}

.shots-thumb img {
  width: 70px;
  height: 124px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}

.shots-thumb button {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: #d93025;
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.review-block {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  background: #fdfdfd;
}

.review-block__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.review-block__head span {
  font-size: 13px;
  font-weight: 600;
  color: #3c4043;
}

.logo-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.logo-preview img {
  max-height: 40px;
  max-width: 140px;
  object-fit: contain;
}

.logo-preview .square-preview {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  background: #eee;
}

.app-block {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
  background: #fff;
  position: relative;
}

.app-block__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.app-block__header strong {
  font-size: 14px;
  color: #3c4043;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

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

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

.btn-secondary {
  background: #fff;
  color: #3c4043;
  border: 1px solid #ccc;
}

.btn-secondary:hover { background: #f1f3f4; }

.btn-danger {
  background: #fff;
  color: #d93025;
  border: 1px solid #d93025;
  padding: 6px 10px;
  font-size: 13px;
}

.btn-danger:hover { background: #fce8e6; }

.admin-actions {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin: 0 -16px -80px;
}

.save-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #202124;
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 50;
}

.save-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 16px 0;
}

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

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 340px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 24px;
}

.login-card h1 {
  font-size: 20px;
  margin: 0 0 4px;
  text-align: center;
}

.login-card .subtitle {
  color: var(--gray-text);
  font-size: 14px;
  text-align: center;
  margin: 0 0 20px;
}

.login-error {
  background: #fce8e6;
  color: #d93025;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin: 0 0 14px;
  text-align: center;
}
