/*
 * الحسابات: لوحة PIN، «حساب جديد»، زر «+» الزجاجي، وحذف الحساب بتراجع.
 * زجاج داكن فوق ما خلفه، وأزرار دائرية كهاتف حديث، بنفسجي VANTARA للفعل وحده.
 * أسماء خاصة (vpin، vacct، vdel) فلا تصطدم بالقشرة ولا بشاشة الدخول.
 */

/* ───────────────────────── لوحة PIN ───────────────────────── */

.vpin {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 20px) 20px calc(env(safe-area-inset-bottom, 0px) + 20px);
  background: rgba(5, 4, 12, 0.6);
  -webkit-backdrop-filter: blur(30px) saturate(1.4);
  backdrop-filter: blur(30px) saturate(1.4);
  color: #f5f5f7;
  font-family: 'Vantara Sans', system-ui, sans-serif;
  opacity: 0;
  transition: opacity 0.22s ease;
}
.vpin--in {
  opacity: 1;
}
.vpin--done {
  opacity: 0;
}
.vpin__panel {
  width: min(100%, 340px);
  display: grid;
  justify-items: center;
  text-align: center;
  transform: translateY(14px) scale(0.98);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}
.vpin--in .vpin__panel {
  transform: none;
}
.vpin__face {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, #8f5cff, #3b1d8f);
  box-shadow: 0 0 0 2px rgba(5, 4, 12, 0.9), 0 0 0 3.5px rgba(187, 162, 255, 0.55), 0 18px 40px rgba(0, 0, 0, 0.45);
}
.vpin__face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.vpin__initial {
  font-size: 32px;
  font-weight: 750;
  color: #fff;
}
.vpin__title {
  margin: 16px 0 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.vpin__subtitle {
  margin: 6px 0 0;
  min-height: 19px;
  font-size: 13px;
  color: #b9b5c6;
}
.vpin__lengths {
  display: inline-flex;
  gap: 4px;
  margin-top: 14px;
  padding: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.vpin__lengths[hidden] {
  display: none;
}
.vpin .vpin__len {
  min-height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 99px;
  background: none;
  color: #b9b5c6;
  font: inherit;
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.vpin .vpin__len--on {
  background: rgba(143, 92, 255, 0.9);
  color: #fff;
}
.vpin__dots {
  display: flex;
  justify-content: center;
  gap: 16px;
  height: 16px;
  margin: 26px 0 0;
  direction: ltr;
}
.vpin__dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.55);
  transition: background 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}
.vpin__dot--on {
  background: #fff;
  box-shadow: 0 0 14px rgba(187, 162, 255, 0.7);
  transform: scale(1.05);
}
.vpin__note {
  min-height: 20px;
  margin: 14px 0 0;
  font-size: 13px;
  color: #b9b5c6;
}
.vpin__note--error {
  color: #ff8f9d;
}
.vpin__pad {
  display: grid;
  grid-template-columns: repeat(3, 78px);
  gap: 16px 24px;
  margin-top: 14px;
  direction: ltr;
}
.vpin .vpin__key {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  color: #fff;
  font: inherit;
  font-size: 31px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: background 0.12s ease, transform 0.12s ease;
}
.vpin .vpin__key:active:not(:disabled) {
  background: rgba(255, 255, 255, 0.32);
  transform: scale(0.95);
}
.vpin .vpin__key:disabled {
  opacity: 0.35;
  cursor: default;
}
.vpin .vpin__key--text {
  background: none;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: visible;
  color: #d9d6e3;
}
.vpin .vpin__key--text:active:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
}
.vpin__panel--shake {
  animation: vpin-shake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
@keyframes vpin-shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-9px); }
  40%, 60% { transform: translateX(9px); }
}
@media (max-height: 640px) {
  .vpin__pad {
    grid-template-columns: repeat(3, 66px);
    gap: 12px 20px;
  }
  .vpin__key {
    width: 66px;
    height: 66px;
    font-size: 28px;
  }
  .vpin__face {
    width: 60px;
    height: 60px;
  }
}

/* ───────────────────────── زر «+» الزجاجي وقفل البطاقة ───────────────────────── */

