/* 
   Checkout Premium Styling - SME360 
   High-Trust, Conversion-Optimized UI
*/

:root {
  --checkout-bg: #0B0F1A;
  --checkout-accent: #00F5FF;
  --checkout-purple: #7B61FF;
  --checkout-glass: rgba(255, 255, 255, 0.03);
  --checkout-border: rgba(255, 255, 255, 0.08);
}

body.checkout-premium {
  background: 
    radial-gradient(circle at 20% 20%, rgba(0, 245, 255, 0.08), transparent),
    radial-gradient(circle at 80% 80%, rgba(123, 97, 255, 0.08), transparent),
    var(--checkout-bg);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  color: #fff;
}

/* Background Grid Overlay */
body.checkout-premium::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(0, 245, 255, 0.03) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(0, 245, 255, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: -1;
}

/* Floating Particles (Simulated with pseudo-elements or JS, here we use a container) */
#floatingParticles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--checkout-accent);
  border-radius: 50%;
  opacity: 0.3;
  animation: floatParticle 10s infinite linear;
}

@keyframes floatParticle {
  0% { transform: translate(0, 0); opacity: 0; }
  20% { opacity: 0.4; }
  80% { opacity: 0.4; }
  100% { transform: translate(var(--dx), var(--dy)); opacity: 0; }
}

/* Main Container Wrap */
.premium-checkout-wrap {
  position: relative;
  z-index: 10;
  opacity: 0;
  transform: translateY(20px);
  animation: slideUpFade 0.8s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

@keyframes slideUpFade {
  to { opacity: 1; transform: translateY(0); }
}

.glass-container {
  background: var(--checkout-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1px solid var(--checkout-border);
  padding: 35px;
  box-shadow: 0 0 40px rgba(0, 245, 255, 0.05);
  margin-bottom: 30px;
}

.checkout-card-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
}

.secure-lock-icon {
  font-size: 1.8rem;
  color: var(--checkout-accent);
  animation: lockBounce 2s infinite ease-in-out;
}

@keyframes lockBounce {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 5px var(--checkout-accent)); }
  50% { transform: scale(1.1); filter: drop-shadow(0 0 15px var(--checkout-accent)); }
}

.glow-text {
  text-shadow: 0 0 10px rgba(0, 245, 255, 0.5);
}

/* Payment Methods Grid -> Tabs */
.payment-grid {
  display: flex !important;
  gap: 12px !important;
  padding: 5px;
}

.pay-option {
  flex: 1;
}

.pay-card {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #94a3b8 !important;
  transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1) !important;
  opacity: 0.7;
}

.pay-option input:checked + .pay-card {
  background: linear-gradient(135deg, rgba(0, 245, 255, 0.1), rgba(123, 97, 255, 0.1)) !important;
  border-color: var(--checkout-accent) !important;
  color: #fff !important;
  opacity: 1 !important;
  transform: scale(1.05) translateY(-5px) !important;
  box-shadow: 0 10px 20px rgba(0, 245, 255, 0.1);
}

.pay-card:hover {
  opacity: 1;
  border-color: rgba(0, 245, 255, 0.4) !important;
  box-shadow: 0 0 15px rgba(0, 245, 255, 0.1);
}

/* Premium Inputs */
.form-group {
    position: relative;
    margin-bottom: 25px;
}

.form-label {
    color: #94a3b8 !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    margin-bottom: 8px !important;
    display: block !important;
    transition: 0.3s ease;
}

.form-control {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    padding: 14px 18px !important;
    color: #fff !important;
    transition: all 0.3s ease !important;
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--checkout-accent) !important;
    box-shadow: 0 0 15px rgba(0, 245, 255, 0.2) !important;
    outline: none !important;
}

/* Floating Label Logic via JS/CSS */
.form-group.focused .form-label {
    color: var(--checkout-accent) !important;
    transform: translateY(-2px);
}

/* Card Preview Visual */
.card-preview-container {
    perspective: 1000px;
    margin-bottom: 30px;
}

.card-visual {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-radius: 20px;
    padding: 25px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
}

.card-visual-chip {
    width: 45px;
    height: 35px;
    background: linear-gradient(45deg, #facc15, #eab308);
    border-radius: 6px;
    margin-bottom: 30px;
}

.card-visual-number {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.4rem;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.card-visual-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.card-visual-label {
    font-size: 0.65rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-visual-value {
    font-size: 0.9rem;
    font-weight: 700;
}

/* Order Summary Sticky */
.summary-panel {
    position: sticky;
    top: 100px;
}

.summary-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
}

.total-price-pulse {
    color: var(--checkout-accent);
    font-size: 2rem;
    font-weight: 900;
    animation: pricePulse 3s infinite ease-in-out;
}

@keyframes pricePulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.03); filter: brightness(1.2); }
}

/* Main CTA Button */
.btn-primary-premium {
  background: linear-gradient(135deg, var(--checkout-accent), var(--checkout-purple)) !important;
  color: #000 !important;
  border: none !important;
  padding: 20px 40px !important;
  border-radius: 50px !important;
  font-weight: 900 !important;
  font-size: 1.1rem !important;
  letter-spacing: 1px !important;
  text-transform: uppercase !important;
  transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1) !important;
  box-shadow: 0 10px 20px rgba(0, 245, 255, 0.2) !important;
  width: 100%;
}

.btn-primary-premium:hover {
  transform: translateY(-5px) scale(1.02) !important;
  box-shadow: 0 20px 40px rgba(0, 245, 255, 0.4) !important;
}

.btn-primary-premium:active {
  transform: translateY(0) scale(0.98) !important;
}

/* Processing Overlay */
.processing-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 15, 26, 0.95);
    z-index: 10000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.processing-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(0, 245, 255, 0.1);
    border-top-color: var(--checkout-accent);
    border-radius: 50%;
    animation: spin 1s infinite linear;
    margin-bottom: 25px;
}

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

/* Escrow Visual Boost */
.escrow-boost {
    background: rgba(16, 185, 129, 0.05) !important;
    border: 1px solid rgba(16, 185, 129, 0.2) !important;
    border-left: 5px solid #10b981 !important;
    padding: 20px !important;
    border-radius: 16px !important;
    transition: 0.3s;
}

.escrow-boost:hover {
    background: rgba(16, 185, 129, 0.1) !important;
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.1);
}

.pulse-shield {
    animation: shieldPulse 2s infinite;
    display: inline-block;
}

@keyframes shieldPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.8; }
}

.escrow-line {
    height: 2px;
    width: 60px;
    background: #10b981;
    margin-top: 5px;
    border-radius: 2px;
    animation: lineExtend 2s infinite ease-in-out;
}

@keyframes lineExtend {
  0%, 100% { width: 30px; }
  50% { width: 80px; }
}

/* Shake Animation for Errors */
.shake-error {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

.invalid-glow {
    border-color: #ef4444 !important;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.2) !important;
}

/* Multi-step Fade Transitions */
.pay-field-group {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.pay-field-group.d-none {
    display: none;
    opacity: 0;
    transform: translateY(10px);
}
