/* ===========================================
   MAGFest Login Theme v2
   Single card, first-time-user oriented
   =========================================== */

/* ---- Reset Keycloak defaults ---- */

#kc-header,
#kc-social-providers,
#kc-info {
    display: none;
}

.card-pf,
#kc-content-wrapper {
    background: transparent;
    box-shadow: none;
    border: none;
    padding: 0;
    margin: 0;
}

/* ---- Page background ---- */
/* SWAP BACKGROUNDS: uncomment ONE line below */

.login-pf body,
body.kc-login {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.42857143;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;

    /* Option 1: Plain white */
    /* background-color: #f5f5f5; */

    /* Option 2: Plain gray (Uber match) */
    /* background-color: #eee; */

    /* Option 3: Dark circuit board */
    background: #555 url(../img/bg-dark.png) repeat;

    /* Option 4: Blue circuit board */
    /* background: #2a7abf url(../img/bg-blue.png) repeat; */

    /* Option 5: Neon circuit board */
    /* background: #000 url(../img/bg-neon.png) repeat; */
}

/* ---- The Card ---- */

#magfest-login-card {
    width: 100%;
    max-width: 460px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    padding: 36px 40px 28px;
    margin: 0 auto;
    color: #333;
}

/* ---- Brand / Header (inside card) ---- */

#magfest-brand {
    text-align: center;
    margin-bottom: 24px;
}

#magfest-realm-name {
    font-size: 26px;
    font-weight: 600;
    color: #222;
    margin: 0 0 6px 0;
    letter-spacing: 0.3px;
}

#magfest-subtitle {
    font-size: 14px;
    color: #666666;
    margin: 0;
    font-weight: 400;
}

#magfest-context {
    font-size: 12px;
    color: #616872;
    margin: 8px 0 0 0;
    font-weight: 400;
    line-height: 1.4;
}

/* ---- Google button (primary action) ---- */

#magfest-primary-idp {
    margin-bottom: 0;
}

.magfest-btn {
    display: block;
    width: 100%;
    padding: 11px 16px;
    font-size: 15px;
    font-family: inherit;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
    transition: background-color 0.15s, border-color 0.15s;
}

.magfest-btn-google {
    background: #fff;
    border: 1px solid #dadce0;
    color: #3c4043;
    font-weight: 500;
}

.magfest-btn-google:hover {
    background: #f7f8f8;
    border-color: #c6c8ca;
    text-decoration: none;
    color: #3c4043;
}

.google-g-icon {
    vertical-align: middle;
    margin-right: 10px;
}

.magfest-btn-google span {
    vertical-align: middle;
}

/* ---- Divider ---- */

.magfest-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
}

.magfest-divider::before,
.magfest-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #ddd;
}

.magfest-divider span {
    padding: 0 12px;
    font-size: 12px;
    color: #686868;
    white-space: nowrap;
    text-transform: lowercase;
}

/* ---- Form fields ---- */

.magfest-field {
    margin-bottom: 16px;
}

.magfest-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #444;
    margin-bottom: 5px;
}

.magfest-field input[type="text"],
.magfest-field input[type="email"],
.magfest-field input[type="password"] {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    font-family: inherit;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    background: #fff;
    color: #333;
    transition: border-color 0.15s;
}

/* ---- Side-by-side field row (name fields) ---- */

.magfest-field-row {
    display: flex;
    gap: 12px;
}

.magfest-field-row .magfest-field {
    flex: 1;
    min-width: 0;
}

.magfest-field input:focus {
    border-color: #2b6aa8;
    outline: 2px solid #2b6aa8;
    outline-offset: 1px;
}

.magfest-password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.magfest-password-wrapper input {
    flex: 1;
    padding-right: 40px;
}

.magfest-password-wrapper button {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: #616872;
    padding: 4px;
}

.magfest-password-wrapper button:hover {
    color: #555;
}

/* ---- Remember me / Forgot password row ---- */

.magfest-form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 13px;
}

.magfest-remember {
    color: #555;
    font-weight: normal;
    cursor: pointer;
}

.magfest-remember input {
    margin-right: 4px;
    vertical-align: middle;
}

/* Underlined, not colour alone: WCAG 1.4.1 for a link sitting beside the
   "Remember me" text. Hover changes colour because the underline is permanent. */
.magfest-forgot {
    color: #2b6aa8;
    text-decoration: underline;
}

