:root {
  --navy: #06005c;
  --blue: #1d3f9e;
  --yellow: #ffcc00;
  --orange: #ff9600;
  --cream: #f5f2e6;
  --ink: #1a1a1a;

  --radius: 16px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "Kanit", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--navy);
  color: var(--cream);
  -webkit-font-smoothing: antialiased;
  display: flex;
  justify-content: center;
  padding: 32px 20px 48px;
}

/* Padrão diagonal da marca */
.bg-pattern {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1100px 620px at 50% -10%, rgba(29, 63, 158, 0.55), transparent 70%),
    repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.035) 0 2px,
      transparent 2px 14px
    );
}

.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 620px;
}

/* ---------- Header ---------- */

.head { text-align: center; margin-bottom: 28px; }

.logo {
  display: inline-flex;
  align-items: baseline;
  font-weight: 800;
  font-style: italic;
  font-size: clamp(34px, 9vw, 48px);
  letter-spacing: -0.02em;
  color: var(--yellow);
  line-height: 1;
  user-select: none;
}

.logo-bang {
  display: inline-block;
  transform: rotate(180deg) translateY(-0.02em);
  color: var(--yellow);
  margin: 0 0.02em;
}

.head h1 {
  margin: 18px 0 8px;
  font-size: clamp(22px, 5.4vw, 30px);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
}

.sub {
  margin: 0 auto;
  max-width: 460px;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  color: rgba(245, 242, 230, 0.66);
}

/* ---------- Card ---------- */

.card {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 26px 22px 22px;
  backdrop-filter: blur(6px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
}

.field + .field { margin-top: 22px; }

label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #fff;
  margin-bottom: 10px;
}

.step {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--navy);
  font-size: 12px;
  font-weight: 800;
  flex: none;
}

.step-done { background: var(--orange); }

input {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
  color: #fff;
  background: rgba(6, 0, 92, 0.55);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input::placeholder {
  color: rgba(245, 242, 230, 0.34);
  font-weight: 400;
}

input:focus {
  outline: none;
  border-color: var(--yellow);
  background: rgba(6, 0, 92, 0.75);
  box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.18);
}

input.invalid {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 150, 0, 0.15);
}

.hint {
  margin: 8px 2px 0;
  font-size: 12.5px;
  font-weight: 400;
  color: rgba(245, 242, 230, 0.5);
}

.hint code,
.foot code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92em;
  color: var(--yellow);
  background: rgba(255, 204, 0, 0.1);
  border-radius: 5px;
  padding: 1px 5px;
}

.error {
  margin: 8px 2px 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--orange);
}

/* ---------- Resultado ---------- */

.result-field { margin-top: 26px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, 0.1); }

.result-box {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--yellow);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.result-box.ready { box-shadow: 0 10px 30px rgba(255, 204, 0, 0.22); }
.result-box.empty { background: rgba(255, 255, 255, 0.07); }

#result {
  flex: 1;
  min-width: 0;
  padding: 14px 8px 14px 15px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--navy);
  word-break: break-all;
  overflow-wrap: anywhere;
  align-self: center;
}

.result-box.empty #result {
  color: rgba(245, 242, 230, 0.4);
  font-weight: 400;
}

.copy-btn {
  flex: none;
  width: 54px;
  display: grid;
  place-items: center;
  border: none;
  border-left: 1.5px solid rgba(6, 0, 92, 0.14);
  background: transparent;
  color: var(--navy);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.copy-btn:hover:not(:disabled) { background: rgba(6, 0, 92, 0.1); }
.copy-btn:active:not(:disabled) { background: rgba(6, 0, 92, 0.18); }
.copy-btn:focus-visible { outline: 3px solid var(--blue); outline-offset: -3px; }

.copy-btn:disabled {
  color: rgba(245, 242, 230, 0.3);
  border-left-color: rgba(255, 255, 255, 0.1);
  cursor: not-allowed;
}

.ic-check { display: none; }
.copy-btn.copied .ic-copy { display: none; }
.copy-btn.copied .ic-check { display: block; }

.actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.btn {
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 10px;
  padding: 9px 16px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.btn-ghost {
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  color: rgba(245, 242, 230, 0.8);
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--yellow);
  color: var(--yellow);
}

.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.live {
  margin: 14px 2px 0;
  min-height: 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--yellow);
}

/* ---------- Rodapé ---------- */

.foot {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 26px;
  padding: 0 6px;
}

.bang-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--blue);
  font-weight: 800;
  font-size: 20px;
  transform: rotate(180deg);
}

.foot p {
  margin: 0;
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.5;
  color: rgba(245, 242, 230, 0.5);
}

@media (max-width: 480px) {
  body { padding: 24px 14px 40px; }
  .card { padding: 22px 16px 18px; }
  .copy-btn { width: 48px; }
  #result { font-size: 13px; padding-left: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
