/* Livetech — base partilhada (domínio ip.livetech.pt) */
:root {
  --brand: #d13239;
  --brand-dark: #ac162c;
  --ink: #232222;
  --ink-soft: #505050;
  --gray: #cac8c8;
  --white: #ffffff;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --line: var(--gray);
  --radius: 2px;
  --font: "Montserrat", Verdana, system-ui, sans-serif;
  --font-accent: "Kalam", cursive;
  --max: 1120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--white);
}

a {
  color: var(--brand);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--brand-dark);
}

img {
  max-width: 100%;
  display: block;
}

code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.86em;
}

.site-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  width: 100%;
  border-bottom: 1px solid var(--gray);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
}

.brand:hover {
  color: var(--brand);
  text-decoration: none;
}

.brand img {
  height: 50px !important;
  width: auto;
  max-width: none;
  max-height: 50px;
}

.header-title {
  margin: 0;
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-align: right;
  color: var(--ink);
}

.nav-back {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--gray);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius);
  transition: border-color 0.15s, color 0.15s;
}

.nav-back:hover {
  border-color: var(--brand);
  color: var(--brand);
  text-decoration: none;
}

main {
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem 3.5rem;
}

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem;
  width: 100%;
  font-size: 0.85rem;
  font-weight: 300;
  color: #666;
  border-top: 1px solid var(--gray);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
}

.site-footer a {
  font-weight: 700;
  text-decoration: none;
}

.tool-page-header {
  padding: 1.25rem 0 1rem;
  max-width: none;
  width: 100%;
}

.tool-page-header p {
  margin: 0;
  width: 100%;
  font-weight: 400;
  font-size: 1.05rem;
  color: var(--ink);
  line-height: 1.55;
}

.panel {
  background: var(--surface-2);
  border: 1px solid var(--gray);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.hint {
  font-size: 0.8rem;
  font-weight: 300;
  color: #777;
  margin-top: 0.35rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.15rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.2rem;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1.2;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.78rem;
}

.btn-primary {
  background: var(--brand);
  color: var(--white);
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-dark);
  color: var(--white);
}

.btn-secondary {
  background: var(--white);
  color: var(--ink);
  border-color: var(--gray);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand);
}

.btn-ghost {
  background: transparent;
  color: var(--brand);
  border-color: transparent;
  padding-left: 0;
  padding-right: 0;
}

.btn-ghost:hover:not(:disabled) {
  background: transparent;
  color: var(--brand-dark);
  text-decoration: underline;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--ink);
  color: var(--white);
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  z-index: 50;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

@media (max-width: 560px) {
  .site-header {
    flex-wrap: wrap;
  }
}
