:root {
  color-scheme: light;
  --ink: #081529;
  --muted: #66758a;
  --line: #dfe6ee;
  --blue: #0877ef;
  --navy: #020a17;
  --paper: #f4f7fb;
  --white: #ffffff;
  --danger: #b52532;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

button,
input,
textarea {
  font: inherit;
}

button,
summary,
input[type="file"] {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.login-page {
  min-height: 100vh;
  color: #f7fbff;
  background:
    linear-gradient(
      105deg,
      rgba(2, 10, 23, 0.98) 10%,
      rgba(4, 22, 45, 0.9) 55%,
      rgba(4, 34, 67, 0.7)
    ),
    url("../images/projeto-20.webp") center/cover fixed;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.login-card {
  width: min(100%, 460px);
  padding: 42px;
  background: rgba(4, 18, 37, 0.88);
  border: 1px solid rgba(189, 221, 255, 0.24);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(18px);
}

.admin-logo {
  display: grid;
  place-items: center;
  width: 108px;
  height: 92px;
  margin-bottom: 34px;
  border: 1px solid rgba(203, 230, 255, 0.22);
  border-radius: 15px;
  background: rgba(166, 211, 255, 0.1);
}

.admin-logo img {
  width: 94px;
  height: 78px;
  object-fit: cover;
  border-radius: 10px;
  mix-blend-mode: screen;
}

.eyebrow {
  margin: 0 0 11px;
  color: #278eff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.login-card h1,
.welcome h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.04;
  letter-spacing: -0.045em;
  font-weight: 400;
}

.intro,
.welcome p,
.toolbar-card p,
.security-card p {
  color: #93a6bc;
  line-height: 1.65;
}

.login-form {
  display: grid;
  gap: 18px;
  margin-top: 30px;
}

label {
  display: grid;
  gap: 8px;
  color: #41516a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.login-form label {
  color: #bdc9d8;
}

input,
textarea {
  width: 100%;
  border: 1px solid #ced8e4;
  border-radius: 3px;
  outline: none;
  padding: 13px 14px;
  color: var(--ink);
  background: var(--white);
  text-transform: none;
  letter-spacing: normal;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(8, 119, 239, 0.12);
}

.primary,
.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 0;
  border-radius: 3px;
  padding: 14px 17px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.primary {
  color: white;
  background: var(--blue);
}

.primary:hover {
  background: #0068d8;
}

.secondary {
  color: #0a5fb7;
  border: 1px solid #a9cbed;
  background: #edf6ff;
}

.back-link {
  display: inline-block;
  margin-top: 24px;
  color: #9bacbf;
  font-size: 12px;
}

.notice {
  margin: 22px 0;
  padding: 13px 15px;
  border-left: 3px solid;
  font-size: 13px;
  line-height: 1.5;
}

.notice.error {
  border-color: #ff6975;
  color: #ffd9dc;
  background: rgba(177, 31, 45, 0.19);
}

.notice.success {
  border-color: #25b982;
  color: #d7fff0;
  background: rgba(27, 142, 101, 0.18);
}

.admin-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
  padding: 10px max(24px, calc((100vw - 1320px) / 2));
  color: #e7f0fa;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(2, 10, 23, 0.96);
  backdrop-filter: blur(15px);
}

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

.header-brand img {
  width: 60px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
  mix-blend-mode: screen;
}

.header-brand span {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 700;
}

.header-brand small {
  color: #72859c;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.admin-header nav,
.admin-header nav form {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 0;
}

.admin-header nav a,
.text-button {
  color: #afbdcc;
  border: 0;
  background: none;
  font-size: 12px;
}

.admin-main {
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
  padding: 64px 0 90px;
}

.welcome {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  align-items: end;
  margin-bottom: 36px;
}

.welcome > div:first-child {
  max-width: 680px;
}

.welcome p {
  color: var(--muted);
  margin-bottom: 0;
}

.stats {
  display: flex;
  gap: 10px;
}

.stats div {
  min-width: 112px;
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--white);
}

.stats strong,
.stats span {
  display: block;
}

.stats strong {
  color: var(--blue);
  font-size: 30px;
}

.stats span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-notice.success {
  color: #126a4d;
  background: #e3f8ef;
}

.page-notice.error {
  color: #9f1d29;
  background: #ffeaec;
}

.toolbar-card,
.security-card {
  margin-bottom: 24px;
  padding: 28px;
  border: 1px solid var(--line);
  background: var(--white);
}

.toolbar-card > div:first-child {
  display: flex;
  align-items: center;
  gap: 18px;
}

.toolbar-card h2,
.security-card h2,
.category-heading h2 {
  margin: 0;
  font-weight: 400;
  letter-spacing: -0.025em;
}

.toolbar-card p,
.security-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.step-number {
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  flex: 0 0 auto;
  color: white;
  background: var(--blue);
  font-size: 25px;
}

details > summary {
  width: fit-content;
  margin-top: 20px;
  color: #0965c5;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  list-style: none;
  text-transform: uppercase;
}

details > summary::after {
  content: " +";
}

details[open] > summary::after {
  content: " −";
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 24px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

label small {
  color: #8a98aa;
  font-size: 9px;
  text-transform: none;
  letter-spacing: normal;
}

.category-list {
  display: grid;
  gap: 28px;
}

.category-card {
  padding: 30px;
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: 0 15px 45px rgba(25, 48, 76, 0.05);
}

.category-heading {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.category-number {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  color: #237fdc;
  border: 1px solid #aed2f7;
  background: #eef7ff;
  font-size: 13px;
  font-weight: 700;
}

.category-heading span {
  color: var(--blue);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.category-heading h2 {
  margin-top: 6px;
  font-size: 28px;
}

.category-heading p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.edit-category {
  margin: 0 0 28px 70px;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.image-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fbfcfe;
}

.image-preview {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  margin-bottom: 14px;
  background: #e8eef5;
}

.image-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.image-form {
  display: grid;
  gap: 12px;
}

.file-field {
  position: relative;
  gap: 4px;
  padding: 12px;
  color: #176fc5;
  border: 1px dashed #9fc8ee;
  background: #f0f7ff;
  overflow: hidden;
  text-transform: none;
}

.file-field input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.file-field span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-field.selected {
  border-style: solid;
  background: #e3f2ff;
}

.delete-form {
  margin-top: 10px;
}

.danger-link {
  padding: 4px 0;
  color: var(--danger);
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.danger-link:hover {
  border-color: currentColor;
}

.add-image-card {
  justify-content: center;
  min-height: 365px;
  border-style: dashed;
  background: #f5f9fd;
}

.add-image-card h3 {
  margin: 10px 0 18px;
  font-size: 18px;
  font-weight: 400;
}

.add-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: white;
  background: var(--blue);
  font-size: 25px;
}

.category-delete {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  text-align: right;
}

.security-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  margin-top: 28px;
  background: #eaf3fd;
  border-color: #c7dcf2;
}

.password-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

/* Category and image publishing workspace */
.category-creator {
  padding: 0;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 12px 35px rgba(25, 48, 76, 0.05);
}

.new-category-panel > summary {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 18px;
  margin: 0;
  padding: 24px 26px;
  color: var(--ink);
  text-transform: none;
  letter-spacing: normal;
}

.new-category-panel > summary::after {
  content: "";
}

.creator-summary-copy {
  display: grid;
  gap: 5px;
  flex: 1;
}

.creator-summary-copy strong {
  font-size: 19px;
  font-weight: 600;
}

.creator-summary-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.creator-summary-action {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 11px 15px;
  color: #0965c5;
  border: 1px solid #b7d5f2;
  border-radius: 5px;
  background: #f4f9ff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.new-category-panel[open] .creator-summary-action b {
  transform: rotate(90deg);
}

.creator-content {
  padding: 26px;
  border-top: 1px solid var(--line);
  background: #f8fbff;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.panel-title > span {
  width: 3px;
  height: 19px;
  border-radius: 99px;
  background: var(--blue);
}

.panel-title h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.creator-form {
  margin-top: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.creator-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.creator-footer p,
.category-information p {
  display: grid;
  gap: 4px;
  margin: 0;
}

.creator-footer p strong,
.category-information strong {
  color: #0b66c3;
  font-size: 11px;
}

.creator-footer p span,
.category-information span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.category-card {
  padding: 0;
  overflow: hidden;
  border-radius: 10px;
}

.category-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 24px 18px;
}

.category-heading {
  align-items: center;
}

.category-heading p b {
  color: #0877ef;
}

.category-delete {
  margin: 0;
  padding: 0;
  border: 0;
}

.danger-button {
  padding: 11px 15px;
  color: #c82a38;
  border: 1px solid #f0a4ab;
  border-radius: 5px;
  background: #fff7f8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.danger-button:hover {
  color: #fff;
  border-color: #c82a38;
  background: #c82a38;
}

.edit-category {
  margin: 0;
  padding: 0 24px 18px 94px;
  border-bottom: 1px solid var(--line);
}

.edit-category > summary {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 9px 13px;
  border: 1px solid #c6d7e8;
  border-radius: 5px;
  background: #fff;
}

.edit-category-content {
  margin-top: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fbff;
}

.edit-category-content .form-grid {
  margin-top: 0;
}

.category-workspace {
  display: grid;
  grid-template-columns: minmax(310px, 0.82fr) minmax(0, 1.18fr);
  gap: 16px;
  padding: 18px;
  background: #f5f8fc;
}

.upload-panel,
.published-panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.new-image-form {
  gap: 14px;
}

.image-uploader {
  min-width: 0;
}

.upload-dropzone {
  position: relative;
  display: grid;
  min-height: 215px;
  overflow: hidden;
  color: var(--ink);
  border: 1px dashed #7ab8f5;
  border-radius: 8px;
  background: linear-gradient(145deg, #fbfdff, #eef7ff);
  text-align: center;
  text-transform: none;
  letter-spacing: normal;
  transition: 160ms ease;
}

.upload-dropzone:hover,
.upload-dropzone.is-dragging {
  border-color: #0877ef;
  box-shadow: inset 0 0 0 2px rgba(8, 119, 239, 0.08);
  transform: translateY(-1px);
}

.upload-dropzone.has-file {
  border-style: solid;
  border-color: #35a878;
  background: #f4fff9;
}

.upload-dropzone > input {
  position: absolute;
  z-index: 3;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  opacity: 0;
}

.upload-empty,
.upload-ready {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  min-width: 0;
  padding: 22px;
}

.upload-empty strong {
  font-size: 13px;
}

.upload-empty small {
  color: #7b8da3;
  font-size: 11px;
  font-weight: 400;
}

.upload-plus {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #fff;
  border-radius: 50%;
  background: var(--blue);
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
}

.upload-ready {
  grid-template-columns: 132px minmax(0, 1fr);
  place-items: stretch;
  align-items: center;
  text-align: left;
}

.upload-ready img {
  width: 132px;
  height: 150px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 8px 25px rgba(8, 21, 41, 0.16);
}

.upload-ready > span {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.upload-ready em {
  width: fit-content;
  padding: 5px 7px;
  color: #187350;
  border-radius: 3px;
  background: #dff7ec;
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.upload-ready strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-ready small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}

.selected-file-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 9px;
  padding: 10px 12px;
  color: #176b4c;
  border: 1px solid #b9e3d1;
  border-radius: 5px;
  background: #effbf6;
  font-size: 10px;
  font-weight: 700;
}

.selected-file-actions button {
  flex: 0 0 auto;
  padding: 0;
  color: #a12530;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.publish-image-button {
  width: 100%;
}

.primary:disabled {
  color: #8fa0b2;
  background: #dfe6ed;
  cursor: not-allowed;
}

.primary:disabled:hover {
  background: #dfe6ed;
}

.upload-guidance {
  margin: -4px 0 0;
  color: #7b8da3;
  font-size: 10px;
  text-align: center;
}

.upload-guidance.is-ready {
  color: #187350;
  font-weight: 700;
}

.upload-guidance.is-error {
  color: #b52532;
  font-weight: 700;
}

.published-panel {
  display: flex;
  min-height: 470px;
  flex-direction: column;
}

.published-title {
  flex: 0 0 auto;
}

.published-empty {
  display: grid;
  place-items: center;
  align-content: center;
  flex: 1;
  min-height: 360px;
  padding: 28px;
  text-align: center;
}

.empty-image-icon {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  margin-bottom: 18px;
  color: var(--blue);
  border-radius: 50%;
  background: #edf6ff;
  font-size: 42px;
}

.published-empty strong {
  font-size: 17px;
}

.published-empty p {
  max-width: 310px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.published-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.published-image-card {
  padding: 10px;
  border-radius: 6px;
  background: #f9fbfd;
}

.image-preview > span {
  position: absolute;
  top: 9px;
  right: 9px;
  padding: 5px 7px;
  color: #176b4c;
  border-radius: 3px;
  background: rgba(235, 255, 246, 0.94);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.category-information {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 0 18px 18px;
  padding: 14px;
  color: #0b66c3;
  border: 1px solid #beddf8;
  border-radius: 6px;
  background: #edf7ff;
}

.category-information > b {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 2px solid #0877ef;
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 12px;
}

@media (max-width: 1020px) {
  .category-workspace {
    grid-template-columns: 1fr;
  }

  .published-panel {
    min-height: auto;
  }
}

@media (max-width: 780px) {
  .login-card {
    padding: 30px 22px;
  }

  .admin-header {
    padding: 10px 16px;
  }

  .header-brand span,
  .admin-header nav a {
    display: none;
  }

  .admin-main {
    width: min(100% - 28px, 1320px);
    padding-top: 38px;
  }

  .welcome,
  .security-card {
    display: grid;
    grid-template-columns: 1fr;
  }

  .welcome {
    align-items: start;
  }

  .stats {
    width: 100%;
  }

  .stats div {
    flex: 1;
  }

  .toolbar-card,
  .category-card,
  .security-card {
    padding: 20px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .full {
    grid-column: auto;
  }

  .edit-category {
    padding: 0 20px 18px;
  }

  .category-heading h2 {
    font-size: 22px;
  }

  .image-grid {
    grid-template-columns: 1fr;
  }

  .new-category-panel > summary,
  .creator-content {
    padding: 20px;
  }

  .creator-summary-action {
    display: none;
  }

  .creator-form {
    padding: 18px;
  }

  .creator-footer,
  .category-header-row {
    align-items: stretch;
    flex-direction: column;
  }

  .creator-footer .primary,
  .danger-button {
    width: 100%;
  }

  .category-workspace {
    padding: 12px;
  }

  .upload-panel,
  .published-panel {
    padding: 16px;
  }

  .upload-ready {
    grid-template-columns: 96px minmax(0, 1fr);
    padding: 14px;
  }

  .upload-ready img {
    width: 96px;
    height: 112px;
  }

  .published-grid {
    grid-template-columns: 1fr;
  }

  .category-information {
    margin: 0 12px 12px;
  }
}
