/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --orange: #FF6B00;
  --orange-light: #FF8C33;
  --bg: #0A0A0B;
  --bg-2: #111114;
  --bg-card: #1C1C21;
  --bg-3: #18181C;
  --border: rgba(255,255,255,0.08);
  --text: #F5F5F7;
  --text-muted: #8E8E9A;
  --white: #fff;
  --error: #ff4d4d;
  --radius: 14px;
  --transition: 0.2s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ===== HEADER ===== */
.co-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10,10,11,0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 56px;
  flex-shrink: 0;
}

.co-logo {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 18px;
  font-weight: 800;
  color: var(--white);
  text-decoration: none;
}
.co-logo svg { width: 18px; height: 18px; color: var(--orange); }

.co-secure {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}
.co-secure svg { width: 13px; height: 13px; }

/* ===== MAIN ===== */
.co-main {
  flex: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ===== PACKAGE CARD ===== */
.co-package {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.co-pkg-platform {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 4px;
}
.co-pkg-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
}
.co-pkg-price {
  font-size: 28px;
  font-weight: 900;
  color: var(--orange);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

/* ===== STEPS ===== */
.co-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: opacity 0.2s ease;
}
.co-step--hidden { display: none; }

.co-step-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.co-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.co-back {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}
.co-back:hover { color: var(--white); border-color: rgba(255,255,255,0.2); }
.co-back svg { width: 14px; height: 14px; }

/* ===== FORM FIELDS ===== */
form { display: flex; flex-direction: column; gap: 16px; }

.co-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.co-field label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.co-field input {
  width: 100%;
  background: var(--bg-3);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 15px 16px;
  font-size: 16px; /* 16px prevents iOS zoom */
  color: var(--white);
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}
.co-field input::placeholder { color: var(--text-muted); }
.co-field input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255,107,0,0.12);
}
.co-field input.co-invalid {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(255,77,77,0.12);
}

.co-username-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-3);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.co-username-wrap:focus-within {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255,107,0,0.12);
}
.co-at {
  padding: 0 2px 0 16px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-muted);
  user-select: none;
  line-height: 1;
}
.co-username-wrap input {
  flex: 1;
  background: none;
  border: none;
  padding: 15px 16px 15px 4px;
  font-size: 16px;
  color: var(--white);
  font-family: inherit;
  outline: none;
  box-shadow: none !important;
}

.co-field-hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== BUTTONS ===== */
.co-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  padding: 17px 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.co-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.co-btn--primary {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 4px 20px rgba(255,107,0,0.35);
}
.co-btn--primary:hover { background: var(--orange-light); box-shadow: 0 4px 28px rgba(255,107,0,0.5); }
.co-btn--primary:active { transform: scale(0.98); }
.co-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ===== STRIPE ELEMENT ===== */
#payment-element {
  margin-bottom: 20px;
}

/* Override Stripe iframe border-radius */
.co-step #payment-element .p-Input { border-radius: 10px !important; }

/* ===== SUMMARY ROW ===== */
.co-summary-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-3);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.co-summary-row span:not(:nth-child(2)) { color: var(--text); font-weight: 500; }
.co-summary-row span:nth-child(2) { opacity: 0.3; }

/* ===== LOADING SPINNER ===== */
.co-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-muted);
  padding: 8px 0;
}
.co-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.co-hidden { display: none !important; }

/* ===== ERROR ===== */
.co-error {
  background: rgba(255,77,77,0.08);
  border: 1px solid rgba(255,77,77,0.25);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  color: #ff7070;
  margin-bottom: 16px;
}

/* ===== TRUST FOOTER ===== */
.co-trust {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 4px 0 8px;
}
.co-trust span {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.co-trust svg { width: 13px; height: 13px; color: var(--orange); }

/* ===== DESKTOP — center card on wide screens ===== */
@media (min-width: 520px) {
  .co-main { padding: 32px 24px 48px; }
  .co-step { padding: 28px 24px; }
}
