/* Powered by Reason — applied to PBR SSO */
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;700&display=swap');

:root {
    --pbr-brand:      #ef6b49;
    --pbr-dark:       #333333;
    --pbr-body:       #666666;
    --pbr-muted:      #999999;
    --pbr-border:     #d9d9d9;
    --pbr-bg-light:   #f5f5f5;
    --pbr-white:      #ffffff;
    --pbr-pink-dark:  #b72c63;
    --pbr-pink:       #f23a72;
    --pbr-orange:     #f67028;
    --pbr-yellow:     #ffb32f;
    --pbr-footer-bg:  #333333;
    --pbr-footer-bar: #262626;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    background: var(--pbr-bg-light);
    color: var(--pbr-body);
    font: 400 15px/1.55 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--pbr-brand);
    text-decoration: none;
    transition: color .15s ease;
}
a:hover { color: var(--pbr-dark); }

.wrap { max-width: 780px; margin: 0 auto; padding: 0 20px; width: 100%; }
.muted { color: var(--pbr-muted); }

/* Header */
.topbar {
    background: var(--pbr-white);
    border-bottom: 1px solid var(--pbr-border);
    padding: 16px 0;
}
.topbar .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.brand-logo {
    display: block;
    height: 38px;
    width: auto;
}
.brand-sub {
    color: var(--pbr-muted);
    font-size: 13px;
    border-left: 1px solid var(--pbr-border);
    padding-left: 12px;
    line-height: 1;
}
nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
nav a, nav span {
    color: var(--pbr-dark);
    font-size: 14px;
}
nav a:hover { color: var(--pbr-brand); }
nav .muted { color: var(--pbr-muted); }

/* Typography */
h1, h2, h3, h4 {
    color: var(--pbr-dark);
    font-weight: 400;
    margin: 0 0 18px;
    line-height: 1.25;
}
h1 { font-size: 32px; }
h2 { font-size: 28px; }
h3 { font-size: 20px; }
h4 { font-size: 18px; }
p  { margin: 0 0 14px; }
strong, b { font-weight: 700; color: var(--pbr-dark); }

main.wrap { padding-top: 36px; padding-bottom: 56px; flex: 1; }

/* Hero (landing) */
.hero h1 {
    font-size: 36px;
    margin-bottom: 12px;
}
.hero .lede {
    font-size: 18px;
    color: var(--pbr-body);
    margin-bottom: 24px;
}

/* Cards */
.card {
    background: var(--pbr-white);
    border: 1px solid var(--pbr-border);
    border-radius: 4px;
    padding: 28px;
    margin-bottom: 20px;
}
.card > h1:first-child,
.card > h2:first-child,
.card > h3:first-child { margin-top: 0; }

/* Forms */
label {
    display: block;
    color: var(--pbr-dark);
    font-weight: 700;
    font-size: 14px;
    margin: 16px 0 6px;
}
label.inline {
    font-weight: 400;
    color: var(--pbr-body);
    margin-top: 12px;
}
input[type=text],
input[type=email],
input[type=password],
input[type=tel],
input[type=url],
input[type=search],
select,
textarea {
    width: 100%;
    border: 1px solid var(--pbr-border);
    border-radius: 4px;
    padding: 10px 12px;
    font: inherit;
    color: var(--pbr-dark);
    background: var(--pbr-white);
    transition: border-color .15s ease, box-shadow .15s ease;
    -webkit-appearance: none;
    appearance: none;
}
input[type=search]::-webkit-search-decoration,
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; }
select {
    padding-right: 36px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%23666666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5l5 5 5-5'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--pbr-brand);
    box-shadow: 0 0 0 3px rgba(239, 107, 73, .15);
}
input[disabled] {
    background: var(--pbr-bg-light);
    color: var(--pbr-muted);
}
textarea { min-height: 110px; resize: vertical; font-family: inherit; }

/* Buttons */
button, .btn {
    display: inline-block;
    background: var(--pbr-brand);
    color: var(--pbr-white);
    border: 0;
    border-radius: 4px;
    padding: 10px 22px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
    line-height: 1.4;
}
button:hover, .btn:hover {
    background: var(--pbr-dark);
    color: var(--pbr-white);
}
button.secondary, .btn.secondary {
    background: var(--pbr-white);
    color: var(--pbr-dark);
    border: 1px solid var(--pbr-border);
}
button.secondary:hover, .btn.secondary:hover {
    background: var(--pbr-dark);
    color: var(--pbr-white);
    border-color: var(--pbr-dark);
}

