/* Converto - app mobile-first organizada */

:root {
  --teal: #00a99d;
  --teal-dark: #008f86;
  --cream: #fff7e8;
  --cream-2: #f8efe2;
  --paper: #ffffff;
  --ink: #342419;
  --muted: #827366;
  --line: #eadfce;
  --orange: #ed9b19;
  --danger: #d64545;
  --shadow: 0 12px 34px rgba(70, 48, 24, .08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(rgba(255,255,255,.55), rgba(250,244,232,.45)),
    url("../img/fundo.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  display: flex;
  justify-content: center;
}

.phone {
  width: min(100%, 430px);
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  padding-bottom: 96px;
  background: rgba(255, 252, 246, .72);
  backdrop-filter: blur(12px);
  border-left: 1px solid rgba(255,255,255,.7);
  border-right: 1px solid rgba(255,255,255,.7);
}

.app-header {
  height: 72px;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 252, 246, .75);
  backdrop-filter: blur(18px);
}

.app-header h1 {
  margin: 0;
  font-size: 1.05rem;
  text-align: center;
  font-weight: 1000;
}

.app-header p {
  margin: 0;
  font-size: .75rem;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.icon-btn {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 17px;
  display: grid;
  place-items: center;
  background: rgba(255, 247, 232, .9);
  color: var(--ink);
  font-size: 1.2rem;
  box-shadow: var(--shadow);
}

.back-hidden {
  opacity: 0;
  pointer-events: none;
}

.hero {
  padding: 16px 18px 22px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.category-card {
  border: 1px solid rgba(234, 223, 206, .65);
  border-radius: 24px;
  padding: 18px;
  min-height: 138px;
  text-align: left;
  background: rgba(255,255,255,.78);
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: .18s ease;
}

.category-card:active {
  transform: scale(.97);
}

.category-card i {
  width: 48px;
  height: 48px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  font-size: 1.65rem;
}

.category-card strong {
  display: block;
  font-size: 1.08rem;
  margin-bottom: 5px;
  font-weight: 950;
}

.category-card small {
  color: var(--muted);
  font-weight: 650;
}

.category-card .arrow {
  display: none;
}

.bg-currency i { background: #dff7f4; color: #008f86; }
.bg-length i { background: #e1f4ff; color: #2d7ec6; }
.bg-weight i { background: #fff0d1; color: #d98500; }
.bg-temperature i { background: #ffe5df; color: #dd392d; }
.bg-area i { background: #ece6ff; color: #7358d9; }

.recent-card {
  margin-top: 18px;
  border-radius: 24px;
  padding: 18px;
  background: rgba(255,255,255,.8);
  box-shadow: var(--shadow);
  border: 1px solid rgba(234, 223, 206, .65);
}

.recent-card h3 {
  font-size: 1rem;
  font-weight: 950;
  margin: 0;
}

.link-btn {
  border: 0;
  background: transparent;
  color: var(--teal-dark);
  font-weight: 900;
}

.search-box {
  margin: 14px;
  background: rgba(255,255,255,.82);
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
}

.search-box input {
  border: 0;
  outline: 0;
  width: 100%;
  background: transparent;
}

.selected-panel {
  margin: 14px;
  border-radius: 24px;
  background: linear-gradient(135deg, #fffaf2, #ffffff);
  color: var(--ink);
  padding: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.tiny {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 900;
}

.selected-panel h2 {
  margin: 0;
  font-weight: 1000;
}

.category-badge {
  width: 70px;
  height: 70px;
  border-radius: 22px;
  background: #f4eadb;
  color: var(--teal-dark);
  display: grid;
  place-items: center;
  font-size: 2.1rem;
}

.convert-card {
  margin: 14px;
  border-radius: 28px;
  background: rgba(255,255,255,.82);
  padding: 16px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(234, 223, 206, .65);
}

.convert-card label {
  font-size: .75rem;
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
}

.main-input {
  width: 100%;
  outline: 0;
  font-size: 2.5rem;
  font-weight: 1000;
  color: var(--ink);
  background: rgba(255, 252, 246, .9) !important;
  border: 1px solid var(--line) !important;
  border-radius: 22px !important;
  padding: 14px 16px !important;
  margin: 8px 0 12px;
}

.unit-row {
  display: grid;
  grid-template-columns: 1fr 52px 1fr;
  gap: 10px;
  align-items: center;
}

.native-select {
  display: none !important;
}

.select-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255,255,255,.86);
  text-align: left;
  min-height: 74px;
  box-shadow: 0 8px 20px rgba(70, 48, 24, .045);
}

.select-label {
  display: block;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.select-card strong {
  display: block;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.1;
  margin-top: 4px;
}

.select-card small {
  display: block;
  color: var(--teal-dark);
  font-weight: 800;
  margin-top: 3px;
}

.swap-btn {
  border: 0;
  border-radius: 18px;
  height: 52px;
  background: var(--teal);
  color: white;
  font-size: 1.2rem;
  box-shadow: 0 10px 24px rgba(0, 169, 157, .22);
}

.result-box {
  margin-top: 14px;
  border-radius: 22px;
  padding: 16px;
  background: linear-gradient(135deg, #ffffff, #fff7e8);
  border: 1px solid var(--line);
}

.result-box span {
  color: var(--muted);
  font-weight: 900;
  font-size: .75rem;
  text-transform: uppercase;
}

.result-box strong {
  display: block;
  font-size: 2rem;
  color: var(--teal-dark);
  line-height: 1.1;
  margin: 5px 0;
  word-break: break-word;
}

.result-box small {
  color: var(--muted);
}

.unit-list {
  margin: 14px;
  border-radius: 22px;
  overflow: auto;
  background: rgba(255,255,255,.84);
  box-shadow: var(--shadow);
  max-height: 330px;
  border: 1px solid var(--line);
}

.unit-item {
  border: 0;
  width: 100%;
  background: transparent;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

.unit-item b {
  font-weight: 750;
}

.unit-item span {
  font-weight: 950;
}

.history-screen {
  padding: 16px;
}

.history-filter {
  display: flex;
  gap: 9px;
  overflow: auto;
  margin-bottom: 14px;
}

.history-filter button {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 900;
  background: rgba(255,255,255,.82);
  color: var(--ink);
  white-space: nowrap;
}

.history-filter button.active {
  background: var(--teal);
  color: white;
}

.clear-history-btn {
  border: 0;
  background: #fff3f3;
  color: var(--danger);
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 900;
  box-shadow: var(--shadow);
}

.history-item {
  border-radius: 20px;
  background: rgba(255,255,255,.86);
  padding: 15px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid rgba(234, 223, 206, .65);
}

.history-item strong {
  color: var(--teal-dark);
}

.empty {
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-weight: 800;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 12px;
  width: min(calc(100% - 28px), 402px);
  height: 66px;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(234, 223, 206, .7);
  border-radius: 999px;
  display: grid;
  grid-template-columns: 1fr 78px 1fr;
  align-items: center;
  box-shadow: var(--shadow);
  z-index: 30;
  backdrop-filter: blur(16px);
}

.bottom-nav button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 900;
}

.bottom-nav i {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 3px;
}

.bottom-nav .active {
  color: var(--ink);
}

.center-action {
  width: 58px;
  height: 58px;
  border-radius: 999px !important;
  background: linear-gradient(135deg, var(--teal), #38cfc5) !important;
  color: white !important;
  margin: auto;
  box-shadow: 0 10px 25px rgba(0,169,157,.28);
}

.center-action i {
  font-size: 1.45rem;
  margin: 0;
}

.picker-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
}

.picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(45, 32, 20, .22);
  backdrop-filter: blur(5px);
}

.picker-sheet {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 430px);
  max-height: 78vh;
  background: #fffdf9;
  border-radius: 30px 30px 0 0;
  padding: 12px 18px 18px;
  box-shadow: 0 -20px 45px rgba(70, 48, 24, .15);
  animation: sheetUp .22s ease both;
}

.picker-handle {
  width: 48px;
  height: 5px;
  border-radius: 999px;
  background: #e0d4c4;
  margin: 0 auto 14px;
}

.picker-sheet h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 1000;
}

.picker-sheet p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 700;
}

.picker-close {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 16px;
  background: var(--cream);
  color: var(--ink);
}

.picker-search {
  border: 1px solid var(--line);
  background: white;
  border-radius: 18px;
  padding: 11px 13px;
  display: flex;
  gap: 9px;
  align-items: center;
  margin-bottom: 12px;
}

.picker-search input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  font-weight: 700;
}

.picker-options {
  max-height: 48vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.picker-option {
  border: 1px solid var(--line);
  background: white;
  border-radius: 18px;
  padding: 13px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
}

.picker-option.active {
  border-color: rgba(0,169,157,.45);
  background: #effffd;
}

.picker-option b {
  display: block;
  color: var(--ink);
}

.picker-option span {
  color: var(--muted);
  font-size: .86rem;
  font-weight: 700;
}

.picker-code {
  min-width: 48px;
  height: 36px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, var(--teal), #38cfc5);
  font-weight: 1000;
  font-size: .78rem;
}

.toast-msg {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%) translateY(18px);
  background: var(--ink);
  color: white;
  padding: 11px 16px;
  border-radius: 999px;
  opacity: 0;
  transition: .2s ease;
  font-weight: 800;
  z-index: 150;
}

.toast-msg.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.d-none {
  display: none !important;
}

@keyframes sheetUp {
  from { transform: translateX(-50%) translateY(100%); }
  to { transform: translateX(-50%) translateY(0); }
}

/* =========================================================
   Converto premium teal refresh
   ========================================================= */

:root {
  --teal: #13b8b0;
  --teal-dark: #008b84;
  --teal-soft: #dff8f6;
  --blue: #2f9cf4;
  --blue-soft: #e3f3ff;
  --orange: #f5a524;
  --orange-soft: #fff0cf;
  --red: #ff5b57;
  --red-soft: #ffe3df;
  --purple: #7c5cff;
  --purple-soft: #eee8ff;
  --cream: #fff8ed;
  --paper: #ffffff;
  --ink: #342419;
  --muted: #827366;
  --line: #eee2d1;
  --shadow: 0 16px 38px rgba(73, 49, 23, .10);
}

body {
  background:
    linear-gradient(rgba(255,255,255,.48), rgba(255,248,236,.55)),
    url("../img/fundo.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Phone surface */
.phone {
  background: rgba(255, 250, 240, .72) !important;
  backdrop-filter: blur(14px);
}

/* Teal header restored */
.app-header {
  height: 96px !important;
  padding: 18px 18px 22px !important;
  color: #fff !important;
  background:
    radial-gradient(circle at 90% 12%, rgba(255,255,255,.22), transparent 25%),
    linear-gradient(135deg, #13b8b0, #22c7bf 55%, #0aa79f) !important;
  box-shadow: 0 16px 34px rgba(0, 169, 157, .24);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.app-header h1 {
  color: #fff !important;
  font-size: 1.35rem !important;
  letter-spacing: -.03em;
  text-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.app-header p {
  color: rgba(255,255,255,.88) !important;
  font-weight: 800 !important;
}

.icon-btn {
  background: rgba(255,255,255,.18) !important;
  color: #fff !important;
  box-shadow: none !important;
  border: 1px solid rgba(255,255,255,.18);
}

/* Keep the right decorative circle but remove the icon */
#themeBtn {
  pointer-events: none;
}

/* Home spacing after bigger header */
.hero {
  padding-top: 24px !important;
}

/* Category cards premium */
.category-grid {
  gap: 16px !important;
}

.category-card {
  min-height: 156px !important;
  border-radius: 28px !important;
  padding: 20px !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.88)) !important;
  border: 1px solid rgba(255,255,255,.86) !important;
  box-shadow: 0 18px 42px rgba(78, 52, 26, .10) !important;
  position: relative;
  overflow: hidden;
}

.category-card::after {
  content: "";
  position: absolute;
  right: -32px;
  bottom: -36px;
  width: 110px;
  height: 110px;
  border-radius: 999px;
  opacity: .11;
}

.category-card:active {
  transform: translateY(2px) scale(.98);
}

.category-card i {
  width: 60px !important;
  height: 60px !important;
  border-radius: 21px !important;
  margin-bottom: 22px !important;
  font-size: 1.9rem !important;
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
}

.category-card strong {
  font-size: 1.22rem !important;
  letter-spacing: -.02em;
}

.category-card small {
  font-size: .93rem;
  line-height: 1.35;
}

/* Color-coded icon tiles and subtle glows */
.bg-currency i { background: linear-gradient(135deg, #13b8b0, #0b8f88) !important; color: #fff !important; }
.bg-currency::after { background: #13b8b0; }

.bg-length i { background: linear-gradient(135deg, #2f9cf4, #62c7ff) !important; color: #fff !important; }
.bg-length::after { background: #2f9cf4; }

.bg-weight i { background: linear-gradient(135deg, #f5a524, #ffc56a) !important; color: #fff !important; }
.bg-weight::after { background: #f5a524; }

.bg-temperature i { background: linear-gradient(135deg, #ff5b57, #ff9b8f) !important; color: #fff !important; }
.bg-temperature::after { background: #ff5b57; }

.bg-area i { background: linear-gradient(135deg, #7c5cff, #aa95ff) !important; color: #fff !important; }
.bg-area::after { background: #7c5cff; }

/* Recent card */
.recent-card {
  border-radius: 28px !important;
  background: rgba(255,255,255,.90) !important;
  border: 1px solid rgba(255,255,255,.84) !important;
  box-shadow: 0 18px 42px rgba(78, 52, 26, .10) !important;
}

.link-btn {
  color: var(--teal-dark) !important;
  font-weight: 1000 !important;
}

/* Category page */
.search-box,
.selected-panel,
.convert-card,
.unit-list,
.history-item {
  background: rgba(255,255,255,.92) !important;
  border: 1px solid rgba(255,255,255,.84) !important;
  box-shadow: 0 16px 36px rgba(78, 52, 26, .09) !important;
}

.selected-panel {
  background:
    radial-gradient(circle at right top, rgba(19,184,176,.16), transparent 35%),
    rgba(255,255,255,.94) !important;
}

.category-badge {
  background: linear-gradient(135deg, var(--teal-soft), #fff) !important;
  color: var(--teal-dark) !important;
}

.main-input {
  background: #fff !important;
  box-shadow: inset 0 2px 10px rgba(0,0,0,.025);
}

.select-card {
  background: #fff !important;
  border-radius: 20px !important;
}

.swap-btn,
.center-action {
  background: linear-gradient(135deg, #13b8b0, #0b8f88) !important;
  box-shadow: 0 14px 30px rgba(19,184,176,.28) !important;
}

.result-box {
  background:
    radial-gradient(circle at right top, rgba(19,184,176,.16), transparent 40%),
    linear-gradient(135deg, #ffffff, #f3fffd) !important;
  border-color: rgba(19,184,176,.18) !important;
}

/* History clear button */
.clear-history-btn {
  border-radius: 18px !important;
  background: linear-gradient(135deg, #fff2ef, #ffffff) !important;
  border: 1px solid rgba(255,91,87,.18) !important;
}

/* Bottom nav more modern */
.bottom-nav {
  background: rgba(255,255,255,.88) !important;
  border: 1px solid rgba(255,255,255,.92) !important;
  box-shadow: 0 18px 45px rgba(78, 52, 26, .14) !important;
}

.bottom-nav button {
  color: #7e7167 !important;
}

.bottom-nav .active {
  color: var(--teal-dark) !important;
}

/* Picker modal */
.picker-sheet {
  background: #fffdf8 !important;
}

.picker-code {
  background: linear-gradient(135deg, #13b8b0, #0b8f88) !important;
}

/* =========================================================
   Header upgrade: more polished, app-store style
   ========================================================= */

.app-header {
  height: 118px !important;
  padding: 22px 20px 24px !important;
  overflow: hidden;
  position: sticky;
  background:
    radial-gradient(circle at 18% 10%, rgba(255,255,255,.30), transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(255,255,255,.20), transparent 22%),
    linear-gradient(135deg, #0aa79f 0%, #16c8bf 54%, #53d7cf 100%) !important;
}

.app-header::before {
  content: "";
  position: absolute;
  width: 210px;
  height: 210px;
  right: -78px;
  top: -92px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.20);
}

.app-header::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  left: -68px;
  bottom: -95px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
}

.app-header > * {
  position: relative;
  z-index: 2;
}

.app-header h1 {
  font-size: 1.55rem !important;
  font-weight: 1000 !important;
  letter-spacing: -.045em;
  margin-bottom: 2px !important;
}

.app-header p {
  font-size: .82rem !important;
  letter-spacing: -.01em;
  color: rgba(255,255,255,.92) !important;
}

.icon-btn {
  width: 50px !important;
  height: 50px !important;
  border-radius: 19px !important;
  background: rgba(255,255,255,.18) !important;
  border: 1px solid rgba(255,255,255,.26) !important;
  backdrop-filter: blur(12px);
}

.header-mark {
  width: 54px;
  height: 54px;
  border-radius: 21px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.35rem;
  background:
    linear-gradient(135deg, rgba(255,255,255,.26), rgba(255,255,255,.10));
  border: 1px solid rgba(255,255,255,.30);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.28),
    0 14px 30px rgba(0, 105, 100, .18);
  backdrop-filter: blur(14px);
}

.hero {
  padding-top: 20px !important;
}
