/* ====== ОСНОВА ====== */
html, body {
  margin: 0;
  padding: 0;
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #1e3c72, #2a5298);
  color: white;
  height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow: hidden;          
  display: flex;
  flex-direction: column;
}

/* ====== ШАПКА ====== */
header {
  display: flex;
  justify-content: center;
  padding: 8px;
  background: rgba(255,255,255,0.05);
  width: 100%;
}
header .logo {
  font-weight: bold;
  font-size: 16px;
}

/* ====== ОСНОВНОЙ КОНТЕЙНЕР ====== */
.payment {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 8px 12px 70px;
  box-sizing: border-box;
}

/* ====== КАРТА ====== */
.card-container {
  width: 100%;
  max-width: 200px;
  aspect-ratio: 85.60 / 53.98;
  margin: 0 auto 12px;
}
.card {
  width: 100%;
  height: 100%;
  position: relative;
  perspective: 1000px;
}
.card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s ease;
}
.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  backface-visibility: hidden;
  top: 0;
  left: 0;
}
.card-front {
  background: linear-gradient(135deg, #4facfe, #00f2fe);
  padding: 10px;
  box-sizing: border-box;
}
.card-back {
  background: linear-gradient(135deg, #141e30, #243b55);
  padding: 10px;
  box-sizing: border-box;
  transform: rotateY(180deg);
}
/* ПЕРЕВОРОТ */
.card.flipped .card-inner { transform: rotateY(180deg); }

.card-chip { width: 28px; height: 20px; background: gold; border-radius: 4px; margin-bottom: 6px; }
.card-brand { position: absolute; top: 10px; right: 10px; }
.card-brand img { width: 40px; height: auto; display: block; }
.card-number { font-size: 14px; letter-spacing: 1px; margin-top: 10px; }
.card-footer { margin-top: 10px; font-size: 11px; display: flex; justify-content: space-between; }
.card-holder { font-size: 11px; font-weight: bold; text-transform: uppercase; }
.magnet { background: #000; height: 24px; margin: 12px 0; }
.cvv-box { text-align: right; font-size: 13px; }

/* ====== ФОРМА ====== */
form { width: 100%; }
form label { font-size: 11px; margin-bottom: 2px; display: block; color: #eee; }
form input, form select {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  margin-bottom: 10px;
  box-sizing: border-box;
}
form input:focus, form select:focus {
  outline: none;
  box-shadow: 0 0 6px rgba(255,215,0,0.8);
}
.row { display: flex; gap: 8px; }
.row > div { flex: 1; }
.cvv-block { flex: 0.7; }

/* ====== КНОПКА ОПЛАТЫ ====== */
#pay-btn {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 420px;
  min-height: 48px;
  background: #ffd700;
  color: #222;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
  z-index: 1000;
}
#pay-btn:hover { background: #ffcc00; }

.secure-msg { text-align: center; font-size: 10px; color: #aee; margin-top: 4px; }
.trust-icons { display: flex; justify-content: center; gap: 10px; margin: 6px 0; flex-wrap: wrap; }
.trust-icons img { height: 20px; }

/* ====== ПОДВАЛ ====== */
footer {
  text-align: center;
  font-size: 11px;
  padding: 6px;
  background: rgba(255,255,255,0.05);
  margin-top: auto;
}

/* ====== МОДАЛКА ====== */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
  z-index: 2000;
}
.modal-content {
  background: #fff;
  color: #000;
  width: 90%;
  max-width: 320px;
  padding: 16px;
  border-radius: 14px;
  text-align: center;
  animation: popin 0.3s ease;
  box-sizing: border-box;
}
.modal-content h3 { margin-top: 0; font-size: 16px; }
.modal-content p { font-size: 12px; margin-bottom: 8px; }

#secure-code {
  display: block;
  width: 100%;
  padding: 12px;
  font-size: 18px;
  text-align: center;
  margin: 12px 0;
  border-radius: 8px;
  border: 1px solid #ccc;
  box-sizing: border-box;
}
#secure-submit {
  width: 100%;
  background: #4facfe;
  color: #fff;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}
#secure-submit:hover { background: #357ae8; }
#secure-submit:disabled {
  background: #aaa;
  cursor: not-allowed;
}

/* ====== ЛОАДЕР (крутящийся кружок) ====== */
.loader {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid #ffd700;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ====== ИКОНКИ УСПЕХ/ОШИБКА ====== */
.success-icon {
  color: lightgreen;
  font-size: 22px;
  display: inline-block;
  animation: pop 0.4s ease forwards;
}
.fail-icon {
  color: red;
  font-size: 22px;
  display: inline-block;
  animation: pop 0.4s ease forwards;
}
@keyframes pop {
  0% { transform: scale(0.6); opacity: 0; }
  80% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); }
}

/* ====== АНИМАЦИЯ ====== */
@keyframes popin {
  from { transform: scale(0.9); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