.magfest-forgot:hover {
    color: #1d4d7c;
}

/* ---- Sign In button ---- */

.magfest-btn-signin {
    background: #337ab7;
    border: 1px solid #2e6da4;
    color: #fff;
    font-weight: 500;
    font-size: 16px;
    margin-top: 4px;
}

.magfest-btn-signin:hover {
    background: #286090;
    border-color: #204d74;
}

/* ---- Registration (inside the card) ---- */

#magfest-register {
    text-align: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #eee;
    font-size: 14px;
}

#magfest-register span {
    color: #666;
}

/* Underlined, not colour alone: WCAG 1.4.1. This rule covers "Create one with
   email" on login.ftl and "Back to sign in" on login-reset-password.ftl, both of
   which follow body text in the same line. */
#magfest-register a {
    color: #2b6aa8;
    text-decoration: underline;
    font-weight: 500;
    margin-left: 4px;
}

#magfest-register a:hover {
    color: #1d4d7c;
}

/* ---- Workspace IdP (staff only, subtle) ---- */

/* Sits directly under the Google button, not at the foot of the card. A button
   rather than a link: under the primary action a link reads as a caption for it
   instead of a separate choice. Lighter border and smaller text keep it clearly
   secondary. */
/* The gap above this button is wider than the gap below it on purpose. The note
   belongs to this button, not to the Google button above, and proximity is what
   says so; a divider rule would fight the one below the social buttons. */
#magfest-workspace-idp {
    margin-top: 16px;
}

.magfest-btn-workspace {
    background: #fff;
    border: 1px solid #e3e6ea;
    color: #5a6473;
    font-size: 14px;
    font-weight: 500;
    padding: 9px 16px;
}

.magfest-btn-workspace:hover {
    background: #f7f8f8;
    border-color: #c6c8ca;
    color: #3c4043;
    text-decoration: none;
}

.magfest-workspace-note {
    margin: 5px 0 0 0;
    text-align: center;
    font-size: 11.5px;
    line-height: 1.4;
    color: #616872;
}

/* ---- Error messages ---- */

.magfest-error {
    display: block;
    color: #c0392b;
    font-size: 12px;
    margin-top: 4px;
}

/* Also catch KC's own alert messages */
.alert-error,
.magfest-alert.alert-error {
    background: #fdf2f2;
    border: 1px solid #e8c4c4;
    color: #c0392b;
    padding: 10px 14px;
    border-radius: 5px;
    font-size: 13px;
    margin-bottom: 16px;
}

.alert-warning,
.magfest-alert.alert-warning {
    background: #fef9e7;
    border: 1px solid #f0e0a0;
    color: #856404;
    padding: 10px 14px;
    border-radius: 5px;
    font-size: 13px;
    margin-bottom: 16px;
}

.alert-success,
.magfest-alert.alert-success {
    background: #eafaf1;
    border: 1px solid #b8e6c8;
    color: #1e7e34;
    padding: 10px 14px;
    border-radius: 5px;
    font-size: 13px;
    margin-bottom: 16px;
}

.alert-info,
.magfest-alert.alert-info {
    background: #f0f7ff;
    border: 1px solid #d0e3f7;
    color: #31708f;
    padding: 10px 14px;
    border-radius: 5px;
    font-size: 13px;
    margin-bottom: 16px;
}

/* ---- Hide default KC elements we replaced ---- */

#kc-form,
#kc-form-wrapper {
    all: unset;
}

/* ---- Security notice (below card, on background) ---- */

#magfest-security-notice {
    text-align: center;
    margin-top: 20px;
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
    font-size: 12px;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    padding: 10px 18px;
    border-radius: 6px;
    line-height: 1.5;
}

#magfest-security-notice svg {
    vertical-align: -2px;
    margin-right: 5px;
}

#magfest-security-notice strong {
    color: #ffd666;
    font-weight: 600;
}

/* ---- Legal footer (footer.ftl, below the security notice) ---- */

/* The panel is not decoration. This text sits on the tiled background image, where
   no contrast ratio can be measured; the panel supplies a known backdrop. It holds
   across all five background options in this file, worst case 5.1:1 on Option 1. */
#magfest-legal {
    max-width: 460px;
    margin: 10px auto 0;
    padding: 8px 18px;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 6px;
    text-align: center;
    font-size: 12px;
    line-height: 1.5;
}

