<?php
/** @var yii\web\View $this */
/** @var string|null $error */

use yii\helpers\Url;

$this->title = 'Website Manager — Login';
?>
<div style="min-height:100vh;display:flex;align-items:center;justify-content:center;background:#f0faf4">
    <div style="width:100%;max-width:420px;padding:1rem">
        <!-- Brand -->
        <div style="text-align:center;margin-bottom:2rem">
            <div style="width:64px;height:64px;border-radius:18px;background:linear-gradient(135deg,#2d6a4f,#52b788);display:flex;align-items:center;justify-content:center;margin:0 auto 1rem;font-size:1.8rem;color:#fff">
                <i class="bi bi-leaf"></i>
            </div>
            <h1 style="font-family:'Inter',sans-serif;font-size:1.4rem;font-weight:700;color:#0f172a;margin:0">Website Manager</h1>
            <p style="color:#64748b;font-size:.875rem;margin-top:.3rem">SJ Nutrizione · Content CMS</p>
        </div>

        <!-- Card -->
        <div style="background:#fff;border-radius:20px;padding:2.2rem;box-shadow:0 8px 40px rgba(0,0,0,.1);border:1px solid #e2e8f0">
            <h2 style="font-size:1.1rem;font-weight:600;color:#0f172a;margin:0 0 1.5rem">Sign in to continue</h2>

            <?php if ($error): ?>
            <div style="background:#fef2f2;border:1px solid #fecaca;color:#dc2626;border-radius:10px;padding:.75rem 1rem;font-size:.85rem;margin-bottom:1.2rem">
                <i class="bi bi-exclamation-circle me-1"></i><?= htmlspecialchars($error) ?>
            </div>
            <?php endif; ?>

            <form method="POST" action="<?= Url::to(['/webcms/default/login']) ?>">
                <?= \yii\helpers\Html::hiddenInput(Yii::$app->request->csrfParam, Yii::$app->request->csrfToken) ?>
                <div style="margin-bottom:1.2rem">
                    <label class="form-label-cms">Password</label>
                    <input type="password"
                           name="password"
                           class="cms-input"
                           placeholder="Enter your CMS password"
                           autofocus
                           required>
                </div>
                <button type="submit" class="btn-cms-primary" style="width:100%;padding:.8rem;font-size:.95rem">
                    <i class="bi bi-unlock me-1"></i> Sign In
                </button>
            </form>
        </div>

        <p style="text-align:center;color:#94a3b8;font-size:.75rem;margin-top:1.5rem">
            This is a private area. Unauthorised access is not permitted.
        </p>
    </div>
</div>
