.my-authenticator,
.my-authenticator * {
    box-sizing: border-box;
}

.my-authenticator [hidden] {
    display: none !important;
}

.my-authenticator {
    background: #0b1530;
    max-width: 680px;
    margin: 0 auto;
    padding: 1.5rem;
    border-radius: 12px;
    color: #f9fafb;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.my-authenticator form p {
    margin: 0 0 1rem;
}

.my-authenticator label {
    display: block;
    margin-bottom: 0.3rem;
    color: #e5e7eb;
    font-weight: 600;
}

.my-authenticator input[type="text"] {
    width: 100%;
    min-height: 44px;
    padding: 0.6rem 0.75rem;
    border: 1px solid #374151;
    border-radius: 7px;
    outline: 0;
    background: #020617;
    color: #f9fafb;
    font-size: 16px;
}

.my-authenticator input[type="text"]:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.my-authenticator-form-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
}

.my-authenticator .my-authenticator-add,
.my-authenticator .my-authenticator-scan {
    min-height: 42px;
    border: 1px solid #fff;
    border-radius: 5px;
    background: transparent;
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.my-authenticator .my-authenticator-add {
    padding: 0.55rem 1rem;
}

.my-authenticator .my-authenticator-scan {
    display: none;
    width: 44px;
    padding: 0;
    align-items: center;
    justify-content: center;
}

.my-authenticator.mobile-scanner-enabled .my-authenticator-scan {
    display: inline-flex;
}

.my-authenticator .my-authenticator-scan svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.my-authenticator .my-authenticator-add:hover,
.my-authenticator .my-authenticator-scan:hover,
.my-authenticator .my-authenticator-add:focus-visible,
.my-authenticator .my-authenticator-scan:focus-visible {
    border-color: #93c5fd;
    background: rgba(59, 130, 246, 0.18);
}

.my-authenticator button:disabled {
    cursor: wait;
    opacity: 0.55;
}

.my-authenticator-form-status,
.my-authenticator-request-status {
    min-height: 1.25em;
    margin: 0.65rem 0 0 !important;
    color: #cbd5e1;
    text-align: center;
    font-size: 0.85rem;
}

.my-authenticator-form-status.is-error,
.my-authenticator-request-status.is-error {
    color: #fca5a5;
}

.my-authenticator-form-status.is-success,
.my-authenticator-request-status.is-success {
    color: #93c5fd;
}

.my-authenticator-empty {
    margin: 1.5rem 0 0;
    color: #cbd5e1;
    text-align: center;
}

.authenticator-codes {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 2rem;
}

.authenticator-code {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 52px auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem 1rem;
    border: 1px solid #1f2937;
    border-radius: 8px;
    background: #020617;
}

.authenticator-code .name {
    min-width: 0;
    overflow: hidden;
    color: #e5e7eb;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.authenticator-code .code {
    min-width: 100px;
    color: #fff;
    font-family: "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 1rem;
    letter-spacing: 0.2em;
    text-align: center;
}

.authenticator-code .timer {
    color: #9ca3af;
    font-size: 0.875rem;
    text-align: right;
}

.authenticator-code .delete-secret {
    padding: 0.4rem 0.85rem;
    border: 0;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    cursor: pointer;
    font-size: 0.8rem;
}

.authenticator-code .delete-secret:hover {
    background: #b91c1c;
}

.my-authenticator-requests {
    margin: 0 0 1.75rem;
    padding: 0 0 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.my-authenticator-requests-heading,
.my-authenticator-request-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.my-authenticator-requests-heading {
    margin-bottom: 0.75rem;
}

.my-authenticator-requests-heading h3 {
    margin: 0;
    color: #fff;
    font-size: 1.05rem;
}

.my-authenticator-requests-heading > span {
    color: #93c5fd;
    font-size: 0.78rem;
}

.my-authenticator-request {
    margin-top: 0.75rem;
    padding: 1rem;
    border: 1px solid rgba(96, 165, 250, 0.4);
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(13, 31, 62, 0.98), rgba(3, 12, 29, 0.98));
    transition: border-color 0.2s ease, opacity 0.2s ease;
}

.my-authenticator-request.is-selected {
    border-color: #60a5fa;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.22);
}

.my-authenticator-request.is-expired {
    opacity: 0.6;
}

.my-authenticator-request.is-approved {
    border-color: #60a5fa;
}

.my-authenticator-request.is-denied {
    border-color: #ef4444;
}

.my-authenticator-request-topline strong {
    color: #fff;
    font-size: 0.98rem;
}

.my-authenticator-request-topline span {
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.16);
    color: #bfdbfe;
    font-size: 0.72rem;
    white-space: nowrap;
}

.my-authenticator-request > p:not(.my-authenticator-request-status) {
    margin: 0.7rem 0;
    color: #dbe4f0;
    font-size: 0.9rem;
    line-height: 1.45;
}