#magfest-legal ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

#magfest-legal li {
    display: inline-block;
    margin: 0 8px;
}

#magfest-legal a {
    color: #fff;
    text-decoration: underline;
}

#magfest-legal a:hover {
    color: #ffd666;
}

/* Not the shared #2b6aa8 ring below. That colour is 5.63:1 on the white card but
   2.69:1 on this panel, under the 3:1 in WCAG 1.4.11. White is 15.1:1 here. */
#magfest-legal a:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* ===========================================
   IdP Review Profile / Update Profile forms
   =========================================== */

#kc-idp-review-profile-form input[type="text"],
#kc-idp-review-profile-form input[type="email"],
#kc-idp-review-profile-form input[type="password"],
#kc-update-profile-form input[type="text"],
#kc-update-profile-form input[type="email"],
#kc-update-profile-form input[type="password"] {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    font-family: inherit;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    background: #fff;
    color: #333;
    transition: border-color 0.15s;
}

#kc-idp-review-profile-form input:focus,
#kc-update-profile-form input:focus {
    border-color: #2b6aa8;
    outline: 2px solid #2b6aa8;
    outline-offset: 1px;
}

/* ---- Field spacing for user-profile-commons fields ---- */

#magfest-form-section #kc-idp-review-profile-form > .form-group,
#magfest-form-section #kc-update-profile-form > .form-group {
    margin-bottom: 16px !important;
    overflow: hidden;
}

/* ---- Helper text before/after profile fields ---- */

#kc-idp-review-profile-form .pf-c-form__helper-text,
#kc-update-profile-form .pf-c-form__helper-text {
    font-size: 12px;
    color: #616872;
    line-height: 1.4;
    margin-top: 4px;
    margin-bottom: 4px;
}

#kc-idp-review-profile-form .pf-c-form__helper-text-before,
#kc-update-profile-form .pf-c-form__helper-text-before {
    margin-top: 0;
    margin-bottom: 6px;
}

#kc-idp-review-profile-form .pf-c-form__helper-text-after,
#kc-update-profile-form .pf-c-form__helper-text-after {
    color: #8a5c00;
    font-size: 11px;
    font-style: italic;
}

/* ---- Email display banner (read-only) ---- */

.magfest-email-display {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f0f7ff;
    border: 1px solid #d0e3f7;
    border-radius: 5px;
    padding: 10px 14px;
    margin-bottom: 16px;
}

.magfest-email-display svg {
    flex-shrink: 0;
    color: #337ab7;
}

.magfest-email-display div {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.magfest-email-label {
    font-size: 11px;
    color: #616872;
    line-height: 1.3;
}

.magfest-email-value {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    word-break: break-all;
}

/* ===========================================
   Registration page additions
   =========================================== */

/* ---- Google hint banner ---- */

#magfest-google-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #f0f7ff;
    border: 1px solid #d0e3f7;
    border-radius: 5px;
    padding: 10px 14px;
    font-size: 13px;
    color: #444;
    line-height: 1.4;
    margin-bottom: 10px;
}

#magfest-google-hint svg {
    flex-shrink: 0;
    margin-top: 2px;
}

/* Underlined, not colour alone: WCAG 1.4.1. This link sits mid-sentence inside
   the hint text, which is the case the success criterion is written for. */
#magfest-google-hint a {
    color: #2b6aa8;
    text-decoration: underline;
    font-weight: 500;
}

#magfest-google-hint a:hover {
    color: #1d4d7c;
}

/* ---- Embedded browser interception ---- */
/* The panel replaces the card; the bar appears above it after an override. */

#magfest-embedded-panel {
    box-sizing: border-box;
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    padding: 28px 32px 22px;
    background: #fff;
    border-radius: 8px;
    border-top: 4px solid #d9822b;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    color: #333;
    outline: none;
}

.magfest-embedded-title {
    margin: 0 0 10px 0;
    font-size: 21px;
    font-weight: 600;
    line-height: 1.25;
    color: #222;
}

.magfest-embedded-body {
    margin: 0 0 14px 0;
    font-size: 14px;
    line-height: 1.5;
    color: #444;
}

.magfest-embedded-step {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px 0;
    padding: 11px 14px;
    background: #fef9e7;
    border: 1px solid #f0e0a0;
    border-radius: 5px;
    font-size: 14px;
    line-height: 1.45;
    color: #856404;
}

