/* =========================================================
  Variáveis
========================================================= */
:root {
  --bg: #efedf3;
  --paper: #f8f3e8;

  --ink-main: #2f3f88;
  --ink-soft: rgba(47, 64, 127, 0.75);
  --ink-placeholder: rgba(77, 89, 152, 0.45);

  --border: rgba(214, 196, 197, 0.9);
  --line: rgba(98, 106, 156, 0.14);

  --accent: #6f7fdf;
  --accent-dark: #5567d2;

  --shadow: 0 14px 34px rgba(44, 49, 92, 0.12);
  --shadow-soft: 0 10px 22px rgba(44, 49, 92, 0.10);

  --line-gap: 32px;
}

/* =========================================================
  Reset / Base
========================================================= */
* { box-sizing: border-box; }

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

body{
  background:
    radial-gradient(1200px 600px at 75% 5%, rgba(220, 195, 205, 0.45), transparent 60%),
    radial-gradient(900px 500px at 15% -10%, rgba(255, 250, 246, 0.95), transparent 55%),
    linear-gradient(180deg, #f6f1ec 0%, #eee6df 100%);
  font-family: "Cormorant Garamond", serif;
  color: var(--ink-main);
  padding: 10px;
}

/* =========================================================
   Cartão principal / Responsividade (zoom)
========================================================= */
.page{
  width: min(920px, 100%);
  margin: 0 auto;
  border-radius: 18px;
  padding: 12px;
  zoom: 1.25;

  border: 1px solid rgba(210, 175, 165, 0.65);

  background:
    radial-gradient(1000px 500px at 40% 0%, rgba(255, 220, 210, 0.35), transparent 60%),
    linear-gradient(180deg, rgba(255, 250, 246, 0.98), rgba(244, 236, 229, 0.98));

  box-shadow:
    0 28px 70px rgba(60, 50, 45, 0.18),
    0 0 0 1px rgba(255,255,255,0.7) inset,
    0 0 50px rgba(205, 160, 150, 0.25);
}
@supports not (zoom: 1) {
  .page {
    transform: scale(1.25);
    transform-origin: top center;
  }
}

@media (max-width: 1100px) { .page { zoom: 1.15; } }
@media (max-width: 820px)  { .page { zoom: 1; } }

/* =========================================================
 Topo
========================================================= */
.entry-header {
  text-align: center;
  position: relative;
  padding: 6px 56px 10px;
  border-bottom: none;
}

.title {
  margin: 0;
  font-size: clamp(2.1rem, 4.2vw, 3.2rem);
  line-height: 1;
  font-weight: 700;
  color: #364694;
  letter-spacing: 0.2px;
}

.header-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
  margin-bottom: 4px;
  color: rgba(205, 152, 145, 0.9);
}

.header-ornament span {
  width: clamp(80px, 18vw, 160px);
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(210, 165, 160, 0.9), transparent);
}

.header-ornament i {
  font-style: normal;
  font-size: 12px;
}

.entry-date {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  font-weight: 700;
  color: rgba(54, 70, 148, 0.85);
}

/* Botão navegação */
.nav-btn {
  position: absolute;
  top: 8px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(225, 213, 225, 0.9);
  background: rgba(255, 255, 255, 0.65);
  box-shadow: 0 10px 24px rgba(44, 49, 92, 0.14);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: rgba(54, 70, 148, 0.9);
  font-size: 20px;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.nav-btn:hover { transform: translateY(-1px); }
.nav-btn:active { transform: translateY(0px); box-shadow: 0 8px 18px rgba(44, 49, 92, 0.12); }
.nav-next { right: 10px; }

/* =========================================================
    “Folha”
========================================================= */
.sheet{
  margin-top: 26px;
  position: relative;
  border-radius: 18px;
  padding: 12px;

  border: 1px solid rgba(200, 160, 150, 0.75);

  background:
    radial-gradient(900px 400px at 20% 0%, rgba(255, 225, 215, 0.28), transparent 60%),
    linear-gradient(180deg, rgba(255, 253, 250, 1) 0%, rgba(248, 236, 228, 1) 100%);

  box-shadow:
    0 24px 60px rgba(80, 60, 50, 0.20),
    0 0 0 12px rgba(255,255,255,0.18),
    0 0 40px rgba(210, 170, 160, 0.30);
}

.sheet::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.35) 0%,
    rgba(255,255,255,0.08) 15%,
    transparent 40%
  );
  mix-blend-mode: soft-light;
}

