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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: #F8FAFC;
  color: #0F172A;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* Layout */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  background: white;
  padding: 20px;
  border-bottom: 1px solid #E2E8F0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.brand {
  font-weight: 900;
  font-size: 24px;
  color: #2563EB;
  letter-spacing: -1px;
}

.main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

/* Card */
.payment-card {
  width: 100%;
  max-width: 480px;
  background: white;
  border-radius: 28px;
  padding: 40px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
  position: relative;
}

/* Loading State */
.loading-state {
  padding: 60px 0;
  text-align: center;
}

.spinner {
  width: 56px;
  height: 56px;
  border: 5px solid #F1F5F9;
  border-top-color: #2563EB;
  border-radius: 50%;
  margin: 0 auto 24px;
  animation: spin 0.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

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

.loading-state p {
  font-weight: 700;
  font-size: 18px;
  color: #1E293B;
  margin-bottom: 8px;
}

.loading-state span {
  font-size: 14px;
  color: #64748B;
  font-weight: 500;
}

/* Error State */
.error-state {
  text-align: center;
  padding: 20px 0;
}

.icon-error {
  width: 64px;
  height: 64px;
  background: #FEF2F2;
  color: #EF4444;
  font-size: 32px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.error-state p {
  color: #1E293B;
  font-weight: 600;
  margin-bottom: 32px;
  font-size: 16px;
  line-height: 1.6;
}

.retry-btn {
  background: #0F172A;
  color: white;
  border: none;
  padding: 16px 40px;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.retry-btn:hover {
  background: #1E293B;
  transform: scale(1.02);
}

/* Payment UI */
.secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #F0FDF4;
  color: #16A34A;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.title {
  font-size: 32px;
  font-weight: 800;
  color: #0F172A;
  margin-bottom: 12px;
  line-height: 1.1;
  letter-spacing: -1px;
}

.subtitle {
  font-size: 16px;
  color: #64748B;
  margin-bottom: 40px;
  line-height: 1.5;
}

.plan-hero {
  background: #F8FAFC;
  border: 2px solid #F1F5F9;
  border-radius: 24px;
  padding: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.plan-info .label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #94A3B8;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.plan-name {
  font-size: 20px;
  font-weight: 800;
  color: #1E293B;
}

.plan-price {
  font-size: 28px;
  font-weight: 900;
  color: #2563EB;
}

.details-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #F1F5F9;
  font-size: 14px;
  color: #475569;
}

.details-row:last-of-type {
  border-bottom: none;
  margin-bottom: 40px;
}

.details-row strong {
  color: #1E293B;
}

/* Primary Button */
.pay-btn {
  width: 100%;
  height: 64px;
  background: #2563EB;
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 24px -8px rgba(37, 99, 235, 0.4);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pay-btn:hover:not(:disabled) {
  background: #1D4ED8;
  transform: translateY(-2px);
  box-shadow: 0 16px 28px -8px rgba(37, 99, 235, 0.5);
}

.pay-btn:disabled {
  background: #CBD5E1;
  cursor: not-allowed;
  box-shadow: none;
}

/* Success State */
.success-state {
  text-align: center;
}

.success-check {
  width: 88px;
  height: 88px;
  background: #22C55E;
  color: white;
  border-radius: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 32px;
  box-shadow: 0 15px 30px rgba(34, 197, 94, 0.25);
  transform: rotate(-5deg);
}

.success-check svg {
  width: 44px;
  height: 44px;
}

.success-info {
  background: #F8FAFC;
  padding: 24px;
  border-radius: 20px;
  margin-bottom: 32px;
  border: 1px solid #E2E8F0;
}

.success-info p {
  font-size: 15px;
  color: #475569;
  line-height: 1.6;
}

.success-info strong {
  color: #1E293B;
  display: block;
  margin-bottom: 12px;
  font-size: 17px;
}

.return-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 60px;
  background: #1E293B;
  color: white;
  text-decoration: none;
  border-radius: 18px;
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 24px;
}

.timer-text {
  font-size: 13px;
  color: #94A3B8;
  font-weight: 500;
}

.timer-text span {
  color: #F97316;
  font-weight: 700;
}

@media (max-width: 500px) {
  .main { padding: 20px 0; }
  .payment-card { 
    border-radius: 0; 
    box-shadow: none;
    padding: 30px 20px;
  }
}
