/* ============================================
   CHECKOUT PAGE STYLES
   Modern SaaS Payment UI
============================================ */

/* CSS Variables */
:root {
  --clr-navy: #0F1B2A;
  --clr-gold: #D4A95F;
  --clr-beige: #F8F4EE;
  --clr-white: #FFFFFF;
  --clr-gray-50: #F9FAFB;
  --clr-gray-100: #F3F4F6;
  --clr-gray-200: #E5E7EB;
  --clr-gray-300: #D1D5DB;
  --clr-gray-400: #9CA3AF;
  --clr-gray-500: #6B7280;
  --clr-gray-600: #4B5563;
  --clr-gray-700: #374151;
  --clr-gray-800: #1F2937;
  --clr-gray-900: #111827;
  --clr-error: #EF4444;
  --clr-success: #10B981;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background: var(--clr-gray-50);
  color: var(--clr-gray-900);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================
   HEADER
============================================ */
.checkout-header {
  background: var(--clr-white);
  border-bottom: 1px solid var(--clr-gray-200);
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.checkout-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--clr-navy);
  font-weight: 600;
  font-size: 18px;
  transition: opacity 0.2s;
}

.logo:hover {
  opacity: 0.8;
}

.secure-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--clr-gray-600);
  padding: 6px 12px;
  background: var(--clr-gray-100);
  border-radius: var(--radius-md);
}

.secure-badge svg {
  color: var(--clr-success);
}

/* ============================================
   MAIN LAYOUT
============================================ */
.checkout-main {
  padding: 48px 0 80px;
  min-height: calc(100vh - 200px);
}

.checkout-grid {
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 48px;
  align-items: start;
}

/* ============================================
   LEFT COLUMN - CUSTOMER FORM
============================================ */
.checkout-left {
  animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.section-card {
  background: var(--clr-white);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-md);
}

.section-header h1 {
  font-size: 32px;
  font-weight: 700;
  color: var(--clr-navy);
  margin-bottom: 8px;
}

.section-header p {
  font-size: 16px;
  color: var(--clr-gray-600);
  margin-bottom: 32px;
}

/* Order Summary */
.order-summary {
  background: var(--clr-gray-50);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 32px;
  border: 1px solid var(--clr-gray-200);
}

.summary-item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 16px;
  align-items: start;
}

.summary-icon {
  width: 40px;
  height: 40px;
  background: var(--clr-gold);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.summary-icon svg {
  color: var(--clr-white);
}

.summary-item h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--clr-navy);
  margin-bottom: 4px;
}

.summary-item p {
  font-size: 14px;
  color: var(--clr-gray-600);
}

.summary-price {
  font-size: 24px;
  font-weight: 700;
  color: var(--clr-navy);
}

/* Customer Form */
.form-section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--clr-navy);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--clr-gray-200);
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--clr-gray-700);
  margin-bottom: 8px;
}

.required {
  color: var(--clr-error);
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  font-family: var(--font-sans);
  border: 1px solid var(--clr-gray-300);
  border-radius: var(--radius-md);
  background: var(--clr-white);
  color: var(--clr-gray-900);
  transition: all 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--clr-gold);
  box-shadow: 0 0 0 3px rgba(212, 169, 95, 0.1);
}

.form-group input.error {
  border-color: var(--clr-error);
}

.form-group input.error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.error-message {
  display: block;
  font-size: 13px;
  color: var(--clr-error);
  margin-top: 6px;
  min-height: 18px;
}

/* Security Notice */
.security-notice {
  display: flex;
  align-items: start;
  gap: 10px;
  padding: 16px;
  background: var(--clr-gray-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--clr-gray-200);
  margin-top: 24px;
}

.security-notice svg {
  color: var(--clr-success);
  flex-shrink: 0;
  margin-top: 2px;
}

.security-notice span {
  font-size: 13px;
  color: var(--clr-gray-600);
  line-height: 1.5;
}

/* ============================================
   RIGHT COLUMN - PAYMENT SECTION
============================================ */
.checkout-right {
  position: sticky;
  top: 100px;
  animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.payment-card {
  background: var(--clr-white);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--clr-gray-200);
}

.payment-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--clr-navy);
  margin-bottom: 6px;
}

/* Payment Subtitle */
.payment-subtitle {
  font-size: 13px;
  color: var(--clr-gold);
  font-weight: 500;
  margin-bottom: 20px;
}

/* Express Checkout */
.express-checkout-wrapper {
  margin-bottom: 24px;
}

.express-checkout-wrapper:empty {
  display: none;
}

/* Divider */
.payment-divider {
  position: relative;
  text-align: center;
  margin: 24px 0;
}

.payment-divider::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--clr-gray-200);
}

