/**
 * UMM — passkeys: the sign-in button, the second-step chooser, and the
 * "Securitatea contului" slide panel (the house panel, copied and scoped here
 * as every module carries its own copy).
 */

/* ── The sign-in pages: wp-login.php and the front page ──────────────
 * One way in leads, the other is a link (umm-passkey.js layout()):
 * .umm-pk-login--primary = in place of the form, two cards side by side:
 *                          the passkey and "Conectare cu parola",
 * .umm-pk-login--link    = the passkey as a link under "Conectare". */
.umm-pk-login {
    margin: 0;
    clear: both;
}
.umm-pk-login[hidden] {
    display: none;
}
/* A field put away while the passkey leads. */
[data-umm-pk-hidden] {
    display: none !important;
}
/* Two classes and later than core: wp-login.php's .wp-core-ui .button. */
.umm-pk-login .umm-pk-login-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.umm-pk-login-btn.button {
    margin-top: 8px;
}
/* Four classes: wp-login.php's .wp-core-ui .button .dashicons gives an icon
   in a button line-height 1.9 — on 18px a 34px line, the glyph 8px low. */
.umm-pk-login .umm-pk-login-btn .dashicons.dashicons {
    flex: none;
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 18px;
    vertical-align: middle;
}
.umm-pk-login--link {
    text-align: center;
}
.umm-pk-login--link .umm-pk-login-btn,
.umm-pk-switch {
    display: inline-flex;
    width: auto;
    margin: 8px auto 0;
    padding: 4px 8px !important;
    min-height: 0 !important;
    background: none !important;
    border: 0 !important;
    box-shadow: none !important;
    transform: none !important;
    color: inherit !important;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    cursor: pointer;
}
/* The words only: an underline set on the button runs under the icon too. */
.umm-pk-login--link .umm-pk-label,
.umm-pk-switch {
    text-decoration: underline;
    text-underline-offset: 2px;
}
.umm-pk-switch {
    display: block;
    margin: 10px auto 0;
}
.umm-pk-switch[hidden] {
    display: none;
}
.umm-pk-status {
    margin: 8px 0 0;
    font-size: 13px;
    min-height: 1em;
}
.umm-pk-status--error {
    color: #b32d2e;
}

/* ── The two ways in, side by side (.umm-pk-login--primary) ────────
 * Cards, not buttons: the passkey, in the skin's own colour (layout()
 * reads it from the skin's "Conectare" button into --umm-pk-accent*), and
 * the password, in the text colour of the form. Every skin dresses its
 * buttons its own way, some with !important (Monochrome, Modern): three
 * classes and !important on what makes a card. color-mix() after an rgba()
 * a browser without it keeps.
 * Two columns, said outright. auto-fit made as many 120px tracks as the
 * form is wide and folded the empty ones away — until the status line
 * ("Se verifică cheia de acces…") arrived spanning all of them: none was
 * empty any more, and the two cards shrank into the first two of four. */
