/* --- CSS Reset & Global Styles --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  }
  
  body {
    background-color: #f8fafc;
    color: #0f172a;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* --- Layout Grid (Split View) --- */
  .checkout-container {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    width: 100%;
    max-width: 1000px;
    min-height: 600px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    overflow: hidden;
    margin: 20px;
    border: 1px solid #e2e8f0;
  }
  
  /* --- Left Panel: Order Summary --- */
  .summary-panel {
    background-color: #0f172a;
    color: #ffffff;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  
  .brand-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
  }
  
  .brand-icon {
    font-size: 1.4rem;
  }
  
  .product-card {
    margin-top: 20px;
  }
  
  .product-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    color: #38bdf8;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    margin-bottom: 12px;
  }
  
  .product-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
  }
  
  .product-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
  }
  
  .product-price .currency {
    font-size: 1.25rem;
    font-weight: 600;
    color: #94a3b8;
  }
  
  .product-price .amount {
    font-size: 2.5rem;
    font-weight: 700;
  }
  
  .product-price .period {
    color: #94a3b8;
    font-size: 0.9rem;
  }
  
  .product-graphic {
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    margin: 24px 0;
  }
  
  .graphic-content .server-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 8px;
  }
  
  .graphic-content p {
    color: #94a3b8;
    font-size: 0.85rem;
  }
  
  .order-breakdown {
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 0.9rem;
    color: #cbd5e1;
  }
  
  .breakdown-item {
    display: flex;
    justify-content: space-between;
  }
  
  .divider {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 4px 0;
  }
  
  .breakdown-item.total {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
  }
  
  /* --- Right Panel: Payment Form --- */
  .form-panel {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  
  .form-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: #0f172a;
  }
  
  /* Field Styles */
  .field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
  }
  
  .field-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
  }
  
  .field-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #0f172a;
    outline: none;
    transition: all 0.2s ease;
  }
  /* جعل اسم حامل البطاقة كابيتال تلقائياً */
  #client-name {
    text-transform: uppercase;
  }
  
  .field-group input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  }
  
  /* Invalid Input State */
  .field-group input.invalid {
    border-color: #ef4444;
    background-color: #fef2f2;
  }
  
  .field-error {
    font-size: 0.78rem;
    color: #ef4444;
    min-height: 16px;
  }
  
  /* Badge overlay inside input */
  .input-with-badge {
    position: relative;
    display: flex;
    align-items: center;
  }
  
  .badge-icon {
    position: absolute;
    right: 12px;
    font-size: 1.2rem;
    pointer-events: none;
  }
  
  /* Field Row (Flex 2 columns) */
  .field-row {
    display: flex;
    gap: 16px;
  }
  
  .field-row .field-group {
    flex: 1;
  }
  
  /* Alert Boxes */
  .alert-box {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 20px;
    line-height: 1.4;
  }
  
  .alert-box.error {
    background-color: #fef2f2;
    border: 1px solid #fca5a5;
    color: #b91c1c;
  }
  
  .alert-box.hidden {
    display: none;
  }
  
  /* Submit Button */
  .pay-button {
    width: 100%;
    padding: 14px;
    background-color: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
  }
  
  .pay-button:hover {
    background-color: #1d4ed8;
  }
  
  .pay-button:disabled {
    background-color: #94a3b8;
    cursor: not-allowed;
  }
  
  /* Loading Spinner */
  .btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
  }
  
  .btn-spinner.hidden {
    display: none;
  }
  
  @keyframes spin {
    to { transform: rotate(360deg); }
  }
  
  .security-note {
    text-align: center;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 16px;
  }
  
  /* Responsive Breakpoints (Mobile Friendly) */
  @media (max-width: 768px) {
    .checkout-container {
      grid-template-columns: 1fr;
      margin: 0;
      border-radius: 0;
      min-height: 100vh;
    }
  
    .summary-panel, .form-panel {
      padding: 24px;
    }
  }

  /* Inline SVG Enhancements */
.brand-header {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .graphic-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  
  .security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 16px;
  }
  
  .security-note svg {
    flex-shrink: 0;
  }