.payment-divider span {
  position: relative;
  display: inline-block;
  padding: 0 16px;
  background: var(--clr-white);
  font-size: 13px;
  color: var(--clr-gray-500);
  font-weight: 500;
}

/* Stripe Card Element (individual elements) */
.stripe-card-element {
  padding: 12px 16px;
  border: 1px solid var(--clr-gray-300);
  border-radius: var(--radius-md);
  background: var(--clr-white);
  transition: all 0.2s;
}

.stripe-card-element:focus-within {
  border-color: var(--clr-gold);
  box-shadow: 0 0 0 3px rgba(212, 169, 95, 0.1);
}

.stripe-card-element.StripeElement--invalid {
  border-color: var(--clr-error);
}

/* Card Errors */
.card-error {
  font-size: 13px;
  color: var(--clr-error);
  margin-top: 4px;
  min-height: 16px;
}

/* Individual Stripe Field Groups */
.stripe-field-group {
  margin-bottom: 18px;
}

.stripe-field-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--clr-gray-700);
  margin-bottom: 6px;
}

/* Two-column row for Expiry + CVC */
.stripe-fields-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Pay Button */
.pay-button {
  width: 100%;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-sans);
  color: var(--clr-white);
  background: var(--clr-navy);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
}

.pay-button:hover:not(:disabled) {
  background: #1a2942;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.pay-button:active:not(:disabled) {
  transform: translateY(0);
}

.pay-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--clr-white);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.spinner.hidden,
.payment-message.hidden {
  display: none;
}

/* Payment Message */
.payment-message {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
}

.payment-message.success {
  background: #D1FAE5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.payment-message.error {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

/* Trust Badges */
.trust-badges {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--clr-gray-200);
}

.trust-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--clr-gray-500);
}

.payment-security-badge svg {
  color: #4caf50;
  flex-shrink: 0;
}

/* Guarantee Notice */
.guarantee-notice {
  margin-top: 24px;
  padding: 16px;
  background: var(--clr-beige);
  border-radius: var(--radius-md);
  text-align: center;
}

.guarantee-notice p {
  font-size: 13px;
  color: var(--clr-gray-700);
  line-height: 1.5;
}

.guarantee-notice p:first-child {
  font-weight: 600;
  color: var(--clr-navy);
  margin-bottom: 4px;
}

/* ============================================
   FOOTER
============================================ */
.checkout-footer {
  background: var(--clr-white);
  border-top: 1px solid var(--clr-gray-200);
  padding: 32px 0;
  margin-top: 80px;
}

.checkout-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.checkout-footer p {
  font-size: 14px;
  color: var(--clr-gray-600);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 14px;
  color: var(--clr-gray-600);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--clr-navy);
}

