:root {
    --bg: #f4f7fb;
    --card: #ffffff;
    --text: #172033;
    --muted: #667085;
    --line: #d9e2ec;
    --primary: #2457a6;
    --primary-dark: #183d78;
    --accent: #f59e0b;
    --soft: #eef4ff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 10%, rgba(36, 87, 166, 0.10), transparent 28%),
        linear-gradient(135deg, #f8fbff 0%, var(--bg) 100%);
    color: var(--text);
    font-family: Manrope, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.connect-app {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 20px;
}

.connect-card {
    width: min(100%, 760px);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 18px 55px rgba(23, 32, 51, 0.12);
    padding: 28px;
}

.brand {
    color: var(--primary);
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 10px;
}

h1 {
    font-size: clamp(34px, 7vw, 64px);
    line-height: 0.98;
    margin: 0 0 16px;
    letter-spacing: 0;
}

.lead {
    color: var(--muted);
    font-size: 17px;
    line-height: 1.45;
    margin: 0 0 24px;
    max-width: 560px;
}

.code-form {
    display: grid;
    gap: 10px;
    margin-bottom: 22px;
}

.code-form label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.code-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--text);
    font: inherit;
    min-height: 48px;
    padding: 0 14px;
}

button,
.open-cabinet {
    border: 0;
    border-radius: 14px;
    background: var(--primary);
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    min-height: 48px;
    padding: 0 18px;
}

button:hover,
.open-cabinet:hover {
    background: var(--primary-dark);
}

.default-code {
    justify-self: start;
    background: var(--soft);
    color: var(--primary-dark);
}

.default-code:hover {
    background: #dbe8ff;
}

.platforms {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.platform-card {
    align-items: center;
    background: #fbfdff;
    border: 1px solid var(--line);
    border-radius: 18px;
    display: flex;
    gap: 12px;
    min-height: 86px;
    padding: 14px;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.platform-card:hover {
    border-color: rgba(36, 87, 166, 0.45);
    box-shadow: 0 10px 26px rgba(36, 87, 166, 0.12);
    transform: translateY(-1px);
}

.platform-card strong,
.platform-card small {
    display: block;
}

.platform-card small {
    color: var(--muted);
    margin-top: 3px;
}

.platform-icon {
    align-items: center;
    border-radius: 14px;
    color: #ffffff;
    display: inline-flex;
    flex: 0 0 46px;
    font-size: 13px;
    font-weight: 900;
    height: 46px;
    justify-content: center;
}

.telegram .platform-icon { background: #2aabee; }
.vk .platform-icon { background: #2673f2; }
.ok .platform-icon { background: #ee8208; }
.web .platform-icon { background: var(--primary); }

.known-user {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 18px;
    margin-top: 18px;
    padding: 16px;
}

.known-user p {
    color: var(--muted);
    margin: 6px 0 12px;
}

.open-cabinet {
    display: inline-flex;
    align-items: center;
}

.hint {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
    margin: 18px 0 0;
}

@media (max-width: 640px) {
    .connect-card {
        border-radius: 20px;
        padding: 20px;
    }

    .code-row,
    .platforms {
        grid-template-columns: 1fr;
    }

    button,
    .default-code {
        width: 100%;
    }
}