.magfest-embedded-icon {
    flex-shrink: 0;
    color: #856404;
}

.magfest-embedded-copy {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 11px 16px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    color: #3c4043;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 5px;
    cursor: pointer;
}

.magfest-embedded-copy:hover {
    background: #f7f8f8;
    border-color: #c6c8ca;
}

.magfest-embedded-label {
    margin: 14px 0 4px 0;
    font-size: 12px;
    color: #616872;
}

/* Monospace so a reader can check the domain character by character. The grey
   fill marks it as something to read, not a field to fill in. */
.magfest-embedded-url {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-top: 0;
    padding: 9px 11px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 12px;
    color: #555;
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* Deliberately quiet. Present for false positives, not an equal option. */
.magfest-embedded-override {
    display: block;
    width: 100%;
    margin-top: 18px;
    padding: 10px 0 0 0;
    font-family: inherit;
    font-size: 13px;
    color: #616872;
    text-align: center;
    background: none;
    border: none;
    border-top: 1px solid #eee;
    cursor: pointer;
}

.magfest-embedded-override:hover {
    color: #2b6aa8;
    text-decoration: underline;
}

/* The details block is support tooling, not a user action. It sits below the
   override at the same visual weight as a footnote. */
.magfest-embedded-details-wrap {
    margin-top: 4px;
}

.magfest-embedded-details-wrap [hidden] {
    display: none;
}

.magfest-embedded-details-toggle {
    display: block;
    width: 100%;
    padding: 8px 0 2px 0;
    font-family: inherit;
    font-size: 12.5px;
    color: #616872;
    text-align: center;
    background: none;
    border: none;
    cursor: pointer;
}

.magfest-embedded-details-toggle:hover {
    color: #2b6aa8;
    text-decoration: underline;
}

.magfest-embedded-details-toggle[aria-expanded="true"] {
    color: #2b6aa8;
}

.magfest-embedded-details {
    margin-top: 8px;
}

/* Wraps rather than scrolls so a screenshot captures the whole user agent.
   Monospace keeps a hand-transcribed string readable character by character. */
.magfest-embedded-details-text {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 9px 11px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 11.5px;
    line-height: 1.5;
    color: #555;
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 5px;
    resize: vertical;
    white-space: pre-wrap;
    word-break: break-all;
}

.magfest-embedded-details .magfest-embedded-copy {
    margin-top: 8px;
    font-size: 13.5px;
    padding: 8px 14px;
}

/* Shown after the card on pages the panel did not intercept. */
.magfest-embedded-details-standalone {
    box-sizing: border-box;
    width: 100%;
    max-width: 460px;
    margin: 12px auto 0 auto;
    padding: 0 32px 14px;
}

#magfest-embedded-bar {
    box-sizing: border-box;
    width: 100%;
    max-width: 460px;
    margin: 0 auto 12px auto;
    padding: 10px 14px;
    background: #fef9e7;
    border: 1px solid #f0e0a0;
    border-radius: 6px;
    color: #856404;
    font-size: 12.5px;
    line-height: 1.45;
}

/* ---- Required field indicator ---- */

.magfest-required {
    color: #c0392b;
    margin-left: 2px;
}

/* ---- Help text below fields ---- */

.magfest-help-text {
    display: block;
    font-size: 11px;
    color: #616872;
    margin-top: 4px;
    line-height: 1.4;
}

/* ---- Style KC user-profile-rendered inputs ---- */

#kc-register-form input[type="text"],
#kc-register-form input[type="email"],
#kc-register-form input[type="password"] {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    font-family: inherit;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    background: #fff;
    color: #333;
    transition: border-color 0.15s;
}

#kc-register-form input:focus {
    border-color: #2b6aa8;
    outline: 2px solid #2b6aa8;
    outline-offset: 1px;
}

/* ---- KC user profile annotations / helper text ---- */

.pf-c-helper-text,
.kc-form-helper-text {
    font-size: 11px;
    color: #616872;
    margin-top: 4px;
    line-height: 1.4;
}

/* ===========================================
   Error page
   =========================================== */

.magfest-error-content {
    text-align: center;
    padding: 10px 0;
}

.magfest-error-message {
    font-size: 15px;
    color: #555;
    line-height: 1.5;
    margin: 0 0 24px 0;
}

