<?php
/**
 * Template: Branding (native)
 *
 * Branding customization: logo URL, brand colour (native colour picker),
 * "hide Powered by" toggle and custom CSS. Persists via the save-branding
 * proxy. Branding is a plan feature; on plans without it the API returns an
 * error which is surfaced to the user (no fake/disabled UI).
 *
 * Note: this is cosmetic branding only. True white-label (custom domain/CNAME,
 * own mail server, branded consent-lookup) is account/agency-level and is
 * managed in the Biscotti Dashboard under "Agency White Label".
 *
 * @package Biscotti_CMP
 */

defined( 'ABSPATH' ) || exit;

// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template is included inside Biscotti_Admin::render_dynamic_page(); these are function-scoped locals, not globals.

$page_title = __( 'Branding', 'biscotti-cmp' );
include __DIR__ . '/partials/page-header.php';
?>

<div class="biscotti-page biscotti-page-white-label">
	<div class="biscotti-card">
		<h3>🎨 <?php esc_html_e( 'Customize Branding', 'biscotti-cmp' ); ?></h3>
		<p class="description"><?php esc_html_e( 'Replace Biscotti branding with your own. Requires a plan that includes white-label.', 'biscotti-cmp' ); ?></p>

		<div class="biscotti-lw-grid-2">
			<p class="biscotti-form-row"><label for="bsc-wl-logo"><?php esc_html_e( 'Logo URL', 'biscotti-cmp' ); ?></label>
				<input type="url" id="bsc-wl-logo" class="biscotti-svc-input" placeholder="https://example.com/logo.svg" />
			</p>
			<p class="biscotti-form-row"><label for="bsc-wl-color"><?php esc_html_e( 'Brand Color', 'biscotti-cmp' ); ?></label>
				<input type="color" id="bsc-wl-color" value="#9B6B3C" style="width:100%;height:40px;padding:4px;border:1px solid #cbd5e1;border-radius:6px;cursor:pointer;box-sizing:border-box;" />
			</p>
		</div>

		<p class="biscotti-form-row">
			<label class="lw-cb"><input type="checkbox" id="bsc-wl-hide-powered" /> <?php esc_html_e( 'Hide "Powered by Biscotti"', 'biscotti-cmp' ); ?></label>
		</p>

		<p class="biscotti-form-row"><label for="bsc-wl-css"><?php esc_html_e( 'Custom CSS', 'biscotti-cmp' ); ?></label>
			<textarea id="bsc-wl-css" class="biscotti-svc-input" rows="4" style="font-family:monospace;" placeholder=".biscotti-banner { }"></textarea>
		</p>

		<p class="submit">
			<button type="button" id="bsc-wl-save" class="button button-primary">💾 <?php esc_html_e( 'Save Branding', 'biscotti-cmp' ); ?></button>
			<span id="bsc-wl-status" class="biscotti-save-status" role="status"></span>
		</p>
	</div>
</div>
