*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    background-color: #f4f7f6;
    color: #333;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-height: 100vh;
}

/* Skip to main content link — WCAG 2.4.1 */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background-color: #2c3e50;
    color: #ffffff;
    padding: 10px 20px;
    font-size: 1em;
    font-weight: 600;
    text-decoration: none;
    z-index: 9999;
    border-radius: 0 0 4px 0;
}

.skip-link:focus {
    top: 0;
}

.site-header {
	margin: 0 auto;
    width: 100%;
    max-width: 600px;
    text-align: center;
    padding: 20px;
}

.site-title {
    color: #2c3e50;
    font-size: 1.05em;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.02em;
}

.site-title:hover {
    color: #1a6fa8;
}

.container {
    background-color: #ffffff;
	margin: 0 auto;
    padding: 25px 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 600px;
    text-align: left;
}

h1 {
    color: #2c3e50;
    margin-bottom: 10px;
}

p {
    color: #555;
    font-size: 0.95em;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.form-group input[type="text"],
.form-group textarea,
.form-group select,
.form-group input[type="color"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box; /* Important for 100% width */
    font-size: 1em;
}
.form-group input[type="color"] {
    height: 40px; /* Consistent height for color picker */
    padding: 5px; /* Adjust padding for color picker */
}


.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.button-generate,
.button-download,
.button-generate-another {
    display: block;
    width: fit-content;
    margin: 10px auto 0;
    background-color: #1a6fa8;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s ease;
    box-sizing: border-box;
}

.button-generate:hover,
.button-download:hover,
.button-generate-another:hover {
    background-color: #165d8e;
}

.button-download,
.button-generate-another {
    background-color: #2ecc71;
}
.button-download:hover,
.button-generate-another:hover {
    background-color: #27ae60;
}
.button-generate-another {
    background-color: #e67e22;
}
.button-generate-another:hover {
    background-color: #d35400;
}


/* Focus styles — WCAG 2.4.7 */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid #1a6fa8;
    outline-offset: 2px;
}

a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 3px solid #1a6fa8;
    outline-offset: 2px;
}

.qr-code-container {
    margin-top: 20px;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 5px;
    background-color: #fdfdfd;
    text-align: center;
}

.qr-code-container h2 {
    margin-top: 0;
    color: #333;
}

#qr-code-display-custom svg {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 15px auto;
    border: 1px solid #eee; /* Optional border around SVG */
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: left;
}

footer {
    margin-top: auto;
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 0.9em;
}

footer p {
    margin-bottom: 8px;
}

footer p:first-child {
    margin-bottom: 15px;
}

footer a {
    color: #1a6fa8;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Mobile friendliness */
@media (max-width: 640px) {
    .container {
        padding: 20px;
    }
    .button-generate, .button-download, .button-generate-another {
        width: 100%;
        margin-bottom: 10px;
    }
    .button-generate:last-child, .button-download:last-child, .button-generate-another:last-child {
        margin-bottom: 0;
    }
    footer {
        margin-top: 15px;
        padding: 15px 10px;
    }
}

/* Respect user motion preferences — WCAG 2.3.3 */
@media (prefers-reduced-motion: reduce) {
    .button-generate,
    .button-download,
    .button-generate-another {
        transition: none;
    }
}