.umm-pk-login.umm-pk-login--primary:not([hidden]) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}
@media (max-width: 340px) {
    .umm-pk-login.umm-pk-login--primary:not([hidden]) {
        grid-template-columns: minmax(0, 1fr);
    }
}
.umm-pk-login.umm-pk-login--primary .umm-pk-status {
    grid-column: 1 / -1;
    margin: 0;
    text-align: center;
}
.umm-pk-login.umm-pk-login--primary .umm-pk-login-btn,
.umm-pk-login.umm-pk-login--primary .umm-pk-switch {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 18px 10px 16px !important;
    border: 1px solid rgba(127, 127, 127, 0.35) !important;
    border-color: color-mix(in srgb, currentColor 22%, transparent) !important;
    border-radius: 14px !important;
    background: rgba(127, 127, 127, 0.06) !important;
    background: color-mix(in srgb, currentColor 5%, transparent) !important;
    box-shadow: none !important;
    color: inherit !important;
    font-family: inherit;
    font-size: inherit;
    text-align: center;
    text-transform: none !important;
    text-decoration: none !important;
    letter-spacing: normal !important;
    line-height: 1.3 !important;
    white-space: normal !important;
    transform: none !important;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease, translate 0.15s ease;
}
.umm-pk-login.umm-pk-login--primary .umm-pk-login-btn {
    border-color: var(--umm-pk-accent, currentColor) !important;
    background: rgba(127, 127, 127, 0.08) !important;
    background: color-mix(in srgb, var(--umm-pk-accent, currentColor) 10%, transparent) !important;
    box-shadow: inset 0 0 0 1px var(--umm-pk-accent, currentColor) !important;
}
.umm-pk-login.umm-pk-login--primary .umm-pk-login-btn:hover,
.umm-pk-login.umm-pk-login--primary .umm-pk-switch:hover {
    translate: 0 -2px;
}
.umm-pk-login.umm-pk-login--primary .umm-pk-login-btn:hover {
    background: color-mix(in srgb, var(--umm-pk-accent, currentColor) 16%, transparent) !important;
    box-shadow: inset 0 0 0 1px var(--umm-pk-accent, currentColor), 0 10px 24px -12px var(--umm-pk-accent, rgba(0, 0, 0, 0.5)) !important;
}
.umm-pk-login.umm-pk-login--primary .umm-pk-switch:hover {
    border-color: color-mix(in srgb, currentColor 45%, transparent) !important;
    background: color-mix(in srgb, currentColor 9%, transparent) !important;
}
.umm-pk-login.umm-pk-login--primary .umm-pk-login-btn:focus-visible,
.umm-pk-login.umm-pk-login--primary .umm-pk-switch:focus-visible {
    outline: 2px solid var(--umm-pk-accent, currentColor) !important;
    outline-offset: 3px;
}
.umm-pk-login.umm-pk-login--primary .umm-pk-login-btn:disabled {
    opacity: 0.6;
    cursor: progress;
    translate: none;
}
/* The icon in a disc: the skin's fill on the passkey, a tint on the password. */
.umm-pk-login.umm-pk-login--primary .umm-pk-login-btn .dashicons.dashicons,
.umm-pk-login.umm-pk-login--primary .umm-pk-switch .dashicons.dashicons {
    display: block;
    width: 44px;
    height: 44px;
    margin: 0 0 6px;
    border-radius: 50%;
    font-size: 22px;
    line-height: 44px;
    text-align: center;
    text-decoration: none;
}
.umm-pk-login.umm-pk-login--primary .umm-pk-login-btn .dashicons.dashicons {
    background: var(--umm-pk-accent-fill, rgba(127, 127, 127, 0.2));
    color: var(--umm-pk-accent-ink, inherit);
}
.umm-pk-login.umm-pk-login--primary .umm-pk-switch .dashicons.dashicons {
    background: rgba(127, 127, 127, 0.16);
    background: color-mix(in srgb, currentColor 12%, transparent);
    color: inherit;
}
.umm-pk-login.umm-pk-login--primary .umm-pk-label {
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none;
}
/* Two even lines, not one word left alone on the second. */
.umm-pk-login.umm-pk-login--primary .umm-pk-label,
.umm-pk-login.umm-pk-login--primary .umm-pk-hint {
    text-wrap: balance;
}
.umm-pk-hint {
    display: none;
}
.umm-pk-login.umm-pk-login--primary .umm-pk-hint {
    display: block;
    font-size: 12px;
    font-weight: 400;
    opacity: 0.75;
}
@media (prefers-reduced-motion: reduce) {
    .umm-pk-login.umm-pk-login--primary .umm-pk-login-btn,
    .umm-pk-login.umm-pk-login--primary .umm-pk-switch {
        transition: none;
        translate: none;
    }
}

/* ── The front page (every skin) ────────────────────────────────── */
.umm-pk-login.umm-pk-front {
    margin: 10px 0 0;
    /* a full row where the skin lays its actions out as a flex row (Vibrant) */
    flex: 1 1 100%;
    width: 100%;
    box-sizing: border-box;
}
.umm-pk-front .umm-btn.umm-pk-login-btn {
    padding-left: 12px;
    padding-right: 12px;
}
.umm-pk-login .umm-pk-status:empty {
    display: none;
}

/* ── The second step (wp-login.php chooser page) ─────────────────── */
#umm-sec-pk-second .button-primary {
    width: 100%;
    padding: 6px;
    font-size: 14px;
}
.umm-sec-pk-alt {
    margin-top: 16px;
    text-align: center;
}
.umm-sec-pk-alt .button-link {
    font-size: 13px;
}

