:root {
  --primary: #0b3d62;
  --primary-dark: #082c47;
  --primary-light: #164c77;
  --accent: #f0a500;
  --accent-dark: #c98600;
  --bg: #f4f6f9;
  --card-bg: #ffffff;
  --text: #1f2d3d;
  --muted: #637184;
  --border: #e1e6ec;
  --shadow: 0 6px 18px rgba(11, 61, 98, 0.08);
  --shadow-hover: 0 12px 28px rgba(11, 61, 98, 0.16);
  --radius: 14px;
}

* { box-sizing: border-box; }

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }

/* ===================== LANDING PAGE ===================== */
.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 55%, #061f33 100%);
  position: relative;
  overflow: hidden;
}

.landing::before,
.landing::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(240, 165, 0, 0.08);
}

.landing::before {
  width: 420px;
  height: 420px;
  top: -140px;
  right: -140px;
}

.landing::after {
  width: 320px;
  height: 320px;
  bottom: -120px;
  left: -100px;
  background: rgba(255, 255, 255, 0.05);
}

.landing-card {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 20px;
  padding: 48px 36px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.landing-logo {
  width: 92px;
  height: 92px;
  margin: 0 auto 20px;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

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

.landing-card h1 {
  margin: 0 0 8px;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.landing-card .subtitle {
  margin: 0 0 32px;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.5;
}

.landing-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
  font-family: inherit;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--accent);
  color: #1a1203;
  box-shadow: 0 8px 18px rgba(240, 165, 0, 0.35);
}

.btn-primary:hover {
  background: var(--accent-dark);
  box-shadow: 0 10px 22px rgba(201, 134, 0, 0.4);
}

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

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

.hint {
  min-height: 20px;
  margin: 18px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.landing footer {
  position: relative;
  z-index: 1;
  margin-top: 28px;
  text-align: center;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.8rem;
}

/* Modal de instruções (iOS) */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 20, 33, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal.hidden { display: none; }

.modal-box {
  background: #fff;
  border-radius: 16px;
  padding: 28px 24px;
  max-width: 360px;
  width: 100%;
  text-align: left;
  position: relative;
}

.modal-box h3 {
  margin: 0 0 12px;
  color: var(--primary);
  font-size: 1.1rem;
}

.modal-box ol {
  margin: 0 0 16px;
  padding-left: 20px;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.6;
}

.modal-close {
  display: block;
  width: 100%;
  padding: 10px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* ===================== TOP BAR / MENU ===================== */
.topbar {
  background: var(--primary);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  object-fit: cover;
}

.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 6px;
}

.menu {
  display: flex;
  align-items: center;
  gap: 6px;
}

.menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 9px;
  font-size: 0.92rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  transition: background 0.15s ease;
}

.menu a:hover {
  background: rgba(255, 255, 255, 0.14);
}

.menu a i { color: var(--accent); width: 16px; text-align: center; }

/* Menus com submenu (dropdown) */
.menu-item {
  position: relative;
}

.menu-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 9px;
  font-size: 0.92rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease;
}

.menu-link:hover {
  background: rgba(255, 255, 255, 0.14);
}

.menu-link i { color: var(--accent); width: 16px; text-align: center; }
.menu-link .dropdown-caret {
  color: rgba(255, 255, 255, 0.8);
  width: auto;
  font-size: 0.7rem;
  margin-left: 2px;
  transition: transform 0.2s ease;
}

.menu-item.open .dropdown-caret {
  transform: rotate(180deg);
}

.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 230px;
  /* padding-top transparente faz as vezes do "espaçamento" visual,
     mas mantém o elemento contíguo ao botão para o mouse não perder
     o hover ao descer do menu até o submenu */
  padding-top: 8px;
  background: transparent;
  display: none;
  z-index: 50;
}

.menu-item.open .dropdown {
  display: block;
}

.dropdown-inner {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
  padding: 6px;
}

.dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.dropdown a:hover {
  background: var(--bg);
  color: var(--primary);
}

.dropdown a i { color: var(--primary); width: 16px; text-align: center; }

/* ===================== TOOLS PAGE ===================== */
.tools-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 20px 60px;
}

.tools-header {
  text-align: center;
  margin-bottom: 32px;
}

.tools-header h1 {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 2rem;
  font-weight: 700;
}

.tools-header p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
}

.tool-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 20px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}

.tool-icon {
  width: 54px;
  height: 54px;
  min-width: 54px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--c, var(--primary)) 12%, white);
  color: var(--c, var(--primary));
  font-size: 1.4rem;
}

.tool-card h2 {
  margin: 4px 0 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

.tool-card p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.4;
  overflow-wrap: break-word;
  word-break: break-word;
}

.tool-card .tool-link {
  margin-top: auto;
  padding-top: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.tool-card:hover .tool-link { color: var(--accent-dark); }

/* Footer */
.app-footer {
  text-align: center;
  padding: 26px 20px 40px;
  color: var(--muted);
  font-size: 0.85rem;
}

.app-footer a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 10px;
}

.app-footer a:hover { color: var(--accent-dark); }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 760px) {
  .menu-toggle { display: inline-flex; }

  .menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--primary-dark);
    flex-direction: column;
    align-items: stretch;
    padding: 8px;
    gap: 2px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }

  .menu.open {
    max-height: 320px;
  }

  .menu a {
    padding: 12px 14px;
    border-radius: 8px;
  }

  .menu-item {
    width: 100%;
  }

  .menu-link {
    width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    justify-content: flex-start;
  }

  .menu-link .dropdown-caret {
    margin-left: auto;
  }

  .dropdown {
    position: static;
    padding-top: 0;
  }

  .dropdown-inner {
    box-shadow: none;
    background: rgba(255, 255, 255, 0.06);
    margin: 0 0 4px 0;
    padding: 2px 2px 2px 20px;
    border-radius: 8px;
  }

  .menu-item:hover .dropdown {
    display: none;
  }

  .menu-item.open .dropdown {
    display: block;
  }

  .dropdown a {
    color: rgba(255, 255, 255, 0.92);
  }

  .dropdown a:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
  }

  .dropdown a i { color: var(--accent); }
}

@media (max-width: 420px) {
  .landing-card { padding: 36px 22px; }
  .tools-header h1 { font-size: 1.6rem; }
}