/* Secondary line below the primary action on the Workspace block page. Reuses the
   #616872 of .magfest-back-link: 5.63:1 against the card's #fff, above the 4.5:1
   WCAG AA minimum for normal text. */
.magfest-error-secondary {
    font-size: 13px;
    color: #616872;
    line-height: 1.5;
    margin: 16px 0 0 0;
}

.magfest-error-content .magfest-btn {
    display: inline-block;
    width: auto;
    padding: 11px 32px;
}

.magfest-btn-google-workspace {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #1a73e8;
    border: 1px solid #1a73e8;
    color: #fff;
    font-weight: 500;
    padding: 12px 24px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 15px;
    transition: background-color 0.15s;
}

.magfest-btn-google-workspace:hover {
    background: #1557b0;
    border-color: #1557b0;
    color: #fff;
    text-decoration: none;
}

.magfest-btn-google-workspace .google-g-icon {
    margin: 0;
}

.magfest-back-link {
    display: block;
    margin-top: 16px;
    font-size: 13px;
    color: #616872;
    text-decoration: none;
}

.magfest-back-link:hover {
    color: #2b6aa8;
    text-decoration: underline;
}

/* ===========================================
   Info / Verify Email pages
   =========================================== */

.magfest-info-content {
    text-align: center;
    padding: 10px 0;
}

.magfest-info-icon {
    margin-bottom: 16px;
}

.magfest-info-message {
    font-size: 15px;
    color: #555;
    line-height: 1.6;
    margin: 0 0 16px 0;
}

.magfest-info-hint {
    font-size: 13px;
    color: #616872;
    line-height: 1.5;
    margin: 0;
}

.magfest-info-hint a {
    color: #2b6aa8;
    text-decoration: none;
    font-weight: 500;
}

.magfest-info-hint a:hover {
    text-decoration: underline;
}

.magfest-info-actions {
    text-align: center;
    margin-top: 20px;
}

.magfest-info-actions .magfest-btn {
    display: inline-block;
    width: auto;
    padding: 11px 32px;
    text-decoration: none;
}

.magfest-required-action {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

/* ===========================================
   Secondary button (outline style)
   =========================================== */

.magfest-btn-secondary {
    background: #fff;
    border: 1px solid #ccc;
    color: #555;
    font-weight: 500;
    font-size: 15px;
}

.magfest-btn-secondary:hover {
    background: #f5f5f5;
    border-color: #aaa;
}

/* ---- IdP link confirm stacked buttons ---- */

.magfest-link-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.magfest-link-actions .magfest-btn {
    display: block;
    width: 100%;
}

/* ---- Logout confirm buttons ---- */

.magfest-logout-buttons {
    text-align: center;
}

.magfest-logout-buttons .magfest-btn {
    display: inline-block;
    width: 100%;
    text-decoration: none;
}

/* ===========================================
   OAuth consent screen
   =========================================== */

.magfest-oauth-content {
    padding: 10px 0;
}

.magfest-oauth-client {
    text-align: center;
    margin-bottom: 20px;
}

.magfest-oauth-logo {
    max-width: 64px;
    max-height: 64px;
    margin-bottom: 12px;
    border-radius: 8px;
}

.magfest-oauth-scopes {
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 14px 18px;
    margin-bottom: 20px;
}

.magfest-oauth-scopes-title {
    font-size: 13px;
    font-weight: 500;
    color: #444;
    margin: 0 0 10px 0;
}

.magfest-oauth-scope-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.magfest-oauth-scope-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 14px;
    color: #555;
    border-bottom: 1px solid #eee;
}

.magfest-oauth-scope-list li:last-child {
    border-bottom: none;
}

.magfest-oauth-legal {
    text-align: center;
    margin-bottom: 16px;
    font-size: 12px;
}

.magfest-oauth-legal a {
    color: #2b6aa8;
    text-decoration: none;
    margin: 0 8px;
}

.magfest-oauth-legal a:hover {
    text-decoration: underline;
}

.magfest-oauth-buttons {
    display: flex;
    gap: 10px;
}

.magfest-oauth-buttons .magfest-btn {
    flex: 1;
}

/* ===========================================
   TOTP / 2FA Setup page
   =========================================== */

.magfest-totp-steps {
    margin-bottom: 20px;
}