.my-authenticator-request-account,
.my-authenticator-request-expiry {
    color: #94a3b8;
    font-size: 0.78rem;
}

.my-authenticator-request-expiry {
    margin-top: 0.35rem;
}

.my-authenticator-request-actions {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 0.65rem;
    margin-top: 0.9rem;
}

.my-authenticator-request-actions button {
    min-height: 42px;
    padding: 0.55rem 0.75rem;
    border-radius: 6px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.my-authenticator-deny {
    border: 1px solid rgba(248, 113, 113, 0.7);
    background: transparent;
}

.my-authenticator-approve {
    border: 1px solid #2563eb;
    background: #2563eb;
}

.my-authenticator-deny:hover {
    background: rgba(220, 38, 38, 0.2);
}

.my-authenticator-approve:hover {
    background: #1d4ed8;
}

.my-authenticator-modal,
.my-authenticator-scanner {
    position: fixed;
    z-index: 999999;
    inset: 0;
}

.my-authenticator-modal {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.my-authenticator-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
}

.my-authenticator-modal-dialog {
    position: relative;
    width: min(420px, 100%);
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    background: #0b1220;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 14px;
    line-height: 1.5;
}

.my-authenticator-modal-dialog p {
    margin: 0;
}

.my-authenticator-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.my-authenticator-scanner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: #000;
}

.my-authenticator-scanner-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: min(100%, 620px);
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    background: #020617;
}

.my-authenticator-scanner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    padding: calc(0.7rem + env(safe-area-inset-top)) 1rem 0.7rem;
    background: #050b18;
    color: #fff;
}

.my-authenticator-scanner-close {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.28);
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}

.my-authenticator-camera-frame {
    position: relative;
    min-height: 0;
    overflow: hidden;
    background: #000;
}

.my-authenticator-camera-preview {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.my-authenticator-camera-source {
    position: absolute !important;
    z-index: -1 !important;
    top: 0 !important;
    left: 0 !important;
    display: block !important;
    width: 2px !important;
    height: 2px !important;
    opacity: 0.001 !important;
    pointer-events: none !important;
    transform: scale(0.01) !important;
    transform-origin: top left !important;
}

.my-authenticator-camera-source::-webkit-media-controls,
.my-authenticator-camera-source::-webkit-media-controls-enclosure,
.my-authenticator-camera-source::-webkit-media-controls-panel,
.my-authenticator-camera-source::-webkit-media-controls-fullscreen-button {
    display: none !important;
    -webkit-appearance: none !important;
}

.my-authenticator-camera-frame::after {
    position: absolute;
    z-index: 1;
    inset: 0;
    background: radial-gradient(circle at center, transparent 0, transparent 31%, rgba(0, 0, 0, 0.48) 55%, rgba(0, 0, 0, 0.72) 100%);
    content: "";
    pointer-events: none;
}

.my-authenticator-scan-box {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    width: min(72vw, 310px);
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.my-authenticator-scan-box span {
    position: absolute;
    width: 44px;
    height: 44px;
    border-color: #fff;
    border-style: solid;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7));
}

.my-authenticator-scan-box span:nth-child(1) {
    top: 0;
    left: 0;
    border-width: 4px 0 0 4px;
    border-radius: 8px 0 0;
}

.my-authenticator-scan-box span:nth-child(2) {
    top: 0;
    right: 0;
    border-width: 4px 4px 0 0;
    border-radius: 0 8px 0 0;
}

.my-authenticator-scan-box span:nth-child(3) {
    right: 0;
    bottom: 0;
    border-width: 0 4px 4px 0;
    border-radius: 0 0 8px;
}

.my-authenticator-scan-box span:nth-child(4) {
    bottom: 0;
    left: 0;
    border-width: 0 0 4px 4px;
    border-radius: 0 0 0 8px;
}

.my-authenticator-scanner-status {
    min-height: 62px;
    margin: 0;
    padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom));
    background: #050b18;
    color: #dbeafe;
    text-align: center;
    font-size: 0.88rem;
    line-height: 1.4;
}

body.my-authenticator-modal-open,
body.my-authenticator-camera-open {
    overflow: hidden;
}

@media (max-width: 620px) {
    .my-authenticator {
        padding: 1rem;
        border-radius: 9px;
    }

    .authenticator-code {
        grid-template-columns: minmax(0, 1fr) auto auto;
        gap: 0.55rem;
    }

    .authenticator-code .name {
        grid-column: 1 / -1;
        white-space: normal;
    }

    .authenticator-code .code {
        min-width: 0;
        text-align: left;
    }

    .authenticator-code .timer {
        width: auto;
    }
}

@media (min-width: 700px) {
    .my-authenticator-scanner {
        padding: 1.5rem;
        background: rgba(0, 0, 0, 0.86);
    }

    .my-authenticator-scanner-panel {
        height: min(820px, calc(100dvh - 3rem));
        border: 1px solid rgba(255, 255, 255, 0.14);
        border-radius: 16px;
    }
}
