:root {
    --bg: #edf1f5;
    --panel: #ffffff;
    --ink: #15202b;
    --muted: #687787;
    --line: #d7e0e8;
    --accent: #0f766e;
    --accent-dark: #0b5f59;
    --shadow: 0 18px 45px rgba(22, 34, 45, .09);
}

.auth-checking body {
    visibility: hidden;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

a {
    color: inherit;
}

.app-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 22px 0 46px;
}

.app-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 900;
}

.brand-logo {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--ink);
    color: #fff;
    letter-spacing: 0;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 14px;
}

.ghost-button,
.back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    text-decoration: none;
    font-weight: 800;
    cursor: pointer;
}

.hero-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    align-items: end;
    margin-bottom: 16px;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-weight: 900;
}

h1 {
    margin: 0;
    font-size: 34px;
    line-height: 1.12;
}

.subtitle {
    margin: 10px 0 0;
    color: var(--muted);
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.tool-card {
    display: flex;
    flex-direction: column;
    min-height: 168px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    box-shadow: 0 8px 22px rgba(22, 34, 45, .05);
    text-decoration: none;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.tool-card:hover {
    transform: translateY(-3px);
    border-color: #9db1bf;
    box-shadow: var(--shadow);
}

.tool-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin-bottom: 18px;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-weight: 900;
}

.tool-card strong {
    display: block;
    font-size: 20px;
    margin-bottom: 8px;
}

.tool-card small {
    color: var(--muted);
    line-height: 1.5;
}

.tool-card.nike .tool-icon { background: #111827; }
.tool-card.arc .tool-icon { background: #9f1239; }
.tool-card.nikekr .tool-icon { background: #b45309; }
.tool-card.gear .tool-icon { background: #0f766e; }
.tool-card.capo .tool-icon { background: #4338ca; }
.tool-card.ssaka .tool-icon { background: #be123c; }
.tool-card.browser .tool-icon { background: #2563eb; }
.login-body {
    display: grid;
    place-items: center;
    padding: 22px;
    background:
        linear-gradient(135deg, rgba(15, 118, 110, .13), transparent 42%),
        var(--bg);
}

.login-shell {
    width: min(440px, 100%);
}

.login-card {
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.brand-mark {
    color: var(--accent);
    font-weight: 900;
    margin-bottom: 10px;
}

.login-card h1 {
    font-size: 30px;
}

.login-card p {
    color: var(--muted);
}

.login-form {
    display: grid;
    gap: 14px;
    margin-top: 22px;
}

.login-form label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-weight: 700;
}

.login-form input {
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
}

.login-form button {
    height: 44px;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.login-form button:hover {
    background: var(--accent-dark);
}

.form-error {
    min-height: 20px;
    color: #b91c1c;
    font-size: 14px;
}

@media (max-width: 900px) {
    .tool-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .app-shell {
        width: min(100% - 22px, 1180px);
        padding-top: 12px;
    }

    .app-topbar,
    .hero-card {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .tool-grid {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 28px;
    }
}

@media (max-width: 640px) {
  .app-topbar { flex-direction: row; flex-wrap: wrap; gap: 12px; align-items: center; }
  .top-actions { margin-left: auto; }
  .hero-card { padding: 18px; }
  .hero-card .eyebrow { display: none; }
  .tool-card { display: grid; grid-template-columns: 44px minmax(0,1fr); align-items: center; gap: 14px; min-height: 0; padding: 16px; }
  .tool-card .tool-icon { width: 44px; height: 44px; margin-bottom: 0; }
  .tool-card strong { font-size: 17px; }
  .tool-card small { margin-top: 5px; }
}
