/**
 * ==============================================================================
 * CTS Payments - Self-Contained Payment Stylesheet
 * ==============================================================================
 * Visually matches the CTS main site (Astra theme) while remaining decoupled.
 * Works seamlessly with Bootstrap 3 form and grid classes.
 *
 * TABLE OF CONTENTS:
 * 1. CSS Custom Properties / Design Tokens
 * 2. Base & Typography Styles
 * 3. Header Styles
 *    - Desktop Navigation
 *    - Mobile Hamburger Toggle (.navbar-toggle-custom)
 * 4. Content Area & Form Enhancements
 *    - Main Content Wrapper (.payment-content)
 *    - Form Controls & Labels
 *    - Primary Button (.btn-primary)
 *    - Validation Classes (.my-error-class, .my-valid-class)
 *    - Alignment & Typography Helpers
 * 5. Footer Styles
 *    - Blue Background & Typography (.site-footer)
 *    - Logo & Info Blocks
 *    - Black Copyright Section
 * 6. Google reCAPTCHA Spacing
 * 7. Responsive Breakpoints (max-width: 768px)
 * ==============================================================================
 */

/* ------------------------------------------------------------------------------
 * Google Fonts Import: Poppins
 * ------------------------------------------------------------------------------ */
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,600&display=swap');

/* ==============================================================================
 * 1. CSS Custom Properties / Design Tokens (Astra Theme Palette)
 * ============================================================================== */
:root {
  /* CTS / Astra Global Colors */
  --ast-global-color-0: #060097; /* Primary Blue */
  --ast-global-color-1: #d0091a; /* Red / Accent */
  --ast-global-color-2: #1e293b; /* Dark Slate / Text */
  --ast-global-color-3: #67768e; /* Muted Slate / Subdued Text */
  --ast-global-color-4: #ffffff; /* Pure White */
  --ast-global-color-5: #fefefe; /* Off-White / Light Background */
  --ast-global-color-6: #3a7ba6; /* Secondary Blue */
  --ast-global-color-7: #ffcd57; /* Accent Yellow */
  --ast-global-color-8: #000000; /* Deep Black */

  /* Semantic Color Aliases */
  --color-primary: var(--ast-global-color-0);
  --color-accent: var(--ast-global-color-1);
  --color-text: var(--ast-global-color-2);
  --color-text-muted: var(--ast-global-color-3);
  --color-surface: var(--ast-global-color-4);
  --color-background: var(--ast-global-color-5);
  --color-secondary: var(--ast-global-color-6);
  --color-warning: var(--ast-global-color-7);
  --color-dark: var(--ast-global-color-8);

  /* Typography */
  --font-family-base: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-size-base: 15px;
  --line-height-base: 1.6;

  /* Layout & Header Metrics */
  --header-height: 80px;
  --header-height-mobile: 70px;
  --content-padding-top: 100px;
  --border-radius-base: 4px;
  --box-shadow-subtle: 0 2px 10px rgba(0, 0, 0, 0.08);
  --transition-speed: 0.25s;
}

/* ==============================================================================
 * 2. Base & Typography Styles
 * ============================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--ast-global-color-2);
  background-color: var(--ast-global-color-5);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-base);
  color: var(--ast-global-color-2);
  font-weight: 600;
  line-height: 1.3;
  margin-top: 0;
  margin-bottom: 0.75rem;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.85rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 0.95rem; }

p {
  margin-top: 0;
  margin-bottom: 1rem;
}

a {
  color: var(--ast-global-color-0);
  text-decoration: none;
  transition: color var(--transition-speed) ease;
}

a:hover,
a:focus {
  color: var(--ast-global-color-1);
  text-decoration: none;
}

/* ==============================================================================
 * 3. Header Styles — BLUE background matching CTS main site
 * ============================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: var(--header-height);
  background-color: var(--ast-global-color-0); /* CTS Primary Blue */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 1050;
  display: flex;
  align-items: center;
  transition: all var(--transition-speed) ease;
}

/* Header Inner: flex layout with logo left, nav right, vertically centered */
.site-header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: var(--header-height);
}

.site-header .container {
  height: 100%;
}

