:root {
    color-scheme: dark;
    --bg0: #07070a;
    --bg1: #0b0b12;
    --card: rgba(16, 16, 24, 0.76);
    --stroke: rgba(255, 255, 255, 0.1);
    --text: #f2f2f6;
    --muted: rgba(242, 242, 246, 0.72);
    --red: #ff2e2e;
    --red-soft: rgba(255, 46, 46, 0.24);
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

html {
    scroll-behavior: smooth;
    scrollbar-color: rgba(255, 46, 46, 0.72) rgba(8, 8, 12, 0.96);
    scrollbar-width: thin;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    margin: 0;
    padding: 0;
    color: var(--text);
    background:
        radial-gradient(1200px 700px at 50% -20%, rgba(255, 46, 46, 0.22), transparent 60%),
        radial-gradient(900px 600px at 20% 15%, rgba(255, 46, 46, 0.12), transparent 55%),
        radial-gradient(900px 600px at 80% 35%, rgba(180, 0, 0, 0.1), transparent 60%),
        linear-gradient(180deg, var(--bg0), var(--bg1));
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: -2px;
    z-index: -1;
    pointer-events: none;
    opacity: 0.22;
    background:
        linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px) 0 0 / 42px 42px,
        linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px) 0 0 / 42px 42px;
    -webkit-mask-image: radial-gradient(420px 320px at 50% 20%, #000 35%, transparent 70%);
    mask-image: radial-gradient(420px 320px at 50% 20%, #000 35%, transparent 70%);
    filter: drop-shadow(0 0 20px rgba(255, 46, 46, 0.15));
}

body::-webkit-scrollbar {
    width: 10px;
}

body::-webkit-scrollbar-track {
    background: rgba(8, 8, 12, 0.96);
}

body::-webkit-scrollbar-thumb {
    border: 2px solid rgba(8, 8, 12, 0.96);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 46, 46, 0.92), rgba(115, 11, 16, 0.95));
}

body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #ff3c3c, #9d1118);
}

a,
button {
    -webkit-tap-highlight-color: transparent;
}

.site-brand {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 0 0 auto;
    padding: clamp(18px, 3.2vw, 28px) 18px clamp(4px, 1.3vw, 8px);
    color: var(--text);
    text-align: center;
}

.site-brand .logo {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(7px, 1.2vw, 10px);
    color: inherit;
    text-decoration: none;
}

.site-brand .logo img {
    height: clamp(54px, 7vw, 70px);
    width: auto;
    border-radius: 999px;
    filter: drop-shadow(0 0 18px rgba(255, 46, 46, 0.45)) drop-shadow(0 0 44px rgba(255, 46, 46, 0.18));
}

.site-brand .logo span {
    color: var(--red);
    font-size: 30px;
    font-weight: 900;
    letter-spacing: 0.22em;
    text-indent: 0.22em;
    text-shadow: 0 0 18px rgba(255, 46, 46, 0.45), 0 0 60px rgba(255, 46, 46, 0.22);
}

#app {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.95fr);
    gap: clamp(14px, 2vw, 22px);
    align-items: start;
    width: min(100% - 32px, 1100px);
    margin: 0 auto;
    padding: clamp(16px, 2.7vw, 28px) 0 clamp(28px, 4vw, 40px);
    flex: 1 0 auto;
}

.form-container,
.result-container {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--stroke);
    border-radius: 18px;
    background:
        radial-gradient(700px 220px at 40% 0%, rgba(255, 46, 46, 0.2), transparent 60%),
        var(--card);
    box-shadow: var(--shadow);
}

.form-container::after,
.result-container::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 18px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 46, 46, 0.3), rgba(255, 255, 255, 0.06), rgba(180, 0, 0, 0.18));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    pointer-events: none;
}

.form-container {
    flex: unset;
    margin-right: 0;
    min-width: 0;
    padding: clamp(18px, 3vw, 32px);
}

.result-container {
    flex: unset;
    margin-top: 0;
    min-width: 0;
    padding: clamp(18px, 2.4vw, 24px);
}

#app .form-container > *,
#app .result-container > * {
    position: relative;
    z-index: 1;
}