.sheet::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius:18px;
  pointer-events:none;
  box-shadow: inset 0 0 40px rgba(255, 220, 205, 0.25);
}

.sheet:hover{
  transform: translateY(-2px);
  box-shadow:
    0 32px 80px rgba(80, 60, 50, 0.25),
    0 0 0 14px rgba(255,255,255,0.25),
    0 0 60px rgba(215, 175, 160, 0.40);
}

.sheet-content {
  position: relative;
  border: 1px solid rgba(226, 214, 204, 0.95);
  border-radius: 12px;
  padding: 18px 14px 12px;

  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent calc(var(--line-gap) - 1px),
      var(--line) calc(var(--line-gap) - 1px),
      var(--line-gap)
    ),
    linear-gradient(180deg, rgba(255, 252, 249, 0.98) 0%, rgba(249, 238, 233, 0.98) 100%);

  box-shadow:
    inset 0 2px 6px rgba(255,255,255,0.75),
    inset 0 -18px 35px rgba(160,130,110,0.12),
    inset 10px 0 22px rgba(120,90,120,0.06),
    0 8px 18px rgba(44,49,92,0.06);
}

/* =========================================================
   Título do formulário
========================================================= */
.question-title {
  margin: 0;
  min-height: var(--line-gap);
  display: flex;
  align-items: center;
  font-size: clamp(2rem, 3.2vw, 2.55rem);
  font-weight: 700;
  color: #31428d;
}

#checkinForm .question-title {
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(150, 120, 140, 0.18);
  background-image: linear-gradient(
    to right,
    transparent,
    rgba(200, 170, 170, 0.25),
    transparent
  );
  background-repeat: no-repeat;
  background-position: bottom;
  background-size: 100% 1px;
}

/* =========================================================
   Cabeçalho “✨ Checkin Diário”
========================================================= */
.checkin-head { display: block; margin-bottom: 14px; }

.checkin-title { margin-bottom: 28px; }

.checkin-datetime {
  font-family: "Inter", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(47, 64, 127, 0.78);
  margin: 0 0 48px;
}

.checkin-tips-title {
  font-family: "Inter", sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
  color: rgba(47, 64, 127, 0.78);
  margin: 0 0 6px;
}

.checkin-tips {
  font-family: "Inter", sans-serif;
  font-size: 0.86rem;
  color: rgba(47, 64, 127, 0.78);
  line-height: 1.4;
  margin: 0;
}

