* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #141414;
    color: #fff;
    font-family: 'Nunito', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

/* Animacje nawigacji między stronami (View Transitions API) */
@view-transition {
    navigation: auto;
}

::view-transition-old(root) {
    animation: 0.2s ease-out both fade-out;
}

::view-transition-new(root) {
    animation: 0.2s ease-in both fade-in;
}

@keyframes fade-out {
    to {
        opacity: 0;
        scale: 0.98;
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
        scale: 1.02;
    }
}

#main-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 600px;
    padding: 38vh 20px 20px;
    box-sizing: border-box;
}

/* Common form elements */
input[type="text"],
textarea {
    background: transparent;
    border: none;
    border-bottom: 1.4px solid #414141;
    color: #fff;
    font-family: 'Nunito', sans-serif;
    font-weight: 200;
    font-size: 1.5rem;
    text-align: center;
    letter-spacing: 1.4px;
    width: 100%;
    outline: none;
    transition: all 0.14s ease;
    padding: 15px;
    box-sizing: border-box;
    line-height: 1.5;
}

input[type="text"]:focus,
textarea:focus {
    border-bottom-color: #fff;
}

input[type="text"]::placeholder,
textarea::placeholder {
    color: #414141;
}

/* Reset Button */
#reset-btn {
    position: absolute;
    right: 10px;
    color: #414141;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0;
    pointer-events: none;
    transition: all 0.14s;
    background: none;
    border: none;
    padding: 5px;
}

#reset-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

#reset-btn:hover {
    color: #fff;
}

/* Action Button */
.action-btn,
#download-btn {
    background: transparent;
    border: 1.4px solid #414141;
    color: #fff;
    padding: 14px 28px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 14px;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.14s ease;
    text-decoration: none;
    letter-spacing: 1.4px;
    justify-content: center;
}

.action-btn:hover,
#download-btn:hover {
    border-color: #fff;
    transform: translateY(-1.4px);
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.14);
}

.action-btn:active,
#download-btn:active {
    transform: translateY(0);
}

.action-btn svg,
#download-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* Error Message */
#error-msg {
    color: #ff4c4c;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.2s;
    text-align: center;
}

#error-msg.visible {
    opacity: 1;
}

/* Back Link */
.back-link {
    position: fixed;
    top: 25px;
    left: 30px;
    color: #414141;
    text-decoration: none;
    font-size: 0.95rem;
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    letter-spacing: 1.4px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.14s ease;
    z-index: 100;
}

.back-link:hover {
    color: #fff;
    transform: translateX(-4px);
}