:root {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-input: #f1f5f9;
  --border-color: #e2e8f0;
  --border-focus: #10b981;
  --border-error: #ef4444;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --accent-green: #10b981;
  --accent-green-hover: #059669;
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-lg: 24px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 10px 30px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  -webkit-tap-highlight-color: transparent;
}

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

.hidden {
  display: none !important;
}

/* Navbar */
.navbar {
  width: 100%;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 49px;
  height: 49px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Main Content Wrapper */
.main-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.container {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

/* Page Views */
.page-view {
  width: 100%;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.page-view.hidden {
  display: none !important;
  opacity: 0;
  transform: translateY(12px);
}

.page-view.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Landing View */
.hero-content {
  text-align: center;
}

.section-tag {
  display: inline-block;
  color: var(--accent-green);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 16px;
}

.hero-title {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.8px;
  margin-bottom: 12px;
  color: var(--text-primary);
}

@media (min-width: 640px) {
  .hero-title {
    font-size: 42px;
  }
}

.hero-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 28px;
}

/* Fee Summary Card */
.fee-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: left;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.fee-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.fee-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.fee-status {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}

.fee-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fee-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-secondary);
}

.fee-row .amount {
  color: var(--text-primary);
  font-weight: 600;
}

.fee-divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 4px 0;
}

.fee-row.total {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.total-amount {
  font-size: 20px;
  color: var(--accent-green);
  font-weight: 800;
}

/* CTA Button */
.cta-button {
  width: 100%;
  height: 54px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cta-button:hover {
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

.cta-button:active {
  transform: translateY(1px);
}

/* Payment View */
.back-link {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  padding: 6px 0;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--text-primary);
}

.payment-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
}

.payment-card-header {
  margin-bottom: 24px;
}

.payment-card-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.payment-card-header p {
  font-size: 14px;
  color: var(--text-secondary);
}

.payment-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  z-index: 2;
}

/* Floating Label Styling */
.floating-group .input-wrapper {
  position: relative;
}

.floating-group input {
  width: 100%;
  height: 58px;
  background-color: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px 16px 6px 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#cardNumber {
  padding-left: 46px;
  padding-right: 50px;
}

.floating-group input:focus {
  border-color: var(--border-focus);
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
}

.floating-label {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 3;
}

.floating-label.with-icon {
  left: 46px;
}

/* Floating Animation State */
.floating-group input:focus~.floating-label,
.floating-group input:not(:placeholder-shown)~.floating-label {
  top: 13px;
  transform: translateY(0);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-green);
}

.floating-group.has-error input {
  border-color: var(--border-error) !important;
  background-color: #fef2f2;
}

.floating-group.has-error input:focus~.floating-label,
.floating-group.has-error input:not(:placeholder-shown)~.floating-label {
  color: var(--border-error);
}

.card-brand-badge {
  position: absolute;
  right: 12px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 6px;
  background: #e2e8f0;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
}

.card-brand-badge.icon-mode {
  background: transparent !important;
  padding: 0 !important;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.error-msg {
  font-size: 12px;
  color: var(--border-error);
  font-weight: 600;
  display: none;
}

.form-group.has-error .error-msg {
  display: block;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Vector Card Networks Bar */
.card-networks-bar {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  padding: 8px 0;
}

.network-badge-icon {
  opacity: 0.6;
  transition: opacity 0.2s ease, transform 0.2s ease;
  cursor: pointer;
}

.network-badge-icon.active {
  opacity: 1;
  transform: scale(1.1);
}

/* Notice Box */
.notice-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.notice-box svg {
  color: #16a34a;
  flex-shrink: 0;
  margin-top: 2px;
}

.notice-box p {
  font-size: 12px;
  color: #15803d;
  line-height: 1.4;
}

/* Submit Button */
.submit-btn {
  width: 100%;
  height: 52px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.25);
  transition: all 0.2s ease;
}

.submit-btn:hover {
  background: linear-gradient(135deg, #059669, #047857);
}

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.8s linear infinite;
}

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

/* Technical Error View */
.technical-error-container {
  max-width: 440px;
  margin: 0 auto;
  padding: 20px 0;
}

.technical-error-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px 28px;
  text-align: center;
  box-shadow: var(--shadow-card);
  animation: popIn 0.35s ease;
}

.gray-wrench-box {
  width: 80px;
  height: 80px;
  background-color: #f1f5f9;
  color: #64748b;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
  border: 1px solid #e2e8f0;
}

.technical-error-card h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.error-description {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.tech-code-box {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  font-family: monospace;
}