<?php
/**
 * PASSWORD RESET EMAIL TEMPLATE
 * File: templates/email/password-reset.php
 * Password reset request template
 */

// Email content
ob_start();
?>

<p>We received a request to reset the password for your rentidium account.</p>

<div class="alert alert-warning">
    <strong>Security Notice:</strong> This password reset link will expire in 1 hour for security reasons.
</div>

<p>If you requested this password reset, click the button below to set a new password:</p>

<div class="order-summary">
    <h3>Password Reset Details</h3>
    <p><strong>Account Email:</strong> <?= htmlspecialchars($email) ?></p>
    <p><strong>Request Time:</strong> <?= date('F j, Y \a\t g:i A') ?></p>
    <p><strong>IP Address:</strong> <?= $ip_address ?? 'Unknown' ?></p>
    <p><strong>Browser:</strong> <?= $user_agent ?? 'Unknown' ?></p>
</div>

<p>If you're having trouble clicking the password reset button, you can also copy and paste the following link into your web browser:</p>

<p style="word-break: break-all; background: #f8f9fa; padding: 10px; border-radius: 5px; font-family: monospace;">
    <?= $reset_url ?>
</p>

<div class="alert alert-danger">
    <strong>Security Alert:</strong> If you did NOT request this password reset, please ignore this email and consider changing your password immediately. Someone may have access to your account.
</div>

<?php
$content = ob_get_clean();

// Prepare email data
$email_data = [
    'title' => 'Password Reset Request',
    'greeting' => "Hello {$first_name}!",
    'content' => $content,
    'action_url' => $reset_url,
    'action_text' => 'Reset Password',
    'footer_note' => "This link will expire in 1 hour for your security.",
    'signature' => "Best regards,<br>The rentidium Security Team<br>security@rentidium.com"
];

// Include layout
include 'layout.php';
?>