:root {
  --card-bg: rgba(16, 19, 28, 0.75);
  --card-border: rgba(255, 184, 76, 0.5);
  --text-light: #f7f9ff;
  --text-muted: #d7d9e3;
  --accent: #ffb84c;
  --accent-dark: #d78f21;
  --input-bg: rgba(5, 8, 14, 0.45);
  --focus-ring: rgba(255, 184, 76, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  height: 100vh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-light);
  background: url("../img/landscape_bg.jpg") center center / cover no-repeat fixed;
  position: relative;
  display: grid;
  place-items: center;
  padding: 0;
  overflow-y: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(160deg, rgba(0, 0, 0, 0.25), rgba(1, 2, 6, 0.7));
  z-index: -1;
}

.page-shell {
  width: 100%;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem 4.25rem;
}

.logo {
  position: fixed;
  top: 1rem;
  left: 1rem;
  width: clamp(120px, 13vw, 170px);
  height: auto;
  z-index: 10;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.45));
}

.redeem-card {
  width: min(92vw, 440px);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(6px);
  border-radius: 18px;
  padding: 1.4rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(22px) scale(0.98);
  animation: cardEnter 0.6s cubic-bezier(0.2, 0.75, 0.2, 1) 0.08s forwards;
}

.redeem-card h1 {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-bottom: 0.45rem;
}

.redeem-card p {
  color: rgba(189, 196, 214, 0.72);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.form-group {
  margin-bottom: 0.95rem;
  opacity: 0;
  transform: translateY(12px);
  animation: fieldEnter 0.45s ease forwards;
}

.form-group:nth-of-type(1) {
  animation-delay: 0.32s;
}

.form-group:nth-of-type(2) {
  animation-delay: 0.44s;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: var(--input-bg);
  color: var(--text-light);
  border-radius: 10px;
  padding: 0.72rem 0.82rem;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input::placeholder {
  color: rgba(232, 235, 247, 0.6);
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--focus-ring);
}

.redeem-btn {
  width: 100%;
  border: none;
  border-radius: 11px;
  padding: 0.78rem 0.9rem;
  margin-top: 0.2rem;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #111;
  background: linear-gradient(180deg, #ffc665, #ef9f22);
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.2s ease;
  opacity: 0;
  transform: translateY(12px);
  animation: fieldEnter 0.45s ease 0.56s forwards;
}

.redeem-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.redeem-btn:active {
  transform: translateY(0);
  background: linear-gradient(180deg, #f8b54f, #d88b18);
}

.profile-loading-popup,
.confirm-popup,
.status-popup {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(3px);
  padding: 1rem;
}

.profile-loading-popup {
  z-index: 38;
}

.confirm-popup {
  z-index: 39;
}

.status-popup {
  z-index: 40;
}

.profile-loading-popup.show,
.confirm-popup.show,
.status-popup.show {
  display: grid;
  animation: popupFadeIn 0.2s ease;
}

.profile-loading-card,
.confirm-card,
.popup-card {
  width: min(92vw, 380px);
  border: 1px solid rgba(255, 184, 76, 0.55);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(12, 16, 24, 0.95), rgba(8, 10, 15, 0.97));
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.55);
  padding: 1.2rem 1rem 1rem;
}

.confirm-card {
  padding: 1.5rem 1.2rem 1.15rem;
}

.profile-loading-card {
  text-align: center;
}

.profile-loading-title {
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-bottom: 0.35rem;
}

.profile-loading-text {
  font-size: 0.9rem;
  color: rgba(189, 196, 214, 0.72);
}

.confirm-title {
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-bottom: 0.75rem;
  text-align: center;
  line-height: 1.2;
}

.confirm-text {
  font-size: 0.9rem;
  color: rgba(189, 196, 214, 0.72);
  text-align: center;
  margin-bottom: 0.9rem;
}

.confirm-note {
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(189, 196, 214, 0.72);
  text-align: center;
  margin: 0 0 0.9rem;
}

.confirm-grid {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(6, 9, 14, 0.45);
  overflow: hidden;
  margin-bottom: 0.95rem;
}

.confirm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.72rem 0.78rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.confirm-row:last-child {
  border-bottom: none;
}

.confirm-row span {
  font-size: 0.84rem;
  color: rgba(189, 196, 214, 0.78);
}

.confirm-row strong {
  font-size: 0.92rem;
  font-weight: 700;
  color: #f4f7ff;
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.62rem;
}

.confirm-btn {
  border: none;
  border-radius: 10px;
  padding: 0.68rem 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
}

.confirm-cancel {
  color: #f4f7ff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.confirm-proceed {
  color: #111;
  background: linear-gradient(180deg, #ffc665, #ef9f22);
}

.popup-card {
  width: min(90vw, 360px);
  text-align: center;
  padding-top: 1.35rem;
}

.popup-icon {
  width: 70px;
  height: 70px;
  object-fit: contain;
  margin: 0 auto 0.8rem;
  display: none;
}

.popup-icon.show {
  display: block;
}

.popup-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin: 0 0 0.7rem;
  min-height: 1.38rem;
}

.popup-text {
  font-size: 0.93rem;
  color: rgba(189, 196, 214, 0.72);
  min-height: 1.2rem;
  margin: 0 0 0.9rem;
}

.popup-close {
  border: none;
  background: linear-gradient(180deg, #ffc665, #ef9f22);
  color: #111;
  border-radius: 10px;
  padding: 0.6rem 1rem;
  min-width: 120px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  display: none;
}

.popup-close.show {
  display: inline-block;
}

.loading-wrap {
  width: 88px;
  height: 88px;
  margin: 0 auto 0.75rem;
  display: none;
  place-items: center;
  position: relative;
}

.loading-wrap.show {
  display: grid;
}

.copyright-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  text-align: center;
  padding: 0.7rem 1rem;
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  color: rgba(240, 244, 255, 0.9);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.62));
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}

