<?php
/**
 * Default blocked page (access denied) for IP Whitelist/Blacklist.
 *
 * @var array $blocked {
 *     @type string $title         Page <title>
 *     @type string $headline      Main heading
 *     @type string $message      Body text
 *     @type string $logo_url     Resolved image URL (from attachment or legacy)
 *     @type string $bg_color     Background
 *     @type string $text_color   Text
 *     @type string $mode         'blacklist'|'whitelist'
 * }
 */
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

$title      = isset( $blocked['title'] ) ? $blocked['title'] : __( 'Access Denied', 'wp-powersuite' );
$headline   = isset( $blocked['headline'] ) ? $blocked['headline'] : __( 'Access Denied', 'wp-powersuite' );
$message    = isset( $blocked['message'] ) ? $blocked['message'] : __( 'You are not allowed to visit this website.', 'wp-powersuite' );
$logo_url   = isset( $blocked['logo_url'] ) ? $blocked['logo_url'] : '';
$bg_color   = isset( $blocked['bg_color'] ) ? $blocked['bg_color'] : '#f0f0f1';
$text_color = isset( $blocked['text_color'] ) ? $blocked['text_color'] : '#1d2327';
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
	<meta charset="<?php bloginfo( 'charset' ); ?>">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title><?php echo esc_html( $title ); ?></title>
	<style type="text/css">
		* { box-sizing: border-box; }
		body {
			margin: 0;
			padding: 0;
			font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
			background: <?php echo esc_attr( $bg_color ); ?>;
			color: <?php echo esc_attr( $text_color ); ?>;
			min-height: 100vh;
			display: flex;
			align-items: center;
			justify-content: center;
			line-height: 1.5;
		}
		.wpps-blocked-page { text-align: center; max-width: 560px; padding: 40px 24px; }
		.wpps-blocked-logo { margin-bottom: 24px; }
		.wpps-blocked-logo img { max-width: 180px; height: auto; display: inline-block; }
		.wpps-blocked-headline { font-size: 28px; font-weight: 600; margin: 0 0 16px; color: inherit; }
		.wpps-blocked-message { font-size: 16px; margin: 0; opacity: 0.9; }
	</style>
</head>
<body class="wpps-blocked-body">
	<div class="wpps-blocked-page">
		<?php if ( ! empty( $logo_url ) ) : ?>
			<div class="wpps-blocked-logo">
				<img src="<?php echo esc_url( $logo_url ); ?>" alt="">
			</div>
		<?php endif; ?>
		<h1 class="wpps-blocked-headline"><?php echo esc_html( $headline ); ?></h1>
		<p class="wpps-blocked-message"><?php echo esc_html( $message ); ?></p>
	</div>
</body>
</html>