/* =========================================================
   Campos (labels, inputs, textareas)
========================================================= */
.lined-block {
  margin-top: 48px; /* respiro entre blocos */
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lined-textarea textarea { min-height: 110px; }

.lined-block label {
  font-family: "Inter", sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  color: rgba(47, 64, 127, 0.78);
  display: grid;
  grid-template-columns: 18px 1fr;
  grid-template-rows: auto auto;
  column-gap: 8px;
  row-gap: 2px;
  align-items: start;

  position: relative;
  padding-left: 10px;
}

.lined-block label::before {
  content:"";
  position:absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  border-radius: 999px;
  background: rgba(111, 127, 223, 0.35);
}

.label-emoji {
  width: 18px;
  display: inline-flex;
  justify-content: center;
  grid-row: 1 / span 2;
  grid-column: 1;
  margin-top: 2px;
}

.label-title {
  grid-column: 2;
  grid-row: 1;
  color: rgba(47, 64, 127, 0.92);
}

.label-sub {
  grid-column: 2;
  grid-row: 2;
  font-style: italic;
  font-weight: 600;
  opacity: 0.85;
  margin-top: 2px;
}

.lined-block input,
.lined-block textarea,
.select-block select {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(223, 211, 201, 0.95);
  background: rgba(255, 255, 255, 0.62);
  outline: none;
  padding: 14px 14px;
  font-family: "Inter", sans-serif;
  font-size: 0.95rem;
  color: rgba(47, 64, 127, 0.92);
  box-shadow: 0 10px 22px rgba(44, 49, 92, 0.08);
  transition: box-shadow 220ms ease, transform 180ms ease, border-color 220ms ease;
  will-change: box-shadow, transform;
}

.lined-block textarea {
  resize: none;
  line-height: 1.35;
  border-radius: 18px;
}

.lined-block input::placeholder,
.lined-block textarea::placeholder {
  color: var(--ink-placeholder);
}

.lined-block input:focus,
.lined-block textarea:focus,
.select-block select:focus {
  border-color: rgba(111, 127, 223, 0.45);
  box-shadow: 0 0 0 3px rgba(111, 127, 223, 0.18),
              0 12px 24px rgba(44, 49, 92, 0.09);
  transform: translateY(-0.5px);
}

/* =========================================================
  SELECT iOS: placeholder + chevron “sempre alinhado”
   (seta via background-image, sem top fixo)
========================================================= */
.select-block select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  padding-right: 46px;

  /* Chevron iOS via SVG (alinha no centro sempre) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5' fill='none' stroke='rgba(47,64,127,0.70)' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px 16px;
}

/* Hover: um “toque” */
.select-block:hover select {
  box-shadow: 0 10px 22px rgba(44, 49, 92, 0.08),
              0 0 0 2px rgba(111, 127, 223, 0.08);
}

/* Active/click: micro pressionado */
.select-block:active select {
  transform: translateY(0px);
}

/* Placeholder no select */
.select-block select:required:invalid {
  color: var(--ink-placeholder);
}
.select-block select option[value=""] {
  color: var(--ink-placeholder);
}
.select-block select option {
  color: rgba(47, 64, 127, 0.92);
}

/* =========================================================
   Chips
========================================================= */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px dashed rgba(214, 178, 176, 0.70);
  border-radius: 14px;
  background: rgba(255, 248, 244, 0.55);
}

.chip {
  border: 1px solid rgba(214, 178, 176, 0.70);
  background: rgba(255, 232, 226, 0.70);
  color: rgba(63, 72, 138, 0.92);
  font-family: "Inter", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 100ms ease, box-shadow 120ms ease;
  white-space: nowrap;
}

.chip:hover { transform: translateY(-1px); box-shadow: 0 12px 18px rgba(44,49,92,0.10); }
.chip:active { transform: translateY(0px); }

.chip.is-active {
  background: rgba(255, 214, 204, 0.85);
  border-color: rgba(210, 150, 150, 0.75);
}

/* =========================================================
   Botões + Status
========================================================= */
.actions {
  display: flex;
  gap: 12px;
  margin-top: 58px;
  align-items: center;
}

.btn {
  height: 40px;
  min-width: 132px;
  border-radius: 999px;
  border: 1px solid rgba(211, 200, 203, 0.9);
  font-family: "Inter", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 100ms ease, box-shadow 120ms ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  border: none;
  color: #fff;
  background: linear-gradient(180deg, #7e8de8 0%, #5f72d8 100%);
  box-shadow: 0 14px 26px rgba(84, 100, 187, 0.26);
  padding: 0 22px;
}

.btn-secondary {
  background: rgba(250, 247, 247, 0.72);
  color: rgba(92, 104, 173, 0.92);
  padding: 0 22px;
}

.status {
  margin: 18px 0 0;
  font-family: "Inter", sans-serif;
  font-size: 0.88rem;
  color: rgba(47, 64, 127, 0.62);
  line-height: 1.35;
}

/* =========================================================
   Dica importante (card editorial com aspas)
========================================================= */
.dica-importante {
  margin: 26px 0 26px;
  padding: 22px 22px 22px 26px;
  border-radius: 16px;

  background:
    radial-gradient(800px 300px at 10% 0%, rgba(255, 230, 235, 0.35), transparent 60%),
    linear-gradient(180deg, rgba(255, 245, 247, 0.78), rgba(255, 240, 243, 0.68));

  border: 1px solid rgba(214, 196, 197, 0.55);

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.9),
    0 10px 24px rgba(44, 49, 92, 0.07);

  position: relative;
  overflow: hidden;
}