.form-group {
    position: relative;
    z-index: 1;
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.form-control {
    max-width: 100%;
    width: 100%;
    min-height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 12px 13px;
    color: var(--text);
    background: rgba(0, 0, 0, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    font: inherit;
    font-size: 15px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.form-control:focus {
    border-color: rgba(255, 46, 46, 0.66);
    background: rgba(0, 0, 0, 0.36);
    box-shadow: 0 0 0 3px rgba(255, 46, 46, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.form-control::placeholder {
    color: rgba(242, 242, 246, 0.42);
}

select.form-control {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, rgba(242, 242, 246, 0.78) 50%),
        linear-gradient(135deg, rgba(242, 242, 246, 0.78) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 50%,
        calc(100% - 12px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 38px;
}

.form-control.result {
    min-height: clamp(220px, 38vh, 360px);
    height: clamp(220px, 38vh, 360px);
    width: 100%;
    resize: vertical;
    line-height: 1.5;
}

.input-group,
.input-group-field {
    display: flex;
    min-width: 0;
    width: 100%;
}

.input-group {
    align-items: stretch;
}

.input-group-field {
    flex: 1 1 auto;
}

.input-group-addon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 46px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-right: 0;
    border-radius: 12px 0 0 12px;
    padding: 0 12px;
    color: rgba(242, 242, 246, 0.82);
    background: rgba(255, 255, 255, 0.06);
}

.input-group-addon input {
    width: 16px;
    height: 16px;
    accent-color: var(--red);
}

.input-group-addon + .form-control,
.input-group-addon + .input-group-field .form-control {
    border-radius: 0 12px 12px 0;
}

.btn {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
    min-height: 46px;
    border: 1px solid rgba(255, 46, 46, 0.4);
    border-radius: 12px;
    padding: 0 18px;
    color: var(--text);
    background: linear-gradient(135deg, rgba(255, 46, 46, 0.26), rgba(180, 0, 0, 0.18));
    box-shadow: 0 10px 30px rgba(255, 46, 46, 0.12);
    font: inherit;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.btn:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 46, 46, 0.64);
    background: linear-gradient(135deg, rgba(255, 46, 46, 0.34), rgba(180, 0, 0, 0.24));
    box-shadow: 0 12px 40px rgba(255, 46, 46, 0.18);
}

.btn:active {
    transform: translateY(0);
}

.footer {
    display: flex;
    justify-content: center;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 28px 18px 32px;
    color: rgba(242, 242, 246, 0.62);
    background: rgba(7, 7, 10, 0.34);
    text-align: center;
    flex: 0 0 auto;
    margin-top: auto;
}

.footer .footer-container {
    text-align: center;
}

.footer a {
    color: rgba(242, 242, 246, 0.82);
    text-decoration: none;
    margin: 0 10px;
}

.footer a:hover {
    color: var(--text);
    text-shadow: 0 0 14px rgba(255, 46, 46, 0.45);
}

.footer .text-muted {
    color: rgba(242, 242, 246, 0.62);
    margin-top: 10px;
    font-size: 13px;
}

@media (max-width: 920px) {
    #app {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .site-brand {
        padding: 22px 12px 4px;
    }

    .site-brand .logo img {
        height: 58px;
    }

    .site-brand .logo span {
        font-size: 24px;
        letter-spacing: 0.16em;
        text-indent: 0.16em;
    }

    #app {
        gap: 18px;
        width: min(100% - 24px, 1100px);
        padding: 22px 0 30px;
    }

    .form-container {
        margin-right: 0;
        margin-bottom: 0;
        padding: 20px;
    }

    .result-container {
        width: 100%;
        padding: 18px;
    }

    .btn {
        width: 100%;
    }

    .footer {
        flex-direction: column;
        padding: 20px 12px 24px;
    }

    .footer a {
        display: block;
        margin: 7px 0;
    }

    .footer .text-muted {
        font-size: 12px;
    }
}

@media (max-width: 420px) {
    .site-brand {
        padding-top: 18px;
    }

    .site-brand .logo span {
        font-size: 20px;
        letter-spacing: 0.14em;
        text-indent: 0.14em;
    }

    #app {
        width: min(100% - 20px, 1100px);
        gap: 12px;
        padding-top: 16px;
    }

    .form-container,
    .result-container {
        border-radius: 14px;
        padding: 16px;
    }

    .input-group {
        flex-direction: column;
        gap: 8px;
    }

    .input-group-addon,
    .input-group-addon + .form-control,
    .input-group-addon + .input-group-field .form-control {
        width: 100%;
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