.gate .gate__add {
  position: absolute;
  inset-inline-end: 18px;
  top: calc(env(safe-area-inset-top, 0px) + 16px);
  z-index: 5;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 10px 30px rgba(0, 0, 0, 0.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}
.gate .gate__add:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.22);
}
.gate .gate__add[hidden] {
  display: none;
}
.gate-card__pin {
  position: absolute;
  bottom: 4%;
  inset-inline-start: 4%;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(10, 8, 18, 0.72);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* ───────────────────────── حساب جديد ───────────────────────── */

.vacct {
  position: fixed;
  inset: 0;
  z-index: 880;
  display: grid;
  place-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 16px calc(env(safe-area-inset-bottom, 0px) + 16px);
  background: rgba(5, 4, 12, 0.55);
  -webkit-backdrop-filter: blur(26px) saturate(1.4);
  backdrop-filter: blur(26px) saturate(1.4);
  color: #f5f5f7;
  font-family: 'Vantara Sans', system-ui, sans-serif;
  opacity: 0;
  transition: opacity 0.22s ease;
}
.vacct--in {
  opacity: 1;
}
.vacct__panel {
  width: min(100%, 400px);
  max-height: 100%;
  overflow: auto;
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 18px 18px 20px;
  border-radius: 28px;
  background: rgba(20, 17, 30, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 40px 100px rgba(0, 0, 0, 0.5);
  transform: translateY(16px);
  transition: transform 0.34s cubic-bezier(0.16, 1, 0.3, 1);
}
.vacct--in .vacct__panel {
  transform: none;
}
.vacct__head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.vacct__title {
  margin: 0;
  font-size: 19px;
  font-weight: 750;
}
.vacct .vacct__close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #d9d6e3;
  font-size: 15px;
  cursor: pointer;
}
.vacct .vacct__face {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(20, 17, 30, 0.9), 0 0 0 4.5px rgba(187, 162, 255, 0.5), 0 22px 48px rgba(0, 0, 0, 0.45);
  transition: background 0.3s ease, transform 0.18s ease;
}
.vacct .vacct__face:active {
  transform: scale(0.97);
}
.vacct__initial {
  font-size: 46px;
  font-weight: 750;
  color: #fff;
}
.vacct__swatches {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.vacct .vacct__swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.vacct .vacct__swatch[aria-checked='true'] {
  box-shadow: 0 0 0 2px rgba(20, 17, 30, 1), 0 0 0 4px #fff;
  transform: scale(1.06);
}
.vacct .vacct__swatch--photo {
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.vacct__field {
  width: 100%;
  display: grid;
  gap: 6px;
  text-align: start;
}
.vacct__label {
  font-size: 12.5px;
  font-weight: 650;
  color: #b9b5c6;
}
.vacct__input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  color: #fff;
  font: inherit;
  font-size: 15.5px;
  outline: none;
  transition: box-shadow 0.15s ease;
}
.vacct__input:focus {
  box-shadow: inset 0 0 0 1.5px rgba(187, 162, 255, 0.7);
}
.vacct__user {
  position: relative;
  direction: ltr;
}
.vacct__at {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #8b86a0;
  font-size: 15.5px;
  pointer-events: none;
}
.vacct__input--user {
  padding-left: 32px;
}
.vacct__hint {
  font-size: 11.5px;
  color: #8b86a0;
}
.vacct__hint--bad {
  color: #ff8f9d;
}
.vacct__error {
  min-height: 18px;
  margin: 0;
  font-size: 13px;
  color: #ff8f9d;
}
.vacct .vacct__create {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  background: #8f5cff;
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.vacct .vacct__create:disabled {
  opacity: 0.45;
  cursor: default;
}
.vacct .vacct__create:active:not(:disabled) {
  transform: scale(0.985);
}

/* ───────────────────────── حذف الحساب: 10 ثوانٍ وتراجع ───────────────────────── */

.vdel {
  position: fixed;
  inset: 0;
  z-index: 920;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 4, 12, 0.78);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  color: #f5f5f7;
  font-family: 'Vantara Sans', system-ui, sans-serif;
  text-align: center;
}
.vdel__ring {
  --p: 1;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto;
  background: conic-gradient(#ff5d6c calc(var(--p) * 360deg), rgba(255, 255, 255, 0.08) 0);
  -webkit-mask: radial-gradient(circle, transparent 41px, #000 42px);
  mask: radial-gradient(circle, transparent 41px, #000 42px);
}
.vdel__count {
  margin-top: -66px;
  height: 66px;
  font-size: 30px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.vdel__title {
  margin: 22px 0 0;
  font-size: 19px;
  font-weight: 750;
}
.vdel__text {
  margin: 8px 0 0;
  font-size: 13.5px;
  color: #b9b5c6;
}
.vdel .vdel__undo {
  margin-top: 22px;
  min-width: 190px;
  min-height: 50px;
  border: 0;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.vdel .vdel__undo:active {
  transform: scale(0.97);
}
@media (prefers-reduced-motion: reduce) {
  .vpin, .vpin__panel, .vacct, .vacct__panel { transition: none; }
  .vpin__panel--shake { animation: none; }
}

/* القفل عند فتح التطبيق: لا شيء من الحساب يظهر خلفه */
.vpin--solid {
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(143, 92, 255, 0.22), transparent 60%),
    radial-gradient(90% 60% at 50% 115%, rgba(59, 29, 143, 0.28), transparent 60%),
    #05040c;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