.magfest-totp-step {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.magfest-totp-step:last-child {
    margin-bottom: 0;
}

.magfest-totp-step-number {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    background: #337ab7;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    margin-top: 1px;
}

.magfest-totp-step-content {
    flex: 1;
    min-width: 0;
}

.magfest-totp-step-text {
    font-size: 14px;
    color: #444;
    margin: 3px 0 6px 0;
    line-height: 1.4;
}

.magfest-totp-app-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.magfest-totp-app-list li {
    font-size: 13px;
    color: #555;
    padding: 2px 0;
    padding-left: 14px;
    position: relative;
}

.magfest-totp-app-list li::before {
    content: "\2022";
    position: absolute;
    left: 0;
    color: #999;
}

.magfest-totp-qr-wrapper {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
    display: inline-block;
    margin: 6px 0;
}

.magfest-totp-qr-wrapper img {
    display: block;
    max-width: 200px;
    height: auto;
}

.magfest-totp-mode-link {
    display: inline-block;
    font-size: 13px;
    color: #2b6aa8;
    text-decoration: none;
    margin-top: 4px;
}

.magfest-totp-mode-link:hover {
    text-decoration: underline;
}

.magfest-totp-secret-key {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 10px 14px;
    margin: 6px 0;
    word-break: break-all;
}

.magfest-totp-secret-key code {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    letter-spacing: 1px;
}

.magfest-totp-manual-details {
    margin-top: 12px;
}

.magfest-totp-config-list {
    list-style: none;
    padding: 0;
    margin: 4px 0 0 0;
}

.magfest-totp-config-list li {
    font-size: 13px;
    color: #555;
    padding: 3px 0;
}

.magfest-totp-config-list li strong {
    color: #333;
}

.magfest-totp-buttons {
    display: flex;
    gap: 10px;
}

.magfest-totp-buttons .magfest-btn {
    flex: 1;
}

/* ===========================================
   OTP Login (2FA code entry)
   =========================================== */

.magfest-otp-devices {
    margin-bottom: 20px;
}

.magfest-otp-devices-label {
    font-size: 13px;
    font-weight: 500;
    color: #444;
    margin: 0 0 8px 0;
}

.magfest-otp-device-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
}

.magfest-otp-device-option:hover {
    background: #f8f9fa;
    border-color: #ccc;
}

.magfest-otp-device-option:has(input:checked) {
    border-color: #337ab7;
    background: #f0f7ff;
}

.magfest-otp-device-option input[type="radio"] {
    margin: 0;
    accent-color: #337ab7;
}

.magfest-otp-device-name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #333;
}

.magfest-otp-device-name svg {
    color: #616872;
    flex-shrink: 0;
}

/* ===========================================
   Select Authenticator page
   =========================================== */

.magfest-auth-select-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.magfest-auth-select-option {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, background-color 0.15s;
    font-family: inherit;
}

.magfest-auth-select-option:hover {
    background: #f8f9fa;
    border-color: #337ab7;
}

.magfest-auth-select-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: #f0f7ff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #337ab7;
}

.magfest-auth-select-body {
    flex: 1;
    min-width: 0;
}

.magfest-auth-select-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
}

.magfest-auth-select-desc {
    font-size: 12px;
    color: #616872;
    line-height: 1.4;
}

.magfest-auth-select-arrow {
    flex-shrink: 0;
    color: #ccc;
}

.magfest-auth-select-option:hover .magfest-auth-select-arrow {
    color: #337ab7;
}

/* ===========================================
   Recovery Codes Config page
   =========================================== */