/* ============================================
   RESPONSIVE DESIGN
============================================ */
@media (max-width: 992px) {
  .checkout-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .checkout-right {
    position: static;
    max-width: 100%;
    margin: 0;
  }

  .payment-card {
    padding: 28px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  .checkout-main {
    padding: 32px 0 48px;
  }

  .checkout-right {
    max-width: 100%;
    width: 100%;
  }

  /* Header adjustments */
  .checkout-header {
    padding: 16px 0;
  }

  .logo {
    font-size: 16px;
    gap: 10px;
  }

  .logo svg {
    width: 28px;
    height: 28px;
  }

  .secure-badge {
    font-size: 13px;
    padding: 5px 10px;
  }

  /* Cards */
  .section-card,
  .payment-card {
    padding: 24px;
    border-radius: var(--radius-lg);
  }

  .section-header h1 {
    font-size: 24px;
    line-height: 1.3;
  }

  .section-header p {
    font-size: 15px;
    margin-bottom: 24px;
  }

  /* Order summary */
  .order-summary {
    padding: 16px;
    margin-bottom: 24px;
  }

  .summary-item {
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .summary-icon {
    display: none;
  }

  .summary-item h3 {
    font-size: 15px;
  }

  .summary-item p {
    font-size: 13px;
  }

  .summary-price {
    font-size: 20px;
    align-self: center;
  }

  /* Form elements */
  .form-section-title {
    font-size: 17px;
    margin-bottom: 20px;
  }

  .form-group {
    margin-bottom: 20px;
  }

  .form-group label {
    font-size: 13px;
  }

  .form-group input {
    padding: 11px 14px;
    font-size: 15px;
  }

  /* Payment section */
  .payment-title {
    font-size: 18px;
  }

  .stripe-field-group {
    margin-bottom: 16px;
  }

  .stripe-field-label {
    font-size: 13px;
  }

  .stripe-card-element {
    padding: 11px 14px;
  }

  .stripe-fields-row {
    gap: 12px;
  }

  /* Pay button */
  .pay-button {
    padding: 15px 20px;
    font-size: 15px;
  }

  /* Trust badges */
  .trust-badges {
    gap: 20px;
    margin-top: 20px;
    padding-top: 20px;
  }

  .trust-item {
    font-size: 12px;
    gap: 5px;
  }

  .trust-item svg {
    width: 18px;
    height: 18px;
  }

  /* Footer */
  .checkout-footer .container {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .footer-links {
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 12px;
  }

  .checkout-main {
    padding: 24px 0 40px;
  }

  .checkout-right {
    max-width: 100%;
    width: 100%;
  }

  /* Header */
  .checkout-header {
    padding: 12px 0;
  }

  .logo {
    font-size: 15px;
    gap: 8px;
  }

  .logo svg {
    width: 26px;
    height: 26px;
  }

  .secure-badge span {
    display: none;
  }

  .secure-badge {
    padding: 6px;
  }

  /* Cards */
  .section-card,
  .payment-card {
    padding: 20px;
    border-radius: var(--radius-md);
  }

  .section-header h1 {
    font-size: 20px;
    line-height: 1.3;
    margin-bottom: 6px;
  }

  .section-header p {
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
  }

  /* Order summary */
  .order-summary {
    padding: 14px;
    margin-bottom: 20px;
  }

  .summary-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .summary-item h3 {
    font-size: 14px;
  }

  .summary-item p {
    font-size: 12px;
    line-height: 1.5;
  }

  .summary-price {
    font-size: 22px;
    text-align: left;
  }

  /* Form elements */
  .form-section-title {
    font-size: 16px;
    margin-bottom: 16px;
    padding-bottom: 10px;
  }

  .form-group {
    margin-bottom: 18px;
  }

  .form-group label {
    font-size: 13px;
    margin-bottom: 6px;
  }

  .form-group input {
    padding: 10px 12px;
    font-size: 15px;
  }

  .error-message {
    font-size: 12px;
    margin-top: 5px;
  }

  /* Payment section */
  .payment-title {
    font-size: 17px;
  }

  .payment-divider {
    margin: 20px 0;
  }

  .payment-divider span {
    font-size: 12px;
    padding: 0 12px;
  }

  .stripe-field-group {
    margin-bottom: 14px;
  }

  .stripe-field-label {
    font-size: 13px;
    margin-bottom: 5px;
  }

  .stripe-card-element {
    padding: 10px 12px;
  }

  .stripe-fields-row {
    gap: 10px;
  }

  .card-error {
    font-size: 12px;
    margin-top: 3px;
  }

  /* Pay button */
  .pay-button {
    padding: 14px 18px;
    font-size: 15px;
  }

  .pay-button svg {
    width: 14px;
    height: 14px;
  }

  .spinner {
    width: 16px;
    height: 16px;
  }

  /* Payment message */
  .payment-message {
    margin-top: 14px;
    padding: 10px 12px;
    font-size: 13px;
  }

  /* Trust badges */
  .trust-badges {
    flex-direction: row;
    gap: 12px;
    margin-top: 18px;
    padding-top: 18px;
    justify-content: center;
  }

  .trust-item {
    font-size: 12px;
    gap: 5px;
    margin-top: 0;
  }

  .trust-item svg {
    width: 16px;
    height: 16px;
  }

  /* Footer */
  .checkout-footer {
    padding: 24px 0;
    margin-top: 60px;
  }

  .checkout-footer p {
    font-size: 13px;
  }

  .footer-links {
    flex-direction: column;
    gap: 12px;
  }

  .footer-links a {
    font-size: 13px;
  }

  /* Security notice */
  .security-notice {
    padding: 14px;
    gap: 8px;
  }

  .security-notice span {
    font-size: 12px;
  }

  /* Guarantee notice */
  .guarantee-notice {
    padding: 14px;
    margin-top: 20px;
  }

  .guarantee-notice p {
    font-size: 12px;
  }

  /* Loader overlay */
  .loader-spinner {
    width: 50px;
    height: 50px;
    border-width: 3px;
    margin-bottom: 20px;
  }

  .loader-text {
    font-size: 16px;
  }

  .loader-subtext {
    font-size: 13px;
  }
}

/* ============================================
   PAYMENT LOADER OVERLAY
============================================ */
.payment-loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 27, 42, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.payment-loader-overlay.active {
  opacity: 1;
  visibility: visible;
}

.loader-content {
  text-align: center;
  animation: fadeInUp 0.4s ease;
}

.loader-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(212, 169, 95, 0.2);
  border-top-color: var(--clr-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 24px;
}

.loader-text {
  color: var(--clr-white);
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 8px;
}

.loader-subtext {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

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

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