/* ---------------------------------------------------------------------------
   Qflow Identity Server — modern Stripe-style refresh
   Brand: V2 accent #3bb5e5 (matches ControlPanel V2 UI)
   --------------------------------------------------------------------------- */

:root {
    --qf-bg:          #f6f9fc;
    --qf-surface:     #ffffff;
    --qf-border:      #e3e8ee;
    --qf-border-strong: #cbd2d9;
    --qf-text:        #1a1f36;
    --qf-text-muted:  #697386;
    --qf-text-soft:   #8b95a5;
    --qf-primary:     #3bb5e5;
    --qf-primary-hover: #1ea3d7;
    --qf-primary-active: #178bbb;
    --qf-primary-soft: rgba(59, 181, 229, 0.18);
    --qf-danger:      #df1c41;
    --qf-danger-bg:   #fff1f3;
    --qf-info-bg:     #f1f8fe;
    --qf-info-border: #cfe6f7;
    --qf-radius:      8px;
    --qf-radius-sm:   6px;
    --qf-shadow:      0 1px 2px rgba(15, 23, 42, 0.04),
                      0 6px 24px rgba(15, 23, 42, 0.08);
    --qf-font:        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                      "Helvetica Neue", Arial, "Noto Sans", sans-serif,
                      "Apple Color Emoji", "Segoe UI Emoji";
}

/* ---------- base / reset over Bootstrap ----------------------------------- */

html, body {
    height: 100%;
}

body {
    margin: 0;
    padding: 0 !important;
    background: var(--qf-bg);
    color: var(--qf-text);
    font-family: var(--qf-font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }

/* hide the bootstrap fixed-top dark navbar entirely; we replace it
   with a clean centered brand mark in the layout */
.navbar.navbar-inverse.navbar-fixed-top { display: none !important; }

/* ---------- page shell ---------------------------------------------------- */

.qf-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 56px 20px 24px;
}

.qf-brand {
    margin-bottom: 28px;
    text-align: center;
}

.qf-brand img {
    height: 36px;
    width: auto;
    display: inline-block;
}

.qf-brand-text {
    margin-top: 12px;
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--qf-text-soft);
    font-weight: 600;
}

.qf-footer {
    margin-top: auto;
    padding-top: 40px;
    color: var(--qf-text-soft);
    font-size: 12px;
    text-align: center;
}

.qf-footer a { color: var(--qf-text-muted); text-decoration: none; }
.qf-footer a:hover { color: var(--qf-text); }

/* container width override — Bootstrap's .container is too wide for an auth
   surface, and the side-by-side col-md-6 collapses naturally inside this */
.body-content {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    padding: 0 !important;
}

/* widen for pages that need it (consent, permissions list) */
body.qf-wide .body-content { max-width: 640px; }

/* drop the layout's <hr/> + default footer */
.body-content > hr,
.body-content > footer { display: none; }

/* ---------- card surface -------------------------------------------------- */

/* Re-purpose Bootstrap's .panel as the modern card */
.panel,
.panel-default {
    background: var(--qf-surface);
    border: 1px solid var(--qf-border);
    border-radius: var(--qf-radius);
    box-shadow: var(--qf-shadow);
    margin-bottom: 16px;
}

.panel-heading {
    background: transparent;
    border-bottom: 1px solid var(--qf-border);
    padding: 18px 28px;
    border-radius: var(--qf-radius) var(--qf-radius) 0 0;
}

.panel-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--qf-text);
    letter-spacing: 0.01em;
    margin: 0;
}

.panel-body { padding: 28px 28px 24px; }

/* ---------- headings ------------------------------------------------------ */

.page-header {
    padding: 0 0 8px;
    margin: 0 0 24px;
    border-bottom: 0;
    text-align: center;
}

.page-header h1,
h1 {
    font-size: 24px !important;
    font-weight: 600;
    color: var(--qf-text);
    line-height: 1.3;
    margin: 0;
}

.page-header h1 small {
    display: block;
    margin-top: 8px;
    font-size: 14px;
    font-weight: 400;
    color: var(--qf-text-muted);
}

/* ---------- form controls ------------------------------------------------- */

fieldset { padding: 0; margin: 0; border: 0; }
legend  { display: none; }

.form-group { margin-bottom: 18px; }

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--qf-text);
    margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
.form-control {
    display: block;
    width: 100% !important;
    max-width: none !important;
    height: 42px;
    padding: 10px 12px;
    background: var(--qf-surface);
    border: 1px solid var(--qf-border);
    border-radius: var(--qf-radius-sm);
    color: var(--qf-text);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.4;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) inset;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
       -moz-appearance: none;
            appearance: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
.form-control:focus {
    outline: none;
    border-color: var(--qf-primary);
    box-shadow: 0 0 0 3px var(--qf-primary-soft);
}

input[readonly] {
    background: #f4f6f9;
    color: var(--qf-text-muted);
    cursor: not-allowed;
}

