:root {
    --bg-color: #0b0d14;
    --card-bg: #151824;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --border: #23273e;
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --accent: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
    position: relative;
}

/* Subtle background glowing effect */
body::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: var(--primary);
    filter: blur(150px);
    opacity: 0.15;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
}

.checkout-wrapper {
    display: flex;
    width: 100%;
    max-width: 900px;
    background: var(--card-bg);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    overflow: hidden;
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.checkout-container {
    display: flex;
    width: 100%;
}

.order-summary {
    flex: 1;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.05), rgba(0, 0, 0, 0));
    padding: 3rem;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.product-info h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    background: linear-gradient(to right, #fff, #a5b4fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.product-info .desc {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.price-container {
    margin-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.price-container .label {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.price-container .price {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
}

.card-visualizer {
    margin-top: 4rem;
    display: flex;
    justify-content: center;
    perspective: 1000px;
    margin-bottom: 3rem;
}

/* ============================================== */
/* user provided .flip-card CSS EXACTLY AS GIVEN  */
/* ============================================== */

.flip-card {
  background-color: transparent;
  width: 240px;
  height: 154px;
  perspective: 1000px;
  color: white;
}

.heading_8264 {
  position: absolute;
  letter-spacing: .2em;
  font-size: 0.5em;
  top: 2em;
  left: 18.6em;
}

.logo {
  position: absolute;
  top: 6.8em;
  left: 11.7em;
}

.chip {
  position: absolute;
  top: 2.3em;
  left: 1.5em;
}

.contactless {
  position: absolute;
  top: 3.5em;
  left: 12.4em;
}

.number {
  position: absolute;
  font-weight: bold;
  font-size: .6em;
  top: 8.3em;
  left: 1.6em;
}

.valid_thru {
  position: absolute;
  font-weight: bold;
  top: 635.8em; /* Keeping exact user value */
  font-size: .01em;
  left: 140.3em;
}

.date_8264 {
  position: absolute;
  font-weight: bold;
  font-size: 0.5em;
  top: 13.6em;
  left: 3.2em;
}

.name {
  position: absolute;
  font-weight: bold;
  font-size: 0.5em;
  top: 16.1em;
  left: 2em;
}

.strip {
  position: absolute;
  background-color: black;
  width: 15em;
  height: 1.5em;
  top: 2.4em;
  background: repeating-linear-gradient(
    45deg,
    #303030,
    #303030 10px,
    #202020 10px,
    #202020 20px
  );
}

.mstrip {
  position: absolute;
  background-color: rgb(255, 255, 255);
  width: 8em;
  height: 0.8em;
  top: 5em;
  left: .8em;
  border-radius: 2.5px;
}

.sstrip {
  position: absolute;
  background-color: rgb(255, 255, 255);
  width: 4.1em;
  height: 0.8em;
  top: 5em;
  left: 10em;
  border-radius: 2.5px;
}

.code {
  font-weight: bold;
  text-align: center;
  margin: .2em;
  color: black;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

/* Add custom JS hook for flipping without breaking css */
.flip-card.is-flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
  box-shadow: 0 8px 14px 0 rgba(0,0,0,0.2);
  position: absolute;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 1rem;
}

.flip-card-front {
  box-shadow: rgba(0, 0, 0, 0.4) 0px 2px 2px, rgba(0, 0, 0, 0.3) 0px 7px 13px -3px, rgba(0, 0, 0, 0.2) 0px -1px 0px inset;
  background-color: #171717;
}

.flip-card-back {
  box-shadow: rgba(0, 0, 0, 0.4) 0px 2px 2px, rgba(0, 0, 0, 0.3) 0px 7px 13px -3px, rgba(0, 0, 0, 0.2) 0px -1px 0px inset;
  background-color: #171717;
  transform: rotateY(180deg);
}
/* ============================================== */

/* Extra tweaks so user text styling looks good */
.heading_8264 {
    font-family: Arial, Helvetica, sans-serif;
    font-style: italic;
}
.name {
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 16em;
}

.secure-badge {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 500;
}

.checkout-form-container {
    flex: 1.2;
    padding: 3rem;
    background: rgba(255, 255, 255, 0.01);
}

.checkout-form-container h2 {
    font-size: 1.4rem;
    margin-bottom: 2rem;
    font-weight: 600;
}

.form-section {
    margin-bottom: 2rem;
}

.form-section h3 {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.row {
    display: flex;
    gap: 1rem;
}

.input-group {
    margin-bottom: 1.2rem;
    flex: 1;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: var(--text-main);
    font-size: 0.95rem;
    transition: all 0.2s ease;
    outline: none;
}

.input-group input:hover {
    border-color: rgba(255,255,255,0.2);
}

.input-group input:focus {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.input-group input::placeholder {
    color: #4b5563;
}

.submit-btn {
    width: 100%;
    padding: 1.1rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    margin-top: 1rem;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.5);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.3s;
    opacity: 0;
}

.submit-btn:hover::after {
    opacity: 1;
    transform: rotate(45deg) translate(50%, -50%);
}

.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    position: absolute;
    animation: spin 1s linear infinite;
}

.submit-btn.loading span {
    opacity: 0;
}

.submit-btn.loading .spinner {
    display: block;
}

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

.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    z-index: 1000;
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 24px;
    text-align: center;
    border: 1px solid var(--border);
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal.active .modal-content {
    transform: translateY(0) scale(1);
}

.success-icon {
    margin-bottom: 1.5rem;
}

.modal-content h2 {
    margin-bottom: 0.5rem;
    color: var(--text-main);
    font-size: 1.6rem;
}

.modal-content p {
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .checkout-container {
        flex-direction: column;
    }
    .order-summary, .checkout-form-container {
        padding: 2rem;
    }
    .order-summary {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .card-visualizer {
        margin-top: 2rem;
        margin-bottom: 1rem;
    }
}