.loading-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid transparent;
  border-top-color: #ffca71;
  border-right-color: #ff9e2f;
  animation: spin 0.85s linear infinite;
}

.loading-core {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 184, 76, 0.45);
  background: radial-gradient(circle, rgba(255, 184, 76, 0.32), rgba(255, 184, 76, 0.08));
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

@keyframes popupFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes cardEnter {
  0% {
    opacity: 0;
    transform: translateY(22px) scale(0.98);
  }
  60% {
    opacity: 1;
    transform: translateY(-2px) scale(1);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fieldEnter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  body {
    background: url("../img/portrait_bg.jpg") center center / cover no-repeat fixed;
    place-items: center;
  }

  .logo {
    top: 0.9rem;
    left: 0.9rem;
    width: clamp(100px, 32vw, 150px);
  }

  .page-shell {
    min-height: 100vh;
    padding: 1.5rem 1rem 4.4rem;
  }

  .redeem-card {
    padding: 1.1rem;
    border-radius: 15px;
    margin-bottom: 0;
  }

  .redeem-card h1 {
    font-size: 1.15rem;
  }

  .profile-loading-card,
  .confirm-card,
  .popup-card {
    padding: 1rem 0.88rem 0.9rem;
  }

  .confirm-card {
    padding: 1.25rem 1rem 1rem;
  }

  .confirm-actions {
    gap: 0.5rem;
  }

  .copyright-bar {
    font-size: 0.73rem;
    padding: 0.62rem 0.7rem;
  }
}

@media (max-width: 380px) {
  .redeem-card {
    width: 94vw;
  }

  input,
  .redeem-btn {
    font-size: 0.92rem;
  }

  .profile-loading-title,
  .confirm-title,
  .popup-title {
    font-size: 1.05rem;
  }

  .confirm-row strong {
    font-size: 0.86rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .redeem-card,
  .form-group,
  .redeem-btn,
  .profile-loading-popup.show,
  .confirm-popup.show,
  .status-popup.show,
  .loading-ring,
  .loading-core {
    animation: none !important;
    transition: none !important;
    opacity: 1;
    transform: none;
  }
}