input::placeholder { color: var(--qf-text-soft); }

input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    accent-color: var(--qf-primary);
    vertical-align: -3px;
}

.login-remember label,
.consent-remember label {
    display: flex;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--qf-text-muted);
    cursor: pointer;
}
.login-remember label strong,
.consent-remember label strong { font-weight: 500; color: var(--qf-text); }

/* ---------- buttons ------------------------------------------------------- */

.btn {
    display: inline-block;
    padding: 11px 18px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    border: 1px solid transparent;
    border-radius: var(--qf-radius-sm);
    cursor: pointer;
    user-select: none;
    background: var(--qf-surface);
    color: var(--qf-text);
    transition: background 0.15s ease, border-color 0.15s ease,
                box-shadow 0.15s ease, transform 0.05s ease;
    text-decoration: none !important;
    -webkit-appearance: none;
       -moz-appearance: none;
            appearance: none;
    min-height: 42px;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--qf-primary-soft);
}

.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--qf-primary) !important;
    border-color: var(--qf-primary) !important;
    color: #ffffff !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08),
                0 0 0 1px rgba(15, 23, 42, 0.02) inset;
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--qf-primary-hover) !important;
    border-color: var(--qf-primary-hover) !important;
    color: #ffffff !important;
}

.btn-primary:active {
    background: var(--qf-primary-active) !important;
    border-color: var(--qf-primary-active) !important;
}

.btn-primary[disabled],
.btn-primary.disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-default,
.btn:not(.btn-primary):not(.btn-danger) {
    background: var(--qf-surface);
    border: 1px solid var(--qf-border);
    color: var(--qf-text);
}

.btn-default:hover,
.btn:not(.btn-primary):not(.btn-danger):hover {
    background: #f4f6f9;
    border-color: var(--qf-border-strong);
}

.btn-danger {
    background: var(--qf-danger) !important;
    border-color: var(--qf-danger) !important;
    color: #ffffff !important;
}

.btn-danger:hover { background: #c11236 !important; border-color: #c11236 !important; }

/* full-width primary in the auth card */
.panel-body form .btn-primary { width: 100%; }

/* consent button row */
.consent-buttons { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.consent-buttons .pull-right { margin-left: auto; }
.consent-buttons .btn { min-width: 120px; }

/* ---------- alerts -------------------------------------------------------- */

.alert {
    padding: 12px 14px;
    margin-bottom: 18px;
    border-radius: var(--qf-radius-sm);
    border: 1px solid transparent;
    font-size: 14px;
    line-height: 1.4;
}

.alert strong { font-weight: 600; }

.alert-danger {
    background: var(--qf-danger-bg);
    border-color: #fbd1d8;
    color: #8a1f33;
}

.alert-info {
    background: var(--qf-info-bg);
    border-color: var(--qf-info-border);
    color: #1a4d6d;
}

/* ---------- list / link helpers ------------------------------------------ */

.list-unstyled {
    list-style: none;
    padding: 0;
    margin: 18px 0 0;
}

.list-unstyled li { margin-bottom: 6px; font-size: 14px; }
.list-unstyled a {
    color: var(--qf-primary);
    text-decoration: none;
    font-weight: 500;
}
.list-unstyled a:hover { color: var(--qf-primary-hover); text-decoration: underline; }

/* ---------- external providers ------------------------------------------- */

.external-providers .panel { margin-top: 16px; }
.external-providers .list-inline {
    padding: 0;
    margin: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.external-providers .list-inline li { margin: 0; }
.external-providers .btn { width: 100%; }

/* ---------- consent / permissions specifics ------------------------------ */

.client-logo {
    text-align: center;
    margin-bottom: 12px;
}
.client-logo img { max-height: 48px; }

.permissions { margin-top: 16px; }
.permission {
    background: var(--qf-surface);
    border: 1px solid var(--qf-border);
    border-radius: var(--qf-radius);
    box-shadow: var(--qf-shadow);
    padding: 20px;
    margin-bottom: 14px;
}

.permission img { max-width: 56px; height: auto; border-radius: 4px; }
.permission-clientname { font-size: 16px; font-weight: 600; color: var(--qf-text); margin-bottom: 6px; }
.permission-type { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--qf-text-soft); margin-top: 10px; }
.permission ul { padding-left: 18px; margin: 6px 0 0; color: var(--qf-text-muted); }

.request-id {
    margin-top: 12px;
    font-size: 12px;
    color: var(--qf-text-soft);
    word-break: break-all;
}
.request-id span { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---------- responsive --------------------------------------------------- */

@media (max-width: 480px) {
    .qf-shell { padding: 28px 16px 16px; }
    .panel-body { padding: 22px 20px; }
    body.qf-wide .body-content,
    .body-content { max-width: 100%; }
    .consent-buttons .pull-right { margin-left: 0; width: 100%; }
}
