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

.logo-img {
    width: 38px;
    height: 38px;
}

.logo-white {
    display: block;
}

.logo-red {
    display: none;
}

[data-theme="light"] .logo-white {
    display: none;
}

[data-theme="light"] .logo-red {
    display: block;
}

.theme-toggle .sun {
    display: none;
}

.theme-toggle .moon {
    display: block;
}

[data-theme="light"] .theme-toggle .sun {
    display: block;
}

[data-theme="light"] .theme-toggle .moon {
    display: none;
}

.header-btn {
    background: var(--toggle-bg);
    border: none;
    border-radius: 20px;
    padding: 6px 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--toggle-color);
    gap: 5px;
    transition: background 0.3s, color 0.3s;
}

.header-btn:hover {
    background: var(--btn-hover-bg);
    color: var(--btn-hover-text);
}

.card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 20px;
    padding: 52px 48px 48px;
    width: fit-content;
    max-width: calc(100vw - 40px);
    box-shadow: 0 24px 64px var(--shadow-soft);
}

/* Add spacing between paragraphs */
.card p + p {
    margin-top: 12px;
}

.icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    background-color: currentColor;
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-position: center;
    mask-repeat: no-repeat;
    mask-size: contain;
    flex-shrink: 0;
}

.icon-moon {
    -webkit-mask-image: url("../icons/moon.svg");
    mask-image: url("../icons/moon.svg");
}

.icon-sun {
    -webkit-mask-image: url("../icons/sun.svg");
    mask-image: url("../icons/sun.svg");
}

.icon-close {
    -webkit-mask-image: url("../icons/close.svg");
    mask-image: url("../icons/close.svg");
}

.theme-toggle .icon {
    width: 15px;
    height: 15px;
    color: inherit;
    transition: color 0.3s;
}

.error-dismiss .icon {
    width: 14px;
    height: 14px;
    color: var(--icon-on-danger);
}

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    padding: 0 28px;
    background: var(--surface);
    border-bottom: 1px solid var(--border-line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 200;
    transition: background 0.3s, border-color 0.3s;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-right {
    gap: 10px;
}

body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background 0.3s, color 0.3s;
}

main {
    position: relative;
    display: grid;
    flex: 1;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 92px 20px 28px;
    gap: 16px;
}

footer {
    padding: 0px 20px;
    background: var(--surface);
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    margin-top: auto;
}

.footer-copyright {
    font-size: 12px;
    padding: 10px 0px;
    color: var(--muted);
}

.hidden {
    display: none !important;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-up {
    animation: fadeUp 0.35s ease forwards;
}

#error-box {
    width: 100%;
    max-width: 1000px;
    box-sizing: border-box;
    background: var(--failure);
    border-radius: 10px;
    padding: 12px 12px;
    font-size: 13px;
    color: var(--white);
    position: relative;
    margin-bottom: 12px;
}

#error-message {
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
    line-height: 1.5;
}

.error-dismiss {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--failure);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    line-height: 1;
}

::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--input-border);
    border-radius: 3px;
}
