/* Go Pay Now – UI Customising colour bridge */
:root{
  /*
   * Bridge GoAppily CRM UI colours into Go Pay Now.
   * Avoid self-referencing variable fallbacks (can compute to invalid).
   */
  --go-paynow-primary: var(--goappily-primary-color, #05482f);
  --go-paynow-secondary: var(--goappily-secondary-color, #7fb33f);
}

/* Hosted gateway iframe responsiveness */
.gpn-hosted-wrapper #paymentgatewayframe{
  width: 100% !important;
  max-width: 699px;
  margin: 0 auto !important;
  display: block;
}

@media (max-width: 768px){
  .gpn-hosted-wrapper #paymentgatewayframe{
    max-width: 100% !important;
  }
}

/* GoPayNow front-end + admin styles, GoAppily-branded */

.gpn-wrapper {
    max-width: 1200px;
    margin: 30px auto;
    background: #f7faf9;
    border-radius: 24px;
    padding: 6px 6px 6px !important;
    box-shadow: 0 12px 30px rgba(0,0,0,0.06);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1f2933;
}

.gpn-header {
    margin-bottom: 22px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 16px;
}

.gpn-title-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.gpn-title-icon {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: var(--go-paynow-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(5,72,47,0.35);
    font-size: 18px;
}

.gpn-title {
    margin: 0 0 4px;
    font-size: 24px;
    font-weight: 700;
    color: var(--go-paynow-primary);
}

.gpn-subtitle {
    margin: 0;
    font-size: 13px;
    color: #4a5568;
}

.gpn-form {
    margin-top: 10px;
}

/* Panels */

.gpn-panel {
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    margin-bottom: 18px;
    background: #ffffff;
}

.gpn-panel-heading {
    background: #f3f7f5;
    padding: 11px 16px;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid #e2e8f0;
    color: var(--go-paynow-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.gpn-heading-icon {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: var(--go-paynow-primary);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.gpn-panel-body {
    padding: 16px 16px 14px;
}

/* Grid */

.gpn-grid {
    display: grid;
    grid-column-gap: 18px;
    grid-row-gap: 14px;
}

.gpn-grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

/* Fields */

.gpn-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #1f2933;
}

.gpn-field input,
.gpn-field select,
.gpn-field textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #cbd5e0;
    border-radius: 10px;
    font-size: 14px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}

.gpn-field input:focus,
.gpn-field select:focus,
.gpn-field textarea:focus {
    outline: none;
    border-color: var(--go-paynow-primary);
    box-shadow: 0 0 0 1px rgba(5,72,47,0.25);
}

.gpn-help {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: #6b7280;
}

/* Amount input with prefix */

.gpn-input-with-prefix {
    display: flex;
    align-items: stretch;
}

.gpn-input-with-prefix .gpn-prefix {
    padding: 9px 11px;
    background: #f3f7f5;
    border: 1px solid #cbd5e0;
    border-right: 0;
    border-radius: 10px 0 0 10px;
    font-size: 14px;
    color: var(--go-paynow-primary);
    min-width: 34px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.gpn-input-with-prefix input {
    border-radius: 0 10px 10px 0;
}

/* Order table */

.gpn-order-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
    font-size: 13px;
    overflow: hidden;
    border-radius: 14px;
}

.gpn-order-table thead th {
    background: var(--go-paynow-primary);
    color: #ffffff;
    font-weight: 600;
    padding: 9px 10px;
}

.gpn-order-table tbody td {
    padding: 9px 10px;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
}

.gpn-order-table tbody tr:last-child td {
    border-bottom: 0;
}

.gpn-right {
    text-align: right;
}

.gpn-order-amount {
    font-weight: 700;
    color: var(--go-paynow-primary);
}

/* Notices */

.gpn-notice {
    max-width: 960px;
    margin: 18px auto;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
}

.gpn-notice-error {
    background: #fef2f2;
    border: 1px solid #f97373;
    color: #991b1b;
}

.gpn-notice-error ul {
    margin: 0;
    padding-left: 18px;
}

/* Terms & conditions */

.gpn-tandc {
    margin: 14px 0 18px;
    font-size: 13px;
    color: #1f2933;
}

.gpn-tandc input {
    margin-right: 6px;
}

/* Primary button – GoAppily colours */

.gpn-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 24px;
    background: var(--go-paynow-primary);
    border-radius: 999px;
    border: none;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    text-transform: none;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(5,72,47,0.35);
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.gpn-btn-primary i {
    font-size: 14px;
}

.gpn-btn-primary:hover {
    background: var(--go-paynow-secondary);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(5,72,47,0.45);
}

.gpn-btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 8px 18px rgba(5,72,47,0.3);
}

/* Result */

.gpn-result-wrapper .gpn-panel-body {
    text-align: center;
}

.gpn-result-body h2 {
    margin-top: 0;
    color: var(--go-paynow-primary);
}

/* Admin tweaks */

.gpn-admin h1 {
    color: var(--go-paynow-primary);
}

/* Force GoAppily primary colour on order table header */
.gpn-wrapper .gpn-order-table thead th {
    background: var(--go-paynow-primary) !important;
    color: #ffffff !important;
    border-color: var(--go-paynow-primary) !important;
}


body .gpn-wrapper table.gpn-order-table thead th {
    background-color: var(--go-paynow-primary) !important;
    color: #fff !important;
}