/* textura suave com blur */
.dica-importante::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(120,90,110,0.35) 0px,
    rgba(120,90,110,0.35) 1px,
    transparent 1px,
    transparent 4px
  );
  filter: blur(0.7px);
}

/* linha lateral */
.dica-importante::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(
    180deg,
    rgba(111, 127, 223, 0.85),
    rgba(180, 190, 255, 0.6)
  );
}


/* título */
.dica-titulo {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #31428d;
  margin-bottom: 10px;
  position: relative;
  z-index: 2;
}

/* texto + lista (iguais: editorial / itálico) */
.dica-texto,
.dica-lista {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.02rem;
  line-height: 1;
  font-style: italic;
  color: rgba(47, 64, 127, 0.85);
  position: relative;
  z-index: 2;
}

/* dá respiro e “encaixa” com as aspas */
.dica-texto { padding: 0 22px 0 22px; }
.dica-lista { margin-top: 10px; padding-left: 22px; }

/* =========================================================
  Último registro
========================================================= */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hint {
  font-family: "Inter", sans-serif;
  font-size: 0.74rem;
  color: rgba(47, 64, 127, 0.52);
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(225, 213, 225, 0.9);
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 10px 20px rgba(44,49,92,0.10);
  cursor: pointer;
  color: rgba(54,70,148,0.85);
  font-size: 16px;
}

.checkins-list {
  display: grid;
  gap: 10px;
  padding-top: 10px;
}

.checkin-card {
  border: 1px solid rgba(223, 211, 201, 0.9);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 14px 26px rgba(44,49,92,0.10);
  padding: 12px 12px;
}

.checkin-card .top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(223, 211, 201, 0.6);
  margin-bottom: 10px;
}

.checkin-card .date {
  font-weight: 700;
  color: rgba(49, 66, 141, 0.9);
  font-size: 1.05rem;
}

.checkin-card .pill {
  font-family: "Inter", sans-serif;
  font-size: 0.72rem;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(111, 127, 223, 0.22);
  background: rgba(111, 127, 223, 0.10);
  color: rgba(55, 71, 150, 0.9);
  white-space: nowrap;
}

.checkin-card .meta {
  display: grid;
  gap: 10px;
  font-family: "Inter", sans-serif;
  font-size: 0.92rem;
  color: rgba(47, 64, 127, 0.92);
}

.checkin-card .row { display: grid; gap: 4px; }

.checkin-card .k {
  color: rgba(47, 64, 127, 0.62);
  font-weight: 700;
  font-size: 0.80rem;
}

.checkin-card .v {
  font-weight: 500;
  line-height: 1.35;
  word-break: break-word;
}

.checkin-card .foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(223, 211, 201, 0.6);
  font-family: "Inter", sans-serif;
  font-size: 0.74rem;
  color: rgba(47, 64, 127, 0.50);
}

/* =========================================================
   Decor
========================================================= */
.decor-quill {
  position: absolute;
  right: 10px;
  bottom: 8px;
  width: 120px;
  height: 90px;
  opacity: 0.55;
  pointer-events: none;
  background:
    radial-gradient(circle at 70% 65%, rgba(120, 84, 150, 0.25), transparent 55%),
    radial-gradient(circle at 55% 70%, rgba(255, 200, 170, 0.25), transparent 55%);
  filter: blur(0.2px);
}

.decor-quill::after {
  content:"";
  position:absolute;
  right: 0;
  bottom: -2px;
  font-size: 100px;
  transform: rotate(-12deg);
}

/* =========================================================
   Mobile
========================================================= */
@media (max-width: 640px) {
  :root { --line-gap: 30px; }
  .page { padding: 10px; }
  .entry-header { padding: 6px 56px 10px; }
  .checkin-card .top { flex-direction: column; align-items: flex-start; }
  .checkin-card .foot { flex-direction: column; align-items: flex-start; }
}


