/* 보안과 데이터 세 칸의 그림. 연결할 때(.anim-connect) → 맡겨 둔 동안(.anim-lock) → 그만둘 때(.anim-erase).
   움직임은 app.js 의 장면이 돌린다. data-step 은 그 단계부터, data-at 은 그 단계에만 켜진다.
   스크립트가 없거나 움직임을 줄인 기기에서는 마지막 모습(연결됨 · 잠김 · 남은 데이터 0)만 보인다.
   빨강은 큰 표시에 #ff3040, 작은 글자와 버튼에 #e01e37 이다. #e01e37 글자는 흰 면 위에만 둔다(옅은 빨강 면에서는 4.5:1 이 안 된다). */

/* ── 공통 ─────────────────────────────────────────── */
/* 카드 위쪽 자리를 채운다. 모서리는 자리를 따른다. */
.anim {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 220px;
  overflow: hidden;
  border-radius: inherit;
  background: #fff2f3;
  color: #111113;
  font-size: 13px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-align: left;
  word-break: keep-all;
  -webkit-user-select: none;
  user-select: none;
}
.anim svg {
  display: block;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* 흰 카드 조각. */
.anim-connect .cn-sheet,
.anim-lock .lk-vault,
.anim-erase .er-card {
  position: relative;
  border-radius: 16px;
  background: #ffffff;
  box-shadow:
    0 1px 2px rgba(224, 30, 55, 0.06),
    0 10px 26px rgba(224, 30, 55, 0.09);
}
/* 그 단계에만 켜지는 앞 모습. 스크립트가 없으면 .on 이 붙지 않아 숨는다. */
.anim [data-at] {
  transition: opacity 0.3s ease;
}
.anim [data-at]:not(.on) {
  opacity: 0;
}
/* 누르는 손끝. 누르는 단계에 한 번 퍼지고 사라진다. */
@keyframes anim-tap {
  from {
    transform: scale(0.3);
    opacity: 0.9;
  }
  to {
    transform: scale(1.9);
    opacity: 0;
  }
}

/* ── 연결할 때 ────────────────────────────────────── */
/* 인스타그램 로그인 화면의 권한 시트. 위 띠의 주소로 인스타그램 화면임을 보인다. */
.anim-connect .cn-sheet {
  width: 272px;
  overflow: hidden;
}
.anim-connect .cn-bar {
  display: grid;
  place-items: center;
  height: 26px;
  border-bottom: 1px solid #ececee;
  background: #f4f4f5;
  color: #5e5e63;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
}
.anim-connect .cn-body {
  padding: 10px 14px 12px;
}
.anim-connect .cn-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
}
.anim-connect .cn-mark {
  width: 18px;
  height: 18px;
  fill: #111113;
  stroke: none;
}
.anim-connect .cn-mark .cn-mark-b {
  fill: #ffffff;
}
.anim-connect .cn-perms {
  display: grid;
  gap: 2px;
  margin-top: 7px;
}
.anim-connect .cn-perm {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 23px;
  font-size: 12.5px;
}
.anim-connect .cn-perm > svg {
  width: 15px;
  height: 15px;
  color: #5e5e63;
  stroke-width: 1.9;
}
.anim-connect .cn-box {
  position: relative;
  flex: none;
  width: 18px;
  height: 18px;
  margin-left: auto;
  border: 1.5px solid #dadada;
  border-radius: 50%;
}
.anim-connect .cn-tick {
  position: absolute;
  inset: -1.5px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ff3040;
  color: #ffffff;
}
.anim-connect .cn-tick svg {
  width: 12px;
  height: 12px;
  stroke-width: 3;
}
.anim-connect.play .cn-tick[data-step] {
  transition:
    opacity 0.2s ease,
    transform 0.35s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.anim-connect.play .cn-tick[data-step]:not(.on) {
  transform: scale(0.3);
}
/* 「허락」 버튼과 「연결됨」 은 한 칸에 겹친다. */
.anim-connect .cn-act {
  display: grid;
  margin-top: 9px;
}
.anim-connect .cn-act > * {
  grid-area: 1 / 1;
}
.anim-connect .cn-allow {
  position: relative;
  display: grid;
  place-items: center;
  height: 30px;
  overflow: hidden;
  border-radius: 9px;
  background: #e01e37;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  transition:
    opacity 0.25s ease,
    transform 0.15s ease,
    background-color 0.15s ease;
}
.anim-connect .cn-allow:has(.cn-tap.on) {
  transform: scale(0.96);
  background: #c0152c;
}
.anim-connect .cn-tap {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
}
.anim-connect .cn-tap.on {
  animation: anim-tap 0.6s ease-out both;
}
.anim-connect .cn-done {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  border-radius: 9px;
  background: #fff2f3;
  font-size: 13px;
  font-weight: 700;
}
.anim-connect .cn-done svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.4;
}
.anim-connect .cn-done circle {
  fill: #ff3040;
  stroke: none;
}
.anim-connect .cn-done path {
  stroke: #ffffff;
}
.anim-connect.play .cn-done[data-step] {
  transition:
    opacity 0.3s ease,
    transform 0.4s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.anim-connect.play .cn-done[data-step]:not(.on) {
  transform: scale(0.9);
}

/* ── 맡겨 둔 동안 ─────────────────────────────────── */
/* 맡긴 정보 카드 위로 자물쇠가 내려와 걸린다. */
.anim-lock .lk-vault {
  width: 256px;
  margin-top: 20px;
  padding: 34px 14px 14px;
}
.anim-lock .lk-edge {
  position: absolute;
  inset: 0;
  border: 1.5px solid #ff3040;
  border-radius: inherit;
}
.anim-lock.play .lk-edge[data-step]:not(.on) {
  transform: none;
}
.anim-lock .lk-cap {
  position: absolute;
  top: 11px;
  left: 15px;
  color: #5e5e63;
  font-size: 11px;
  font-weight: 600;
}
.anim-lock .lk-tag {
  position: absolute;
  top: 8px;
  right: 12px;
  padding: 2px 7px;
  border: 1px solid #ffc9cf;
  border-radius: 6px;
  color: #e01e37;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
/* 자물쇠. 고리(.lk-sh)가 몸통(.lk-bd) 위에 걸린다. 몸통의 열쇠 구멍은 점과 막대다. */
.anim-lock .lk-lock {
  position: absolute;
  top: -24px;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 38px;
  margin-left: -19px;
}
.anim-lock .lk-sh {
  width: 24px;
  height: 20px;
  margin-bottom: -5px;
  border: 4px solid #ff3040;
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
}
.anim-lock .lk-bd {
  position: relative;
  width: 38px;
  height: 29px;
  border-radius: 8px;
  background: #ff3040;
  box-shadow: 0 6px 14px rgba(224, 30, 55, 0.25);
}
.anim-lock .lk-bd::before,
.anim-lock .lk-bd::after {
  content: "";
  position: absolute;
  left: 50%;
  background: #ffffff;
}
.anim-lock .lk-bd::before {
  top: 8px;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  border-radius: 50%;
}
.anim-lock .lk-bd::after {
  top: 12px;
  width: 3px;
  height: 8px;
  margin-left: -1.5px;
  border-radius: 2px;
}
/* 내려오기 전에는 위에 있다. 내려와서 살짝 닿았다가 선다. */
.anim-lock.play .lk-lock[data-step] {
  transition:
    opacity 0.3s ease,
    transform 0.5s cubic-bezier(0.25, 1.35, 0.5, 1);
}
.anim-lock.play .lk-lock[data-step]:not(.on) {
  transform: translateY(-34px);
}
/* 고리는 열린 채 떠 있다가 찰칵 내려앉는다. */
.anim-lock.play .lk-sh[data-step]:not(.on) {
  opacity: 1;
  transform: translateY(-9px);
}
.anim-lock.play .lk-sh.on {
  animation: anim-lock-snap 0.3s ease-in both;
}
@keyframes anim-lock-snap {
  0% {
    transform: translateY(-9px);
  }
  70% {
    transform: translateY(1.5px);
  }
  100% {
    transform: none;
  }
}
/* 잠기는 순간 자물쇠 둘레로 옅은 고리가 한 번 퍼진다. */
.anim-lock .lk-ring {
  position: absolute;
  top: -24px;
  left: 50%;
  width: 56px;
  height: 56px;
  margin-left: -28px;
  border: 2px solid #ff3040;
  border-radius: 50%;
}
.anim-lock .lk-ring.on {
  animation: anim-lock-ring 0.7s ease-out both;
}
@keyframes anim-lock-ring {
  from {
    transform: scale(0.7);
    opacity: 0.4;
  }
  to {
    transform: scale(1.5);
    opacity: 0;
  }
}
.anim-lock .lk-rows {
  display: grid;
  gap: 6px;
}
.anim-lock .lk-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 25px;
  padding: 0 10px;
  border-radius: 8px;
  background: #f4f4f5;
}
.anim-lock .lk-row > svg {
  width: 14px;
  height: 14px;
  color: #5e5e63;
  stroke-width: 1.9;
}
.anim-lock .lk-k {
  flex: none;
  width: 38px;
  color: #5e5e63;
  font-size: 11.5px;
  font-weight: 600;
}
/* 글자와 암호문은 한 칸에 겹친다. 암호문은 왼쪽에서부터 덮어 쓴다. */
.anim-lock .lk-v {
  display: grid;
  flex: 1;
  min-width: 0;
  align-items: center;
}
.anim-lock .lk-v > * {
  grid-area: 1 / 1;
  overflow: hidden;
  white-space: nowrap;
}
.anim-lock .lk-plain {
  font-size: 12.5px;
  font-weight: 600;
}
.anim-lock .lk-ct {
  color: #e01e37;
  font-size: 8px;
  letter-spacing: 1.5px;
}
.anim-lock.play .lk-ct[data-step] {
  transition:
    opacity 0.2s ease,
    clip-path 0.45s ease-out;
}
.anim-lock.play .lk-ct[data-step]:not(.on) {
  transform: none;
  clip-path: inset(0 100% 0 0);
  transition: none;
}
.anim-lock.play .lk-ct[data-step].on {
  clip-path: inset(0);
}
/* 글자는 암호문이 덮어 오는 만큼 왼쪽부터 지워진다. 처음으로 돌아갈 때는 둘 다 바로 바뀐다. */
.anim-lock.play .lk-plain:not(.on) {
  opacity: 1;
  clip-path: inset(0 0 0 100%);
  transition: clip-path 0.45s ease-out;
}
.anim-lock.play .lk-plain.on {
  clip-path: inset(0);
  transition: none;
}
.anim-lock.play .lk-row:nth-child(2) .lk-ct.on,
.anim-lock.play .lk-row:nth-child(2) .lk-plain:not(.on) {
  transition-delay: 0.12s;
}
.anim-lock.play .lk-row:nth-child(3) .lk-ct.on,
.anim-lock.play .lk-row:nth-child(3) .lk-plain:not(.on) {
  transition-delay: 0.24s;
}

/* ── 그만둘 때 ────────────────────────────────────── */
/* 연결한 계정 카드. 스위치를 끄면 아래 데이터 줄이 흩어지고 빈 칸이 남는다. */
.anim-erase .er-card {
  width: 264px;
  padding: 12px 14px 14px;
}
.anim-erase .er-head {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 28px;
}
.anim-erase .er-av {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #f4f4f5;
  color: #5e5e63;
}
.anim-erase .er-av svg {
  width: 15px;
  height: 15px;
}
.anim-erase .er-id {
  font-size: 13px;
  font-weight: 700;
}
.anim-erase .er-state {
  display: grid;
  justify-items: end;
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 600;
}
.anim-erase .er-state > * {
  grid-area: 1 / 1;
  white-space: nowrap;
}
.anim-erase .er-off {
  color: #5e5e63;
}
/* 스위치. 회색 바탕 위에 켜진 빨강을 겹치고, 손잡이는 켜진 동안 오른쪽에 있다. */
.anim-erase .er-sw {
  position: relative;
  flex: none;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #dadada;
}
.anim-erase .er-sw-on {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #ff3040;
}
.anim-erase .er-knob[data-at] {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(17, 17, 19, 0.22);
  opacity: 1;
  transition: transform 0.3s cubic-bezier(0.3, 0.7, 0.3, 1);
}
.anim-erase .er-knob.on {
  transform: translateX(16px);
}
.anim-erase .er-tap {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  background: rgba(17, 17, 19, 0.14);
}
.anim-erase .er-tap.on {
  animation: anim-tap 0.6s ease-out both;
}
/* 데이터 줄과 빈 칸은 한 칸에 겹친다. */
.anim-erase .er-body {
  display: grid;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #ececee;
}
.anim-erase .er-body > * {
  grid-area: 1 / 1;
}
.anim-erase .er-rows {
  display: grid;
  gap: 5px;
}
.anim-erase .er-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 25px;
  padding: 0 10px;
  border-radius: 8px;
  background: #f4f4f5;
  font-size: 12px;
  font-weight: 600;
}
.anim-erase .er-row svg {
  width: 14px;
  height: 14px;
  color: #5e5e63;
  stroke-width: 1.9;
}
.anim-erase .er-row b {
  margin-left: auto;
  color: #5e5e63;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
/* 꺼지면 줄마다 다른 쪽으로 가볍게 떠오르며 흐려진다. 돌아올 때는 바로 선다. */
.anim-erase .er-row[data-at] {
  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    filter 0.25s ease;
}
.anim-erase .er-row[data-at]:not(.on) {
  transform: translate(-16px, -10px) rotate(-3deg);
  filter: blur(3px);
  transition-duration: 0.55s;
  transition-timing-function: ease-in;
}
.anim-erase .er-row[data-at]:nth-child(2):not(.on) {
  transform: translate(14px, -12px) rotate(2deg);
  transition-delay: 0.08s;
}
.anim-erase .er-row[data-at]:nth-child(3):not(.on) {
  transform: translate(-4px, -16px) rotate(-1deg);
  transition-delay: 0.16s;
}
.anim-erase.play .er-empty[data-step].on {
  transition-delay: 0.5s;
}
.anim-erase .er-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 1.5px dashed #dadada;
  border-radius: 10px;
}
.anim-erase .er-empty span {
  color: #5e5e63;
  font-size: 12px;
  font-weight: 600;
}
.anim-erase .er-empty b {
  color: #ff3040;
  font-size: 30px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* ── 좁은 화면 ────────────────────────────────────── */
@media (max-width: 640px) {
  .anim {
    height: 200px;
  }
  .anim-connect .cn-body {
    padding: 9px 14px 11px;
  }
  .anim-connect .cn-perms {
    gap: 1px;
    margin-top: 6px;
  }
  .anim-connect .cn-perm {
    height: 22px;
  }
  .anim-connect .cn-act {
    margin-top: 8px;
  }
  .anim-lock .lk-vault {
    margin-top: 18px;
  }
}