/* Logo wrapper & branding */
.site-header .logo {
  display: flex;
  align-items: center;
  padding: 0;
  margin: 0;
  height: auto;
  text-decoration: none;
  flex-shrink: 0;
}

.site-header .logo img {
  max-width: 121px;
  height: auto;
  display: block;
  transition: opacity var(--transition-speed) ease;
}

.site-header .logo img:hover {
  opacity: 0.9;
}

/* Header Navigation — white links on blue background */
.site-header .site-nav {
  display: flex;
  align-items: center;
}

.site-header .site-nav ul {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 4px;
}

.site-header .site-nav ul li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-header .site-nav a {
  font-family: var(--font-family-base);
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.8); /* Light white on blue */
  text-decoration: none;
  padding: 10px 14px;
  display: block;
  border-radius: var(--border-radius-base);
  transition: color var(--transition-speed) ease, background-color var(--transition-speed) ease;
  line-height: 1.4;
}

.site-header .site-nav a:hover,
.site-header .site-nav a:focus,
.site-header .site-nav li.active > a {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.12);
  text-decoration: none;
}

/* CTA nav item (e.g. "Online Courses") */
.site-header .site-nav li.nav-cta a {
  background-color: var(--ast-global-color-1);
  color: #ffffff;
  font-weight: 600;
  border-radius: 20px;
  padding: 8px 18px;
}

.site-header .site-nav li.nav-cta a:hover {
  background-color: #b0080f;
}

/* Custom Hamburger Button for Mobile — white bars on blue */
.navbar-toggle-custom {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--border-radius-base);
  cursor: pointer;
  transition: all var(--transition-speed) ease;
}

.navbar-toggle-custom:hover,
.navbar-toggle-custom:focus {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  outline: none;
}

.navbar-toggle-custom .icon-bar {
  display: block;
  width: 22px;
  height: 2px;
  background-color: #ffffff; /* White bars on blue header */
  border-radius: 2px;
  transition: all var(--transition-speed) ease;
}

.navbar-toggle-custom:hover .icon-bar {
  background-color: #ffffff;
}

/* Active state for hamburger toggle */
.navbar-toggle-custom.is-active .icon-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.navbar-toggle-custom.is-active .icon-bar:nth-child(2) {
  opacity: 0;
}

.navbar-toggle-custom.is-active .icon-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ==============================================================================
 * 4. Content Area & Form Enhancements
 * ============================================================================== */
/* Main Content Wrapper */
.payment-content,
.gramotech-content {
  padding-top: var(--content-padding-top);
  padding-bottom: 60px;
  min-height: calc(100vh - var(--header-height) - 300px);
  background-color: var(--ast-global-color-5);
}

.payment-content-area,
.gramotech-content-area {
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
  padding: 20px 15px;
}

/* Form Styles & Bootstrap 3 Compatibility Enhancements */
.form-horizontal .form-group {
  margin-left: 0;
  margin-right: 0;
  margin-bottom: 22px;
}

.form-horizontal .control-label {
  font-family: var(--font-family-base);
  font-weight: 500;
  color: var(--ast-global-color-2);
  font-size: 14.5px;
  padding-top: 9px;
  text-align: right;
}