/* ── "Securitatea contului" — house slide panel ───────────────────── */
.umm-sec-account-panel {
    position: fixed;
    inset: 0;
    z-index: 159999;
    /* A closed panel is still in the DOM: it must never catch a click. */
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.umm-sec-account-panel.active {
    pointer-events: auto;
    opacity: 1;
}
.umm-sec-account-panel .umm-slide-panel-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.umm-sec-account-panel.active .umm-slide-panel-overlay {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}
.umm-sec-account-panel .umm-slide-panel-container {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(560px, 100%);
    /* The house panel (Configurare Securitate): a white body, a pale header
       on a hairline, outlined groups with coloured titles. */
    background: #fff;
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 160000;
}
.umm-sec-account-panel.active .umm-slide-panel-container {
    transform: translateX(0);
}
.umm-sec-account-panel .umm-slide-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.umm-sec-account-panel .umm-panel-header-left h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}
.umm-sec-account-panel .umm-panel-header-left h2 .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: var(--umm-primary, #2563eb);
}
.umm-sec-account-panel .umm-panel-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.umm-sec-account-panel .umm-panel-close {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    background: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: #64748b;
    transition: color 0.15s ease, background 0.15s ease;
}
.umm-sec-account-panel .umm-panel-close:hover,
.umm-sec-account-panel .umm-panel-close:focus-visible {
    color: #ef4444;
    background: #fef2f2;
}
.umm-sec-account-panel .umm-panel-close .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    margin: 0;
}
.umm-sec-account-panel .umm-slide-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px;
    background: #fff;
}

/* The group, the list, the actions */
.umm-sec-acc-group {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    padding: 4px 14px 14px;
    margin: 0 0 18px;
    min-width: 0;
}
.umm-sec-acc-group legend {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    padding: 2px 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--umm-primary, #2563eb);
}
.umm-sec-acc-group legend .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}
.umm-sec-acc-hint {
    margin: 0 0 12px;
    color: var(--umm-gray-600, #4b5563);
    font-size: 13px;
    line-height: 1.5;
}
.umm-sec-acc-list[data-state="loading"] {
    color: var(--umm-gray-600, #4b5563);
    font-size: 13px;
}
.umm-sec-acc-empty {
    margin: 0;
    color: var(--umm-gray-600, #4b5563);
    font-style: italic;
}
.umm-sec-acc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--umm-gray-200, #e5e7eb);
}
.umm-sec-acc-row:first-child {
    border-top: none;
}
.umm-sec-acc-name {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.umm-sec-acc-badge {
    font-size: 11px;
    font-weight: 500;
    padding: 1px 8px;
    border-radius: 10px;
    background: #ecfdf5;
    color: #047857;
}
.umm-sec-acc-meta {
    font-size: 12px;
    color: var(--umm-gray-600, #4b5563);
    margin-top: 2px;
}
.umm-sec-acc-tools {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
/* The safe action is the one filled button, on its own line, away from the
   row tools (a destructive button never shares a corner). */
.umm-sec-acc-actions {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--umm-gray-200, #e5e7eb);
}
.umm-sec-acc-actions .umm-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

@media (max-width: 680px) {
    .umm-sec-account-panel .umm-slide-panel-container {
        width: 100%;
    }
    .umm-sec-account-panel .umm-slide-panel-header {
        padding: 12px 14px;
    }
    .umm-sec-account-panel .umm-slide-panel-body {
        padding: 14px;
    }
    .umm-sec-acc-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .umm-sec-account-panel,
    .umm-sec-account-panel .umm-slide-panel-container,
    .umm-sec-account-panel .umm-slide-panel-overlay {
        transition: none;
    }
}

/* ── Recovery codes ───────────────────────────────────────────────── */
.umm-sec-rc-status {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
}
/* Shown once, in a UMMDialog (outside the panel). */
.umm-sec-rc-codes {
    font: 600 17px/1.9 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    letter-spacing: 0.08em;
    background: #f8fafc;
    border: 1px dashed #94a3b8;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 12px 0;
    column-count: 2;
    column-gap: 24px;
    white-space: pre;
    user-select: all;
}
.umm-sec-rc-tools {
    display: flex;
    gap: 8px;
    margin: 0;
}
@media (max-width: 480px) {
    .umm-sec-rc-codes {
        column-count: 1;
    }
}
