<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title th:text="#{magic.link.error.title}">Magic Link Error - Reitti</title>
    <link rel="stylesheet" href="/css/main.css">
    <link rel="stylesheet" href="/css/lineicons.css">
    <style>
        .error-container {
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--color-background-dark);
            padding: 2rem;
        }

        .error-content {
            background: var(--color-background-dark-light);
            border-radius: 12px;
            padding: 3rem;
            max-width: 600px;
            width: 100%;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
            text-align: center;
            border: 1px solid var(--color-highlight);
        }

        .error-header h1 {
            color: var(--color-text-white);
            font-size: 2rem;
            margin: 1rem 0 0 0;
            font-weight: 600;
            font-family: "Fraunces", serif;
        }

        .error-code {
            font-size: 4rem;
            color: #ff6a5b;;
            margin-bottom: 1rem;
            font-family: "Fraunces", serif;
        }

        .error-message {
            font-size: 1.2rem;
            color: var(--color-text-white);
            margin-bottom: 1rem;
        }

        .error-description {
            color: var(--color-text-white);
            opacity: 0.8;
            margin-bottom: 2rem;
            font-size: 0.95rem;
        }

        .error-actions {
            display: flex;
            gap: 1rem;
            justify-content: center;
            flex-wrap: wrap;
        }

        .error-actions .btn {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.75rem 1.5rem;
            border: 1px solid var(--color-highlight);
            border-radius: 6px;
            text-decoration: none;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
            background-color: var(--color-background-dark);
            color: var(--color-text-white);
        }

        .error-actions .btn:hover {
            background-color: var(--color-highlight);
            color: var(--color-background-dark);
            transform: translateY(-1px);
        }

        @media (max-width: 768px) {
            .error-container {
                padding: 1rem;
            }

            .error-content {
                padding: 2rem;
            }

            .error-code {
                font-size: 3rem;
            }

            .error-actions {
                flex-direction: column;
            }

            .error-actions .btn {
                width: 100%;
                justify-content: center;
            }
        }
    </style>
</head>
<body>
<div class="error-container">
    <div class="error-content">
        <div class="error-header">
            <img class="logo" th:src="@{/img/logo.svg}" alt="reitti logo" title="reitti" src="/img/logo.svg">
            <h1 th:text="#{magic.link.error.title}">Magic Link Error</h1>
        </div>

        <div class="error-details">
            <div class="error-message">
                <p th:text="${error}" th:if="${error}">An error occurred with the magic link</p>
                <p th:unless="${error}" th:text="#{magic.link.error.generic}">The magic link is invalid or has expired.</p>
            </div>

            <div class="error-description">
                <p th:text="#{magic.link.error.description}">Please request a new magic link or login with your account.</p>
            </div>
        </div>

        <div class="error-actions">
            <a href="/login" class="btn" th:text="#{magic.link.error.login}">
                <i class="lni lni-user"></i> Login with Account
            </a>
        </div>
    </div>
</div>
</body>
</html>