.magfest-recovery-codes-box {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.magfest-recovery-codes-list {
    list-style: none;
    padding: 0;
    margin: 0;
    columns: 2;
    column-gap: 24px;
}

.magfest-recovery-codes-list li {
    font-size: 14px;
    padding: 4px 0;
    font-family: "Courier New", Courier, monospace;
    color: #333;
    break-inside: avoid;
}

.magfest-recovery-code-num {
    color: #686868;
    display: inline-block;
    width: 24px;
    text-align: right;
    margin-right: 6px;
}

.magfest-recovery-codes-list li code {
    font-weight: 600;
    letter-spacing: 0.5px;
}

.magfest-recovery-codes-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.magfest-recovery-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    font-size: 13px;
    font-family: inherit;
    color: #2b6aa8;
    background: #fff;
    border: 1px solid #d0e3f7;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}

.magfest-recovery-action-btn:hover {
    background: #f0f7ff;
    border-color: #2b6aa8;
}

/* ===========================================
   Terms and Conditions page
   =========================================== */

.magfest-terms-content {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 18px 20px;
    margin-bottom: 20px;
    max-height: 300px;
    overflow-y: auto;
    font-size: 13px;
    color: #444;
    line-height: 1.6;
}

.magfest-terms-content h1,
.magfest-terms-content h2,
.magfest-terms-content h3 {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 14px 0 6px 0;
}

.magfest-terms-content h1:first-child,
.magfest-terms-content h2:first-child,
.magfest-terms-content h3:first-child {
    margin-top: 0;
}

.magfest-terms-content p {
    margin: 0 0 10px 0;
}

.magfest-terms-content a {
    color: #2b6aa8;
}

/* ===========================================
   Danger button (delete actions)
   =========================================== */

.magfest-btn-danger {
    background: #c0392b;
    border: 1px solid #a93226;
    color: #fff;
    font-weight: 500;
    font-size: 15px;
}

.magfest-btn-danger:hover {
    background: #a93226;
    border-color: #922b21;
}

/* ===========================================
   Delete account consequences list
   =========================================== */

.magfest-delete-consequences {
    list-style: disc;
    list-style-position: inside;
    padding: 0;
    margin: 10px 0 0 0;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

/* ===========================================
   Loading spinner (SAML redirect, etc.)
   =========================================== */

.magfest-spinner {
    animation: magfest-spin 0.8s linear infinite;
    display: block;
    margin: 0 auto;
}

@keyframes magfest-spin {
    to { transform: rotate(360deg); }
}
/* ===========================================
   Utilities
   =========================================== */

/* Reaches screen readers, not the screen. Carries the <legend> that groups the
   credential fields, where the card heading already names the group. */
.magfest-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* The <fieldset> answers input_fields_grouped. It carries no layout of its own;
   the browser default border and padding would shift the form. */
.magfest-fieldset {
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

/* ===========================================
   Keyboard focus
   =========================================== */

/* style_focus_visible flags any control whose CSS touches 'border' or 'outline'.
   Inputs set outline: none behind a 20 percent alpha box-shadow, and buttons and
   links fell through to the browser default, which the dark background washes
   out. One ring now covers every control. #2b6aa8 is 5.63:1 on the white card,
   above the 3:1 minimum in WCAG 1.4.11. */

.magfest-btn:focus-visible,
.magfest-forgot:focus-visible,
.magfest-back-link:focus-visible,
.magfest-totp-mode-link:focus-visible,
.magfest-recovery-action-btn:focus-visible,
.magfest-auth-select-option:focus-visible,
.magfest-otp-device-option:focus-within,
.magfest-embedded-copy:focus-visible,
.magfest-embedded-details-toggle:focus-visible,
.magfest-embedded-details-text:focus-visible,
.magfest-embedded-override:focus-visible,
.magfest-password-wrapper button:focus-visible,
.magfest-remember input:focus-visible,
#magfest-register a:focus-visible,
#magfest-google-hint a:focus-visible,
.magfest-info-hint a:focus-visible,
.magfest-oauth-legal a:focus-visible,
.magfest-terms-content a:focus-visible {
    outline: 2px solid #2b6aa8;
    outline-offset: 2px;
}

/* ===========================================
   Windows high contrast mode
   =========================================== */

/* style_highcontrast_visible asks whether the page survives forced colors.
   Forced colors drops background-color and box-shadow, so the card, the divider
   rules and the buttons lose every edge they have; each needs a real border.
   System color keywords are the only colors honored inside this block. */

@media (forced-colors: active) {
    #magfest-login-card,
    #magfest-embedded-panel,
    .magfest-embedded-details-text,
    .magfest-oauth-scopes,
    .magfest-terms-content,
    .magfest-recovery-codes-box {
        border: 1px solid CanvasText;
    }

    .magfest-btn,
    .magfest-auth-select-option,
    .magfest-otp-device-option {
        border: 1px solid ButtonBorder;
    }

    .magfest-divider::before,
    .magfest-divider::after {
        background: CanvasText;
    }

    .magfest-btn:focus-visible,
    .magfest-field input:focus,
    .magfest-password-wrapper button:focus-visible,
    a:focus-visible {
        outline: 2px solid Highlight;
        outline-offset: 2px;
    }
}
