:root {
  /* Paleta centralizada para facilitar qualquer ajuste futuro. */
  --brand-primary: #0c2743;
  --brand-primary-strong: #071a2d;
  --brand-primary-soft: #173f61;
  --brand-accent: #d5aa55;
  --brand-accent-strong: #b98c38;
  --brand-cream: #f4f0e7;
  --page-bg: #f5f6f4;
  --surface: #ffffff;
  --text: #10263c;
  --muted: #647284;
  --disabled: #aab2bd;
  --disabled-bg: #e8ebee;
  --radius: 18px;
  --shadow: 0 18px 55px rgba(6, 28, 49, .10);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--page-bg);
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button,
label {
  -webkit-tap-highlight-color: transparent;
}

.profile-maker {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 16px 22px 28px;
  text-align: center;
}

.intro h1 {
  margin: 0;
  color: var(--brand-primary-strong);
  font-size: clamp(1.75rem, 5vw, 2.2rem);
  line-height: 1.12;
  letter-spacing: -.035em;
  font-weight: 800;
}

.intro p {
  max-width: 610px;
  margin: 10px auto 0;
  color: var(--muted);
  font-size: clamp(.98rem, 2.5vw, 1.08rem);
  line-height: 1.45;
}

.upload-area {
  margin: 18px 0;
}

.button,
.icon-button {
  border: 0;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, opacity .16s ease;
}

.button:focus-visible,
.icon-button:focus-visible,
.sr-only:focus-visible + .button {
  outline: 3px solid color-mix(in srgb, var(--brand-accent) 55%, white);
  outline-offset: 3px;
}

.button:not(:disabled):active,
.icon-button:not(:disabled):active {
  transform: translateY(1px) scale(.99);
}

.button-primary {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  border-radius: 11px;
  color: #fff;
  background: var(--brand-primary);
  box-shadow: 0 8px 18px rgba(7, 26, 45, .14);
  font-weight: 700;
}

.button-primary:hover {
  background: var(--brand-primary-soft);
}

.editor-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--brand-primary-strong);
  box-shadow: var(--shadow);
  touch-action: none;
  user-select: none;
}

#editorCanvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

#editorCanvas.is-dragging {
  cursor: grabbing;
}

.drag-hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%) translateY(8px);
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 7px 12px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  color: rgba(255,255,255,.95);
  background: rgba(4, 18, 32, .56);
  backdrop-filter: blur(8px);
  font-size: .82rem;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}

.editor-card.has-photo .drag-hint {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.controls {
  padding-top: 12px;
}

.control-hint {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: .93rem;
}

.control-row {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 8px;
}

.icon-button {
  width: 48px;
  min-width: 48px;
  height: 46px;
  border-radius: 10px;
  color: #fff;
  background: var(--brand-primary);
  font-size: 1.65rem;
  line-height: 1;
  font-weight: 700;
}

.icon-button:hover:not(:disabled) {
  background: var(--brand-primary-soft);
}

.button-secondary {
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid #d9dee4;
  border-radius: 10px;
  color: var(--brand-primary);
  background: var(--surface);
  font-weight: 700;
}

.button-secondary:hover:not(:disabled) {
  border-color: var(--brand-accent);
  background: var(--brand-cream);
}

.button-download {
  display: flex;
  width: min(100%, 360px);
  min-height: 49px;
  margin: 10px auto 0;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  color: var(--brand-primary-strong);
  background: var(--brand-accent);
  box-shadow: 0 8px 20px rgba(142, 99, 28, .13);
  font-weight: 800;
}

.button-download:hover:not(:disabled) {
  background: #dfba70;
}

button:disabled,
.button-download:disabled {
  cursor: not-allowed;
  color: #8c96a3;
  background: var(--disabled-bg);
  box-shadow: none;
  opacity: 1;
}

.status-message {
  min-height: 1.2em;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: .82rem;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 560px) {
  .profile-maker {
    padding: 13px 14px 24px;
  }

  .upload-area {
    margin: 16px 0;
  }

  .editor-card {
    border-radius: 14px;
  }

  .drag-hint {
    bottom: 9px;
    font-size: .76rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