/* ===== Micro animação + cores sutis do hint (Último registro) ===== */
.hint{
  transition: opacity 180ms ease, transform 220ms ease, filter 220ms ease, color 220ms ease;
  will-change: opacity, transform, filter;
  opacity: 0.72;
}

@keyframes hintBreath{
  0%   { opacity: 0.60; transform: translateY(0); }
  45%  { opacity: 1;    transform: translateY(-1px); }
  100% { opacity: 0.82; transform: translateY(0); }
}

.hint.is-animating{
  animation: hintBreath 520ms cubic-bezier(0.2, 0.8, 0.2, 1);
  filter: saturate(1.05);
}

/* cor bem sutil por estado */
/* Recarregando */
.hint.is-loading{
  color: rgba(47, 64, 127, 0.62);
}

/* Atualizado */
.hint.is-success{
  color: rgba(47, 64, 127, 0.78);
}


/* ===== Botão ↻ girando suavemente (recarregando) ===== */
.icon-btn{
  transition: transform 200ms ease, box-shadow 200ms ease, filter 200ms ease;
  will-change: transform;
}

/* gira o próprio botão (o caractere ↻ gira junto) */
@keyframes spinSoft{
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.icon-btn.is-loading{
  animation: spinSoft 1.05s linear infinite;
  filter: saturate(1.05);
}

/* opcional: ao passar o mouse, mantém “vivo” sem exagero */
.icon-btn.is-loading:hover{
  box-shadow: 0 12px 24px rgba(44,49,92,0.12);
}


/* Último registro: não forçar caixa alta nos valores */
.checkin-card .v{
  text-transform: none;
  letter-spacing: normal;
}


/* ===== Último registro: mais respiro entre linhas ===== */
.checkin-card .meta{
  gap: 14px; /* antes era 10px */
}

/* cada linha vira um “mini-parágrafo” */
.checkin-card .row{
  gap: 6px;           /* distância entre título e valor */
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(223, 211, 201, 0.55);
}

.checkin-card .row:last-child{
  border-bottom: 0;
  padding-bottom: 0;
}

/* valor com cara de parágrafo */
.checkin-card .v{
  display: block;
  margin-top: 2px;
  line-height: 1.55;
}

/* dá mais “ar” só nas ENERGIAS (fica elegante) */
.checkin-card .k{
  margin-bottom: 2px;
}


/* ===== Mobile fix: Último registro não estoura a página ===== */
@media (max-width: 640px){

  /* garante que o conteúdo do card não vaze */
  .checkin-card{
    max-width: 100%;
    overflow: hidden;
  }

  /* o topo vira coluna e a pill pode quebrar linha */
  .checkin-card .top{
    flex-direction: column;
    align-items: flex-start;
  }

  .checkin-card .pill{
    width: 100%;
    white-space: normal;     /* 👈 deixa quebrar */
    overflow-wrap: anywhere; /* 👈 evita estouro por texto longo */
  }

  /* segurança extra para qualquer texto longo dentro do meta */
  .checkin-card .meta,
  .checkin-card .v{
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

@media (max-width: 640px){
  .sheet-content{ overflow-x: hidden; }
}

.entry-date {
  display: none;
}


.header-badges{
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.badge{
  font-family: "Inter", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(111, 127, 223, 0.22);
  background: rgba(111, 127, 223, 0.10);
  color: rgba(55, 71, 150, 0.86);
}

/* ===== Espaçamento maior entre blocos principais ===== */
.sheet + .sheet{
  margin-top: 34px; /* aumenta separação entre folhas */
}

/* ===== Último registro colapsado ===== */

.sheet.is-collapsed .checkins-list{
  display: none;
}

.sheet.is-collapsed .section-head{
  margin-bottom: 0;
}

/* ===== FIX definitivo: botão recarregar perfeitamente redondo no mobile ===== */
#btnRecarregar{
  -webkit-appearance: none;
  appearance: none;

  padding: 0;              /* remove padding interno nativo */
  line-height: 1;          /* evita distorção vertical */
  aspect-ratio: 1 / 1;     /* força proporção quadrada */
  border-radius: 50%;      /* círculo real */
  display: grid;
  place-items: center;     /* centraliza o ↻ */
}