:root {
    --ink: #132238;
    --muted: #667286;
    --line: #d8dee7;
    --line-strong: #c8d0dc;
    --surface: #ffffff;
    --canvas: #f5f6f7;
    --accent: #ea6b1b;
    --accent-dark: #c9510d;
    --navy: #102641;
    --navy-deep: #0a1d33;
    --focus: rgb(234 107 27 / 20%);
    font-family: Inter, "SF Pro Text", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--ink);
    background: var(--canvas);
    font-synthesis: none;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--canvas);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input,
select { font: inherit; }

button,
input,
select { border-radius: 5px; }

.shell { min-height: 100vh; }

.login-card {
    width: min(440px, calc(100% - 32px));
    margin: 10vh auto 0;
    padding: 38px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgb(16 38 65 / 12%);
}

.login-card h1,
.topbar h1 {
    margin: 6px 0 0;
    line-height: 1.05;
    letter-spacing: -.035em;
}

.login-card h1 { font-size: clamp(2rem, 4vw, 2.6rem); }

.eyebrow {
    margin: 0;
    color: var(--accent);
    font-size: .73rem;
    font-weight: 800;
    letter-spacing: .13em;
}

.muted {
    color: var(--muted);
    line-height: 1.55;
}

.stack {
    display: grid;
    gap: 20px;
    margin-top: 26px;
}

label {
    display: grid;
    gap: 8px;
    color: var(--ink);
    font-size: .9rem;
    font-weight: 720;
}

input,
select {
    width: 100%;
    min-height: 48px;
    padding: 11px 14px;
    border: 1px solid var(--line-strong);
    background: #fff;
    color: var(--ink);
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

input::placeholder { color: #778397; opacity: 1; }

input:focus,
select:focus {
    outline: 0;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--focus);
}

button {
    min-height: 48px;
    padding: 11px 20px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
    font-weight: 780;
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

button:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}

button:active { transform: translateY(1px); }

button:focus-visible {
    outline: 3px solid rgb(255 255 255 / 82%);
    outline-offset: 3px;
}

button:disabled {
    cursor: wait;
    opacity: .58;
}

.masthead {
    padding: 29px max(32px, calc((100vw - 1312px) / 2)) 22px;
    background: linear-gradient(118deg, var(--navy-deep) 0%, var(--navy) 72%, #132c4b 100%);
    color: #fff;
    box-shadow: inset 0 -1px rgb(255 255 255 / 7%);
}

.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 28px;
}

.topbar h1 {
    color: #fff;
    font-size: clamp(2rem, 3.2vw, 2.45rem);
    font-weight: 760;
}

.session {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 2px;
    color: #d4dbe5;
    font-size: .92rem;
}

button.secondary {
    min-height: 44px;
    padding: 9px 18px;
    border-color: rgb(255 255 255 / 27%);
    background: transparent;
    color: #fff;
}

button.secondary:hover {
    border-color: rgb(255 255 255 / 62%);
    background: rgb(255 255 255 / 8%);
}

.product-tabs {
    display: flex;
    align-items: stretch;
    margin-top: 24px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.product-tab {
    min-height: 46px;
    padding: 10px 18px;
    border-color: rgb(255 255 255 / 25%);
    border-radius: 0;
    background: #fff;
    color: var(--ink);
    white-space: nowrap;
}

.product-tab:first-child { border-radius: 5px 0 0 5px; }
.product-tab:last-child { border-radius: 0 5px 5px 0; }
.product-tab + .product-tab { margin-left: -1px; }

.product-tab:hover {
    position: relative;
    border-color: #fff;
    background: #f5f7fa;
    color: var(--ink);
}

.product-tab[aria-current="true"] {
    position: relative;
    z-index: 1;
    border-color: rgb(255 255 255 / 28%);
    background: rgb(5 21 38 / 52%);
    color: #fff;
}

.product-tab small {
    margin-left: 8px;
    color: inherit;
    font-size: .8rem;
    font-weight: 620;
    opacity: .68;
}

.workspace,
.notice {
    width: min(1312px, calc(100% - 64px));
    margin-right: auto;
    margin-left: auto;
}

.workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.92fr) minmax(340px, 1.08fr);
    gap: 30px;
    align-items: start;
    padding: 30px 0 58px;
}

