:root {
    --alto-primary: #ff9900;
    /* updated primary */
    --alto-light: #f8d8a8;
    /* updated light */
    --alto-gray: #d9d9d9;
    --alto-radius: 8px;
    --alto-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: var(--alto-light);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    box-sizing: border-box;
}

/* make all typography consistent */
*,
::placeholder {
    font-family: inherit;
}

.container {
    background: #fff;
    max-width: 600px;
    width: 100%;
    padding: 40px 32px 32px;
    border-radius: var(--alto-radius);
    box-shadow: var(--alto-shadow);
    margin: 40px 16px;
}

.logo {
    display: block;
    margin: 0 auto 32px;
    max-width: 180px;
    width: 100%;
    height: auto;
}

h2 {
    text-align: left;
    color: var(--alto-primary);
    margin: 0 0 24px;
    font-weight: 600;
}

h4 {
    text-align: left;
    color: var(--alto-primary);
}

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

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--alto-gray);
    /* uniform border for all fields */
    border-radius: var(--alto-radius);
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--alto-primary);
    /* subtle focus state */
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.radio-group input[type="radio"] {
    display: none;
}

.radio-group label {
    padding: 10px 20px;
    border-radius: var(--alto-radius);
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    background: var(--alto-gray);
    transition: all 0.2s;
}

.radio-group input[type="radio"]:checked+label {
    background: var(--alto-primary);
    color: #fff;
}

button[type="submit"] {
    background: var(--alto-primary);
    color: #fff;
    border: none;
    border-radius: var(--alto-radius);
    font-size: 16px;
    padding: 12px 20px;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
}

button[type="submit"]:hover {
    background: #cc7a00;
    /* darker shade for hover */
}

pre#output {
    white-space: pre-wrap;
    background: #fafafa;
    padding: 15px;
    border-radius: var(--alto-radius);
    border: 1px solid transparent;
    /* ensure no visible border */
    margin-top: 24px;
    font-size: 14px;
}

.resources {
    margin-top: 32px;
    font-size: 14px;
    color: #333;
}

.resources a {
    color: var(--alto-primary);
    text-decoration: none;
}

.resources a:hover {
    text-decoration: underline;
}

/* The scope picker sets display, so hidden needs to win over it. */
[hidden] {
    display: none !important;
}

/* --- API scope picker --- */

.scope-picker {
    display: grid;
    gap: 10px;
    padding: 16px;
    border: 1px solid var(--alto-gray);
    border-radius: var(--alto-radius);
}

.scope-picker__head {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: baseline;
    justify-content: space-between;
}

.scope-picker__title {
    flex: 1 1 auto;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.scope-picker__count {
    font-size: 13px;
    font-weight: 600;
    color: var(--alto-primary);
}

.scope-picker__filter {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--alto-gray);
    border-radius: var(--alto-radius);
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.scope-picker__filter:focus {
    outline: none;
    border-color: var(--alto-primary);
}

.scope-picker__hint {
    margin: 0;
    font-size: 13px;
    color: #555;
}

.scope-picker__hint a {
    color: var(--alto-primary);
    text-decoration: none;
}

.scope-picker__hint a:hover {
    text-decoration: underline;
}

.scope-picker__status {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: baseline;
}

.scope-picker__note {
    margin: 0;
    font-size: 13px;
    color: #777;
}

.scope-picker__note--error {
    color: #b3352c;
}

.scope-picker__list {
    max-height: 280px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--alto-gray);
    border-radius: var(--alto-radius);
}

.scope-group__title {
    margin: 12px 0 4px;
    padding: 0 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #888;
}

.scope-group:first-child .scope-group__title {
    margin-top: 2px;
}

.scope-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}

.scope-row:hover {
    background: #fdf3e4;
}

.scope-row input[type="checkbox"] {
    flex: none;
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--alto-primary);
    cursor: pointer;
}

.scope-row__method {
    flex: none;
    min-width: 56px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-align: center;
    color: #fff;
    background: #888;
}

.scope-row__method--get {
    background: #2e7d5b;
}

.scope-row__method--post {
    background: #1d6fa5;
}

.scope-row__method--patch {
    background: #b57500;
}

.scope-row__method--delete {
    background: #b3352c;
}

.scope-row__route {
    font-family: Consolas, "SFMono-Regular", monospace;
    color: #333;
    word-break: break-all;
}

.scope-picker__actions {
    display: flex;
    justify-content: flex-end;
}

.scope-picker__link {
    padding: 0;
    border: none;
    background: none;
    font-size: 13px;
    color: var(--alto-primary);
    text-decoration: underline;
    cursor: pointer;
}