/**
 * Paystar Connect - Gravity Forms Integration Styles
 *
 * This stylesheet provides styles for the payment confirmation messages displayed
 * on the front-end after a user completes a payment via the Paystar gateway.
 *
 * It is designed to integrate seamlessly with Gravity Forms' own styling by
 * leveraging its CSS custom properties (variables) for colors and border-radius.
 *
 * @package PaystarConnect
 * @subpackage  Integrations/GravityForms
 * @author Dinor Digital <info@dinordigital.ir>
 * @version 1.0.0
 */

/* ==========================================================================
   1. Payment Confirmation Message Boxes
   ========================================================================== */

/**
 * Base style for all payment confirmation messages (both success and error).
 * This creates a consistent container for the feedback text.
 */
.gform_payment_message {
	padding: 20px;
	margin-bottom: 20px;
	border: 1px solid; /* Border color is defined by modifier classes. */
	border-radius: var(--gf-radius, 4px); /* Uses GF's standard border-radius, with a fallback. */
	text-align: center;
}

/**
 * Modifier class for a SUCCESSFUL payment message.
 * Applies Gravity Forms' success colors for a consistent look and feel.
 */
.gform_payment_message--success {
	background-color: rgba(var(--gf-color-success-rgb), 0.05); /* Uses GF success color with low opacity. */
	border-color: var(--gf-color-success);
	color: var(--gf-color-success);
}

/**
 * Modifier class for a FAILED or ERRORED payment message.
 * Applies Gravity Forms' danger/error colors.
 */
.gform_payment_message--error {
	background-color: rgba(var(--gf-color-danger-rgb), 0.05); /* Uses GF danger color with low opacity. */
	border-color: var(--gf-color-danger);
	color: var(--gf-color-danger);
}

/**
 * A wrapper to center the action button (e.g., "Return to Form")
 * displayed within the confirmation message.
 */
.gform_payment_message__button-wrap {
	width: 100%;
	text-align: center;
}

/**
 * Styling for the "Return to Form" button, which allows users to navigate
 * back after a failed transaction.
 */
.gform_payment_message__button {
	display: inline-block;
	background-color: #f6f7f7; /* A neutral, light gray. */
	color: #333;
	padding: 10px 16px;
	border: 1px solid #ccc;
	border-radius: 3px;
	text-decoration: none;
	font-size: 14px;
	cursor: pointer;
	transition: background-color 0.15s ease-in-out;
}

/**
 * Hover state for the "Return to Form" button to provide visual feedback.
 */
.gform_payment_message__button:hover {
	background-color: #e9e9e9; /* Slightly darker gray on hover. */
}

/* ==========================================================================
   2. Form Behavior
   ========================================================================== */

/**
 * Hides the form's footer (which typically contains the submit button)
 * ONLY on the success confirmation screen. This prevents users from
 * attempting to resubmit a form that has already been successfully processed.
 *
 * It uses the :has() pseudo-class to apply the style to the .gform_wrapper
 * only if it contains a success message.
 */
.gform_wrapper:has(.gform_payment_message--success) .gform_footer {
	display: none !important;
}