.panel {
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 10px 34px rgb(16 38 65 / 4%);
}

.panel h2 {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.2;
    letter-spacing: -.02em;
}

.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.form-panel > .muted {
    max-width: 640px;
    margin: 14px 0 0;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
    font-size: .96rem;
}

.form-panel .stack {
    gap: 22px;
    margin-top: 24px;
}

.domain-chip,
.count {
    flex: 0 0 auto;
    padding: 6px 9px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #f7f8fa;
    color: #516075;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: .78rem;
    font-weight: 650;
}

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

.domain-input {
    display: flex;
    align-items: center;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 5px;
    background: #f7f8fa;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.domain-input:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--focus);
}

.domain-input input {
    min-width: 0;
    border: 0;
    border-radius: 0;
    outline: 0;
    box-shadow: none;
}

.domain-input span {
    padding: 0 12px;
    color: #5c687a;
    font-size: .8rem;
    font-weight: 620;
    white-space: nowrap;
}

fieldset {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 5px;
}

legend {
    width: 100%;
    padding: 0 0 9px;
    font-size: .9rem;
    font-weight: 760;
}

.choice {
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 14px;
    padding: 17px 18px;
    color: var(--ink);
    cursor: pointer;
    transition: background 150ms ease;
}

.choice + .choice { border-top: 1px solid var(--line); }
.choice:hover { background: #fafbfc; }

.choice input {
    width: 19px;
    min-height: 19px;
    margin: 1px 0 0;
    padding: 0;
    accent-color: var(--accent);
    box-shadow: none;
}

.choice strong { line-height: 1.35; }

.choice small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: .83rem;
    font-weight: 430;
    line-height: 1.45;
}

#submit-button {
    min-height: 52px;
    margin-top: 2px;
    box-shadow: 0 7px 18px rgb(234 107 27 / 18%);
}

.side-stack { display: grid; gap: 22px; }

.tenant-list {
    display: grid;
    gap: 10px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.tenant-list li {
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fff;
}

.tenant-list strong {
    display: block;
    margin-bottom: 5px;
    font-size: .94rem;
}

a {
    color: #1263c5;
    text-underline-offset: 2px;
}

a:hover { color: #084c9e; }

.message {
    margin: 0;
    padding: 12px 14px;
    border: 1px solid;
    border-radius: 5px;
    font-size: .88rem;
    line-height: 1.45;
}

.error {
    border-color: #f0b6b6;
    background: #fff3f3;
    color: #8c2222;
}

.warning {
    border-color: #e6c677;
    background: #fff9e6;
    color: #76550c;
}

.notice {
    display: grid;
    gap: 6px;
    margin-top: 30px;
    padding: 22px;
    border: 1px solid #e6c677;
    border-radius: 7px;
    background: #fff9e6;
}

.notice span { color: #76550c; }

.result { border-top: 4px solid #2f8d60; }

.result a {
    display: block;
    margin: 8px 0 16px;
    overflow-wrap: anywhere;
}

.result input { font-size: .78rem; }

[hidden] { display: none !important; }

@media (max-width: 960px) {
    .masthead { padding-right: 24px; padding-left: 24px; }

    .workspace,
    .notice { width: min(100% - 48px, 760px); }

    .workspace { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
    .masthead { padding: 22px 18px 18px; }

    .topbar {
        align-items: flex-start;
        gap: 18px;
    }

    .topbar h1 { font-size: 1.85rem; }

    .session {
        align-items: flex-end;
        flex-direction: column;
        gap: 8px;
    }

    .session button { min-height: 40px; padding: 7px 12px; }

    .product-tabs { margin-top: 20px; }

    .product-tab { padding: 9px 14px; }

    .workspace,
    .notice { width: calc(100% - 24px); }

    .workspace { gap: 16px; padding: 16px 0 36px; }

    .columns { grid-template-columns: 1fr; }

    .panel,
    .login-card { padding: 20px; }

    .panel-heading { align-items: flex-start; }

    .domain-input span { padding: 0 9px; font-size: .74rem; }
}
