@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg-dark: #0f172a;
  --bg-card: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --border: #334155;
  --success: #10b981;
  --danger: #ef4444;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.checkout-header {
  padding: 2rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.checkout-header img {
  height: 40px;
}

.checkout-container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2rem;
  flex: 1;
}

/* Order Summary */
.summary-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 2rem;
  border: 1px solid var(--border);
  height: fit-content;
}

.summary-card h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.plan-details {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}

.plan-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.plan-price {
  font-size: 2.5rem;
  font-weight: 700;
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.plan-price span {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 400;
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.25rem;
  font-weight: 600;
}

/* Payment Section */
.payment-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.tabs {
  display: flex;
  gap: 1rem;
  background: var(--bg-card);
  padding: 0.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.tab-btn {
  flex: 1;
  padding: 1rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.tab-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.tab-content {
  display: none;
  animation: fadeIn 0.4s ease;
}

.tab-content.active {
  display: block;
}

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

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-dark);
  border: 1px solid var(--border);
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-muted);
  transition: .4s;
}

input:checked + .slider {
  background-color: var(--primary);
  border-color: var(--primary);
}

input:checked + .slider:before {
  background-color: white;
  transform: translateX(22px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.btn-submit {
  width: 100%;
  padding: 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-submit:hover {
  background: var(--primary-hover);
}

/* Dynamic Credit Card */
.card-container {
  perspective: 1000px;
  width: 350px;
  height: 220px;
  margin: 0 auto 2rem;
}

.credit-card {
  width: 100%;
  height: 100%;
  position: relative;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.credit-card.flipped {
  transform: rotateY(180deg);
}

.card-front, .card-back {
  width: 100%;
  height: 100%;
  position: absolute;
  backface-visibility: hidden;
  border-radius: 16px;
  padding: 1.5rem;
  background: linear-gradient(135deg, #475569 0%, #1e293b 100%);
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
}

/* Brand backgrounds */
.credit-card.visa .card-front, .credit-card.visa .card-back {
  background: linear-gradient(135deg, #1a1f71 0%, #0d114a 100%);
}

.credit-card.mastercard .card-front, .credit-card.mastercard .card-back {
  background: linear-gradient(135deg, #eb001b 0%, #f79e1b 100%);
}

.card-back {
  transform: rotateY(180deg);
}

.card-logo {
  height: 40px;
  text-align: right;
  font-size: 1.5rem;
  font-weight: 800;
  font-style: italic;
  display: flex;
  justify-content: flex-end;
}

.card-chip {
  width: 50px;
  height: 40px;
  background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
  border-radius: 6px;
  margin-bottom: 1rem;
}

.card-number {
  font-size: 1.5rem;
  letter-spacing: 2px;
  font-family: monospace;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
  margin-bottom: 1rem;
}

.card-details {
  display: flex;
  justify-content: space-between;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.card-holder, .card-expires {
  display: flex;
  flex-direction: column;
}

.card-holder span, .card-expires span {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 0.2rem;
}

.card-stripe {
  height: 40px;
  background: #000;
  margin: 1rem -1.5rem;
}

.card-cvv-box {
  background: #fff;
  color: #000;
  text-align: right;
  padding: 0.5rem;
  border-radius: 4px;
  font-family: monospace;
  font-size: 1.2rem;
  margin-top: 1rem;
}

/* PIX Container */
.pix-container {
  text-align: center;
  padding: 2rem;
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border);
}

.pix-qr {
  width: 200px;
  height: 200px;
  background: #fff;
  margin: 0 auto 1.5rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pix-copy {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.pix-input {
  flex: 1;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.5);
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .checkout-container {
    grid-template-columns: 1fr;
  }
  
  .card-container {
    width: 100%;
    max-width: 350px;
  }
}