/* Flash messages */
.flash {
    border: 1px solid var(--pbr-border);
    border-left-width: 3px;
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 20px;
    background: var(--pbr-white);
}
.flash-ok  { border-left-color: var(--pbr-brand);     color: var(--pbr-dark); }
.flash-err { border-left-color: var(--pbr-pink);      color: var(--pbr-pink-dark); background: #fdf2f0; border-color: #f6c8d4 #f6c8d4 #f6c8d4 var(--pbr-pink); }

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--pbr-white);
}
th, td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--pbr-border);
    text-align: left;
    vertical-align: top;
    color: var(--pbr-body);
}
th {
    background: var(--pbr-bg-light);
    color: var(--pbr-dark);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
tr:last-child td { border-bottom: 0; }

code {
    background: var(--pbr-bg-light);
    border: 1px solid var(--pbr-border);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 13px;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    color: var(--pbr-dark);
}
.kv { word-break: break-all; }

.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 200px; }

/* Footer */
.footer {
    background: var(--pbr-footer-bg);
    color: var(--pbr-muted);
    margin-top: 56px;
    padding: 32px 0 0;
}
.footer p { color: var(--pbr-muted); margin: 0 0 12px; }
.footer a { color: var(--pbr-white); }
.footer a:hover { color: var(--pbr-brand); }
.footer-bar {
    background: var(--pbr-footer-bar);
    padding: 16px 0;
    margin-top: 24px;
    color: var(--pbr-muted);
    font-size: 13px;
}

/* Subtle accent bar variant for the "client created / secret regenerated" panel */
.card.flash-ok {
    border-left: 3px solid var(--pbr-brand);
}

/* Admin: registered clients list */
.client-row { padding: 20px 24px; }
.client-row.is-disabled { background: var(--pbr-bg-light); }
.client-row.is-disabled .client-title h3 { color: var(--pbr-muted); }

.client-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.client-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.client-title h3 {
    margin: 0;
    font-size: 18px;
    color: var(--pbr-dark);
}
.badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 3px 8px;
    border-radius: 3px;
    line-height: 1.4;
}
.badge-ok   { background: rgba(239,107,73,.12); color: var(--pbr-brand); }
.badge-off  { background: var(--pbr-bg-light);  color: var(--pbr-muted);  border: 1px solid var(--pbr-border); }
.badge-type { background: var(--pbr-bg-light);  color: var(--pbr-dark);   border: 1px solid var(--pbr-border); }

.client-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}
.client-actions a,
.client-actions form { display: inline-flex; }

.linkbtn {
    background: transparent;
    color: var(--pbr-brand);
    border: 0;
    padding: 0;
    margin: 0;
    font: inherit;
    font-weight: 400;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.4;
}
.linkbtn:hover {
    background: transparent;
    color: var(--pbr-dark);
    text-decoration: underline;
}
.linkbtn-danger { color: var(--pbr-pink-dark); }
.linkbtn-danger:hover { color: var(--pbr-pink); }

.client-meta {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 8px 16px;
    margin: 0;
}
.client-meta dt {
    color: var(--pbr-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
    font-weight: 700;
    padding-top: 2px;
}
.client-meta dd { margin: 0; color: var(--pbr-body); }
.client-meta dd code { font-size: 13px; }
.client-meta dd .kv + .kv { margin-top: 4px; }

@media (max-width: 560px) {
    .client-meta { grid-template-columns: 1fr; gap: 4px 0; }
    .client-meta dt { padding-top: 8px; }
}

/* Admin: users list */
.filter-bar {
    display: flex;
    gap: 14px;
    align-items: flex-end;
    flex-wrap: wrap;
}
.filter-field { display: flex; flex-direction: column; min-width: 180px; }
.filter-field-grow { flex: 1; min-width: 220px; }
.filter-field label {
    margin: 0 0 6px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--pbr-muted);
}
.filter-actions { display: flex; align-items: center; gap: 6px; }

.users-table { border-radius: 0; }
.users-table th:first-child, .users-table td:first-child { padding-left: 24px; }
.users-table th:last-child,  .users-table td:last-child  { padding-right: 24px; }
.users-table .badge { font-size: 11px; }

.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 4px 4px 24px;
}
.pager a {
    color: var(--pbr-brand);
    font-weight: 700;
}
.pager a:hover { color: var(--pbr-dark); }