.form-control {
  font-family: var(--font-family-base);
  font-size: 14px;
  color: var(--ast-global-color-2);
  background-color: var(--ast-global-color-4);
  border: 1px solid #d1d5db;
  border-radius: var(--border-radius-base);
  padding: 10px 14px;
  height: auto;
  min-height: 44px;
  box-shadow: none;
  transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.form-control:focus {
  border-color: var(--ast-global-color-0);
  box-shadow: 0 0 0 3px rgba(6, 0, 151, 0.12);
  outline: 0;
}

.form-control[readonly],
.form-control[disabled] {
  background-color: #f8fafc;
  border-color: #e2e8f0;
  color: var(--ast-global-color-3);
  cursor: not-allowed;
}

.help-block {
  font-family: var(--font-family-base);
  font-size: 12px;
  color: var(--ast-global-color-3);
  margin-top: 6px;
  margin-bottom: 0;
}

/* Primary Button Override: CTS Blue (#060097), Hover Red (#d0091a) */
.btn-primary {
  font-family: var(--font-family-base);
  font-size: 15px;
  font-weight: 600;
  background-color: var(--ast-global-color-0) !important;
  border-color: var(--ast-global-color-0) !important;
  color: var(--ast-global-color-4) !important;
  border-radius: var(--border-radius-base);
  padding: 12px 28px;
  line-height: 1.4;
  letter-spacing: 0.2px;
  box-shadow: 0 2px 6px rgba(6, 0, 151, 0.25);
  transition: background-color var(--transition-speed) ease,
              border-color var(--transition-speed) ease,
              box-shadow var(--transition-speed) ease,
              transform 0.15s ease;
  cursor: pointer;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.open > .dropdown-toggle.btn-primary {
  background-color: var(--ast-global-color-1) !important;
  border-color: var(--ast-global-color-1) !important;
  color: var(--ast-global-color-4) !important;
  box-shadow: 0 4px 12px rgba(208, 9, 26, 0.35);
  transform: translateY(-1px);
  outline: none !important;
}

.btn-primary:active,
.btn-primary.active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(208, 9, 26, 0.4);
}

.btn-block {
  display: block;
  width: 100%;
  margin-bottom: 12px;
}

/* Validation Status Classes (jQuery Validate) */
.my-error-class {
  color: var(--ast-global-color-1) !important;
  font-family: var(--font-family-base);
  font-size: 12.5px;
  font-weight: 500;
  margin-top: 6px;
  display: block;
}

input.my-error-class,
select.my-error-class,
textarea.my-error-class,
.form-control.my-error-class {
  border-color: var(--ast-global-color-1) !important;
  background-color: #fff8f8;
}

input.my-error-class:focus,
select.my-error-class:focus,
textarea.my-error-class:focus,
.form-control.my-error-class:focus {
  box-shadow: 0 0 0 3px rgba(208, 9, 26, 0.15) !important;
}

.my-valid-class {
  color: #16a34a !important;
  font-family: var(--font-family-base);
  font-size: 12.5px;
  font-weight: 500;
  margin-top: 6px;
  display: block;
}

input.my-valid-class,
select.my-valid-class,
textarea.my-valid-class,
.form-control.my-valid-class {
  border-color: #16a34a !important;
}

/* Center-Block & Text Alignment Helpers */
.center-block {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.has-text-align-center,
.text-center {
  text-align: center !important;
}

.has-text-align-right,
.text-right {
  text-align: right !important;
}

.has-text-align-left,
.text-left {
  text-align: left !important;
}

.has-large-font-size {
  font-size: 1.6rem !important;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ast-global-color-2);
  margin-bottom: 1rem;
}

/* ==============================================================================
 * 5. Footer Styles — BLUE background matching CTS main site
 * ============================================================================== */
.site-footer {
  background-color: var(--ast-global-color-0); /* CTS Primary Blue #060097 */
  color: #ffffff;
  padding: 45px 0 0;
  font-family: var(--font-family-base);
  font-size: 14px;
  line-height: 1.7;
}

/* Footer headings — white */
.site-footer h4 {
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 18px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Footer body text — white/light */
.site-footer p {
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 8px;
}

/* Footer Links — light, hover to full white */
.site-footer a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  transition: color var(--transition-speed) ease;
}

.site-footer a:hover,
.site-footer a:focus {
  color: #ffffff;
  text-decoration: none;
}

/* Footer Logo */
.site-footer .footer-logo {
  margin-bottom: 20px;
}

.site-footer .footer-logo img {
  max-width: 250px;
  height: auto;
  display: block;
}

/* Footer Info & Address */
.site-footer .footer-info {
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 25px;
}

/* Footer Quick Links */
.site-footer .footer-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer .footer-links li {
  margin-bottom: 8px;
}

.site-footer .footer-links a {
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
}

.site-footer .footer-links a:hover {
  color: #ffffff;
}

/* Footer Payment Info column */
.site-footer .footer-payment-info {
  color: rgba(255, 255, 255, 0.85);
}

.site-footer .footer-payment-info p {
  color: rgba(255, 255, 255, 0.8);
}

/* Copyrights Section — BLACK background, contained width */
.site-footer .copyrights {
  background-color: var(--ast-global-color-8); /* Black #000000 */
  padding: 18px 0;
  margin-top: 35px;
  font-size: 13px;
}

.site-footer .copyrights p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

.site-footer .copyrights a {
  color: rgba(255, 255, 255, 0.7);
}

.site-footer .copyrights a:hover {
  color: #ffffff;
}

/* ==============================================================================
 * 6. Google reCAPTCHA Spacing
 * ============================================================================== */
.g-recaptcha {
  margin: 15px 0;
  display: inline-block;
}

/* Centered reCAPTCHA container helper */
.recaptcha-center,
.center-block .g-recaptcha {
  display: flex;
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
}

/* ==============================================================================
 * 7. Responsive Breakpoints (Mobile & Tablet <= 768px)
 * ============================================================================== */
@media (max-width: 768px) {
  /* Header Mobile */
  .site-header {
    height: var(--header-height-mobile);
  }

  .site-header .header-inner {
    height: var(--header-height-mobile);
  }

  .site-header .container {
    padding-left: 15px;
    padding-right: 15px;
  }

  .site-header .logo img {
    max-width: 100px;
  }

  /* Hamburger Toggle button visible on mobile */
  .navbar-toggle-custom {
    display: flex;
  }

  /* Header Navigation Drawer for Mobile */
  .site-header .site-nav {
    display: none;
    position: absolute;
    top: var(--header-height-mobile);
    left: 0;
    right: 0;
    width: 100%;
    background-color: var(--ast-global-color-0); /* Blue dropdown, same as header */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding: 10px 0;
    z-index: 1040;
  }

  /* When expanded via toggle */
  .site-header .site-nav.nav-open {
    display: block !important;
  }

  .site-header .site-nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: 100%;
  }

  .site-header .site-nav ul li {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .site-header .site-nav ul li:last-child {
    border-bottom: none;
  }

  .site-header .site-nav a {
    width: 100%;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.85);
  }

  .site-header .site-nav a:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
  }

  .site-header .site-nav li.nav-cta a {
    border-radius: 0;
    background-color: var(--ast-global-color-1);
    text-align: center;
  }

  /* Content Mobile */
  .payment-content,
  .gramotech-content {
    padding-top: calc(var(--header-height-mobile) + 25px);
    padding-bottom: 40px;
  }

  .has-large-font-size {
    font-size: 1.35rem !important;
  }

  /* Form Horizontal adjustments on mobile */
  .form-horizontal .control-label {
    text-align: left;
    padding-top: 0;
    margin-bottom: 6px;
  }

  .btn-primary {
    padding: 11px 20px;
    font-size: 14.5px;
  }

  /* Footer Mobile */
  .site-footer {
    padding-top: 35px;
    text-align: center;
  }

  .site-footer .footer-logo {
    text-align: center;
  }

  .site-footer .footer-logo img {
    margin-left: auto;
    margin-right: auto;
    max-width: 200px;
  }

  .site-footer .footer-links {
    margin-top: 25px;
    margin-bottom: 25px;
  }

  .site-footer .footer-payment-info {
    margin-bottom: 20px;
  }

  /* Copyright mobile: stack and center */
  .site-footer .copyrights .col-md-6,
  .site-footer .copyrights .col-sm-6 {
    text-align: center !important;
    margin-bottom: 5px;
  }

  /* reCAPTCHA responsive handling */
  .g-recaptcha {
    transform: scale(0.92);
    transform-origin: 0 0;
  }

  .recaptcha-center .g-recaptcha,
  .center-block .g-recaptcha {
    transform-origin: center center;
  }
}

@media (max-width: 480px) {
  .site-header .logo img {
    max-width: 85px;
  }

  .has-large-font-size {
    font-size: 1.2rem !important;
  }

  .g-recaptcha {
    transform: scale(0.84);
    transform-origin: 0 0;
  }

  .recaptcha-center .g-recaptcha,
  .center-block .g-recaptcha {
    transform-origin: center center;
  }

  .site-footer .footer-logo img {
    max-width: 180px;
  }
}
