@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@500;600;700;800&display=swap");

:root {
    --bg: #0a1420;
    --panel: #0f1e2e;
    --text: #e4edf2;
    --muted: rgba(228, 237, 242, 0.6);
    --line: rgba(53, 209, 201, 0.18);
    --cyan: #35d1c9;

    --radius: 16px;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);

    --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    --logo: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.6 var(--mono);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

h1 {
    margin: 0 0 10px;
    font-family: var(--logo);
    font-size: 18px;
    letter-spacing: .6px;
}

p {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 13px;
}

.canvas {
    min-height: 100%;
    display: grid;
    place-items: center;
    padding:
            max(22px, env(safe-area-inset-top))
            max(16px, env(safe-area-inset-right))
            max(22px, env(safe-area-inset-bottom))
            max(16px, env(safe-area-inset-left));
}

.shell {
    width: min(720px, 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px;
    border-bottom: 1px solid var(--line);
    gap: 12px;
}

.brand {
    font-family: var(--logo);
    letter-spacing: 1.1px;
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
}

.brandMark {
    font-weight: 800;
    font-size: 20px;
    display: inline-flex;
    color: var(--text);
}
.brandMark .dot { color: var(--cyan); }

.meta {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: .4px;
}

.body { padding: 18px; }

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 680px) {
    .top { padding: 16px; }
    .body { padding: 16px; }
    .grid { grid-template-columns: 1fr; }
    .shell { border-radius: 18px; }
    .brandMark { font-size: 19px; }
}

.field { display: flex; flex-direction: column; gap: 6px; }

.label {
    font-size: 12px;
    color: var(--muted);
    letter-spacing: .4px;
}

.labelRow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    outline: none;
    font: 14px/1.2 var(--mono);
    background: rgba(228, 237, 242, 0.03);
    color: var(--text);
}

.input:focus {
    border-color: rgba(53, 209, 201, .55);
    box-shadow: 0 0 0 4px rgba(53, 209, 201, .14);
}

.pwWrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input.pw {
    padding-right: 58px;
}

.pwBtn {
    position: absolute;
    right: 8px;
    height: 34px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(228, 237, 242, 0.04);
    color: var(--muted);
    font: 12px/1 var(--mono);
    cursor: pointer;
}

.pwBtn:hover {
    background: rgba(228, 237, 242, 0.08);
}

.row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(228, 237, 242, 0.04);
    color: var(--text);
    font: 14px/1 var(--mono);
    cursor: pointer;
}

.btn.primary {
    border-color: rgba(53, 209, 201, .45);
    background: linear-gradient(180deg, rgba(53, 209, 201, .16), rgba(53, 209, 201, .06));
    color: var(--cyan);
    font-weight: 700;
}

.btn.primary:hover {
    background: linear-gradient(180deg, rgba(53, 209, 201, .22), rgba(53, 209, 201, .08));
}

.links {
    display: flex;
    gap: 12px;
    color: var(--muted);
    font-size: 12px;
}

.links a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dashed rgba(228, 237, 242, .3);
}

.error, .ok {
    margin: 12px 0 0;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 12px;
}

.error {
    border: 1px solid rgba(224, 90, 90, .3);
    background: rgba(224, 90, 90, .08);
    color: #f0a0a0;
}

.ok {
    border: 1px solid rgba(53, 209, 201, .3);
    background: rgba(53, 209, 201, .08);
    color: var(--cyan);
}

.footer {
    display: flex;
    justify-content: space-between;
    padding: 14px 18px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
}

.footLink {
    position: relative;
    color: inherit;
    text-decoration: none;
    padding-bottom: 2px;
    transition: transform 0.12s ease, color 0.12s ease;
}

.footLink::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    border-radius: 999px;
    background: var(--cyan);
    opacity: 0;
    transform: scaleX(0.6);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.footLink:hover {
    color: var(--text);
    transform: translateY(-1px);
}

.footLink:hover::after {
    opacity: 0.8;
    transform: scaleX(1);
}

.footStrong {
    font-weight: 600;
}

.productSwitch {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.switchBtn {
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(228, 237, 242, 0.04);
    font: 12px/1 var(--mono);
    color: var(--muted);
    cursor: pointer;
}

.switchBtn:hover {
    background: rgba(228, 237, 242, 0.08);
}

.pop {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 240px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 10px;
    display: none;
    z-index: 20;
}

.productSwitch::after {
    content: "";
    position: absolute;
    right: 0;
    top: 100%;
    width: 100%;
    height: 10px;
}

.productSwitch:hover .pop {
    display: block;
}

.pop a {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text);
}

.pop a:hover {
    background: rgba(228, 237, 242, 0.05);
}

.badge { color: var(--muted); font-size: 11px; }

.hint {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.hintBtn {
    width: 26px;
    height: 26px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(228, 237, 242, 0.04);
    color: var(--muted);
    font: 12px/1 var(--mono);
    cursor: pointer;
}

.hintBtn:hover {
    background: rgba(228, 237, 242, 0.08);
}

.hintPop {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: min(320px, 80vw);
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: var(--shadow);
    color: var(--muted);
    font-size: 12px;
    display: none;
    z-index: 30;
}

.hint.open .hintPop {
    display: block;
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: .4px;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

.gangdev-btn {
    width: 100%;
    text-decoration: none;
    gap: 10px;
    font-weight: 600;
    border-color: rgba(53, 209, 201, .35);
    background: rgba(53, 209, 201, .06);
    color: var(--cyan);
    transition: background .15s ease, box-shadow .15s ease;
}

.gangdev-btn:hover {
    background: rgba(53, 209, 201, .12);
    box-shadow: 0 6px 16px rgba(53, 209, 201, .15);
}

img.gangdev-icon {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    box-shadow: 0 0 0 1px rgba(53, 209, 201, 0.3);
}
